@@ -65,7 +65,7 @@ typedef struct _ciMethodDataRecord {
65
65
const char * _signature;
66
66
67
67
int _state;
68
- int _current_mileage ;
68
+ int _invocation_counter ;
69
69
70
70
intptr_t * _data;
71
71
char * _orig_data;
@@ -115,6 +115,7 @@ class CompileReplay : public StackObj {
115
115
Handle _protection_domain;
116
116
bool _protection_domain_initialized;
117
117
Handle _loader;
118
+ int _version;
118
119
119
120
GrowableArray<ciMethodRecord*> _ci_method_records;
120
121
GrowableArray<ciMethodDataRecord*> _ci_method_data_records;
@@ -159,6 +160,7 @@ class CompileReplay : public StackObj {
159
160
_iklass = NULL ;
160
161
_entry_bci = 0 ;
161
162
_comp_level = 0 ;
163
+ _version = 0 ;
162
164
163
165
test ();
164
166
}
@@ -638,6 +640,11 @@ class CompileReplay : public StackObj {
638
640
tty->print_cr (" # %s" , _bufptr);
639
641
}
640
642
skip_remaining ();
643
+ } else if (strcmp (" version" , cmd) == 0 ) {
644
+ _version = parse_int (" version" );
645
+ if (_version < 0 || _version > REPLAY_VERSION) {
646
+ tty->print_cr (" # unrecognized version %d, expected 0 <= version <= %d" , _version, REPLAY_VERSION);
647
+ }
641
648
} else if (strcmp (" compile" , cmd) == 0 ) {
642
649
process_compile (CHECK);
643
650
} else if (strcmp (" ciMethod" , cmd) == 0 ) {
@@ -802,7 +809,7 @@ class CompileReplay : public StackObj {
802
809
rec->_instructions_size = parse_int (" instructions_size" );
803
810
}
804
811
805
- // ciMethodData <klass> <name> <signature> <state> <current_mileage > orig <length> <byte>* data <length> <ptr>* oops <length> (<offset> <klass>)* methods <length> (<offset> <klass> <name> <signature>)*
812
+ // ciMethodData <klass> <name> <signature> <state> <invocation_counter > orig <length> <byte>* data <length> <ptr>* oops <length> (<offset> <klass>)* methods <length> (<offset> <klass> <name> <signature>)*
806
813
void process_ciMethodData (TRAPS) {
807
814
Method* method = parse_method (CHECK);
808
815
if (had_error ()) return ;
@@ -827,7 +834,11 @@ class CompileReplay : public StackObj {
827
834
// collect and record all the needed information for later
828
835
ciMethodDataRecord* rec = new_ciMethodData (method);
829
836
rec->_state = parse_int (" state" );
830
- rec->_current_mileage = parse_int (" current_mileage" );
837
+ if (_version < 1 ) {
838
+ parse_int (" current_mileage" );
839
+ } else {
840
+ rec->_invocation_counter = parse_int (" invocation_counter" );
841
+ }
831
842
832
843
rec->_orig_data = parse_data (" orig" , rec->_orig_data_length );
833
844
if (rec->_orig_data == NULL ) {
@@ -876,17 +887,18 @@ class CompileReplay : public StackObj {
876
887
void process_instanceKlass (TRAPS) {
877
888
// just load the referenced class
878
889
Klass* k = parse_klass (CHECK);
879
- if (!_protection_domain_initialized && k != NULL ) {
880
- assert (_protection_domain () == NULL , " must be uninitialized" );
881
- // The first entry is the holder class of the method for which a replay compilation is requested.
882
- // Use the same protection domain to load all subsequent classes in order to resolve all classes
883
- // in signatures of inlinees. This ensures that inlining can be done as stated in the replay file.
884
- _protection_domain = Handle (_thread, k->protection_domain ());
885
- }
886
890
887
- // Only initialize the protection domain handle with the protection domain of the very first entry.
888
- // This also ensures that older replay files work.
889
- _protection_domain_initialized = true ;
891
+ if (_version >= 1 ) {
892
+ if (!_protection_domain_initialized && k != NULL ) {
893
+ assert (_protection_domain () == NULL , " must be uninitialized" );
894
+ // The first entry is the holder class of the method for which a replay compilation is requested.
895
+ // Use the same protection domain to load all subsequent classes in order to resolve all classes
896
+ // in signatures of inlinees. This ensures that inlining can be done as stated in the replay file.
897
+ _protection_domain = Handle (_thread, k->protection_domain ());
898
+ }
899
+
900
+ _protection_domain_initialized = true ;
901
+ }
890
902
891
903
if (k == NULL ) {
892
904
return ;
@@ -1413,7 +1425,7 @@ void ciReplay::initialize(ciMethodData* m) {
1413
1425
tty->cr ();
1414
1426
} else {
1415
1427
m->_state = rec->_state ;
1416
- m->_current_mileage = rec->_current_mileage ;
1428
+ m->_invocation_counter = rec->_invocation_counter ;
1417
1429
if (rec->_data_length != 0 ) {
1418
1430
assert (m->_data_size + m->_extra_data_size == rec->_data_length * (int )sizeof (rec->_data [0 ]) ||
1419
1431
m->_data_size == rec->_data_length * (int )sizeof (rec->_data [0 ]), " must agree" );
0 commit comments