Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/interp_masm_x86_64.cpp @ 7154:5d0bb7d52783
changes to support Graal co-existing with the other HotSpot compiler(s) and being used for explicit compilation requests and code installation via the Graal API
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 12 Dec 2012 21:36:40 +0100 |
parents | e522a00b91aa |
children | 291ffc492eb6 |
comparison
equal
deleted
inserted
replaced
7153:c421c19b7bf8 | 7154:5d0bb7d52783 |
---|---|
1147 // See below for example code. | 1147 // See below for example code. |
1148 void InterpreterMacroAssembler::record_klass_in_profile_helper( | 1148 void InterpreterMacroAssembler::record_klass_in_profile_helper( |
1149 Register receiver, Register mdp, | 1149 Register receiver, Register mdp, |
1150 Register reg2, int start_row, | 1150 Register reg2, int start_row, |
1151 Label& done, bool is_virtual_call) { | 1151 Label& done, bool is_virtual_call) { |
1152 #ifdef GRAAL | |
1153 // change for GRAAL (use counter to indicate polymorphic case instead of failed typechecks) | |
1154 bool use_counter_for_polymorphic_case = true; | |
1155 #else | |
1156 bool use_counter_for_polymorphic_case = is_virtual_call; | |
1157 #endif | |
1158 | |
1159 if (TypeProfileWidth == 0) { | 1152 if (TypeProfileWidth == 0) { |
1160 if (use_counter_for_polymorphic_case) { | 1153 if (is_virtual_call) { |
1161 increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); | 1154 increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); |
1162 } | 1155 } |
1156 #ifdef GRAAL | |
1157 else { | |
1158 increment_mdp_data_at(mdp, in_bytes(ReceiverTypeData::nonprofiled_receiver_count_offset())); | |
1159 } | |
1160 #endif | |
1163 return; | 1161 return; |
1164 } | 1162 } |
1165 | 1163 |
1166 int last_row = VirtualCallData::row_limit() - 1; | 1164 int last_row = VirtualCallData::row_limit() - 1; |
1167 assert(start_row <= last_row, "must be work left to do"); | 1165 assert(start_row <= last_row, "must be work left to do"); |
1192 Label found_null; | 1190 Label found_null; |
1193 // Failed the equality check on receiver[n]... Test for null. | 1191 // Failed the equality check on receiver[n]... Test for null. |
1194 testptr(reg2, reg2); | 1192 testptr(reg2, reg2); |
1195 if (start_row == last_row) { | 1193 if (start_row == last_row) { |
1196 // The only thing left to do is handle the null case. | 1194 // The only thing left to do is handle the null case. |
1197 if (use_counter_for_polymorphic_case) { | 1195 if (is_virtual_call GRAAL_ONLY(|| true)) { |
1198 jccb(Assembler::zero, found_null); | 1196 jccb(Assembler::zero, found_null); |
1199 // Receiver did not match any saved receiver and there is no empty row for it. | 1197 // Receiver did not match any saved receiver and there is no empty row for it. |
1200 // Increment total counter to indicate polymorphic case. | 1198 // Increment total counter to indicate polymorphic case. |
1201 increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); | 1199 int offset = in_bytes(CounterData::count_offset()); |
1200 #ifdef GRAAL | |
1201 if (!is_virtual_call) { | |
1202 offset = in_bytes(ReceiverTypeData::nonprofiled_receiver_count_offset()); | |
1203 } | |
1204 #endif | |
1205 increment_mdp_data_at(mdp, offset); | |
1202 jmp(done); | 1206 jmp(done); |
1203 bind(found_null); | 1207 bind(found_null); |
1204 } else { | 1208 } else { |
1205 jcc(Assembler::notZero, done); | 1209 jcc(Assembler::notZero, done); |
1206 } | 1210 } |
1325 } | 1329 } |
1326 } | 1330 } |
1327 | 1331 |
1328 | 1332 |
1329 void InterpreterMacroAssembler::profile_typecheck_failed(Register mdp) { | 1333 void InterpreterMacroAssembler::profile_typecheck_failed(Register mdp) { |
1330 // changed for GRAAL (use counter to indicate polymorphism instead of failed typechecks) | |
1331 #ifndef GRAAL | |
1332 if (ProfileInterpreter && TypeProfileCasts) { | 1334 if (ProfileInterpreter && TypeProfileCasts) { |
1333 Label profile_continue; | 1335 Label profile_continue; |
1334 | 1336 |
1335 // If no method data exists, go to profile_continue. | 1337 // If no method data exists, go to profile_continue. |
1336 test_method_data_pointer(mdp, profile_continue); | 1338 test_method_data_pointer(mdp, profile_continue); |
1342 // *Decrement* the counter. We expect to see zero or small negatives. | 1344 // *Decrement* the counter. We expect to see zero or small negatives. |
1343 increment_mdp_data_at(mdp, count_offset, true); | 1345 increment_mdp_data_at(mdp, count_offset, true); |
1344 | 1346 |
1345 bind (profile_continue); | 1347 bind (profile_continue); |
1346 } | 1348 } |
1347 #endif | |
1348 } | 1349 } |
1349 | 1350 |
1350 | 1351 |
1351 void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass, Register reg2) { | 1352 void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass, Register reg2) { |
1352 if (ProfileInterpreter) { | 1353 if (ProfileInterpreter) { |