comparison src/cpu/x86/vm/interp_masm_x86_64.cpp @ 4526:0e1f15ec0e94

fixed profiling of typechecks
author Christian Haeubl <christian.haeubl@oracle.com>
date Tue, 07 Feb 2012 11:43:05 -0800
parents f08d439fab8c
children 723df37192d6
comparison
equal deleted inserted replaced
4476:00efac2934d3 4526:0e1f15ec0e94
1124 // See below for example code. 1124 // See below for example code.
1125 void InterpreterMacroAssembler::record_klass_in_profile_helper( 1125 void InterpreterMacroAssembler::record_klass_in_profile_helper(
1126 Register receiver, Register mdp, 1126 Register receiver, Register mdp,
1127 Register reg2, int start_row, 1127 Register reg2, int start_row,
1128 Label& done, bool is_virtual_call) { 1128 Label& done, bool is_virtual_call) {
1129 // change for GRAAL (use counter to indicate polymorphic case instead of failed typechecks)
1130 bool use_counter_for_polymorphic_case = is_virtual_call || UseGraal;
1131
1129 if (TypeProfileWidth == 0) { 1132 if (TypeProfileWidth == 0) {
1130 if (is_virtual_call) { 1133 if (use_counter_for_polymorphic_case) {
1131 increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); 1134 increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
1132 } 1135 }
1133 return; 1136 return;
1134 } 1137 }
1135 1138
1162 Label found_null; 1165 Label found_null;
1163 // Failed the equality check on receiver[n]... Test for null. 1166 // Failed the equality check on receiver[n]... Test for null.
1164 testptr(reg2, reg2); 1167 testptr(reg2, reg2);
1165 if (start_row == last_row) { 1168 if (start_row == last_row) {
1166 // The only thing left to do is handle the null case. 1169 // The only thing left to do is handle the null case.
1167 if (is_virtual_call) { 1170 if (use_counter_for_polymorphic_case) {
1168 jccb(Assembler::zero, found_null); 1171 jccb(Assembler::zero, found_null);
1169 // Receiver did not match any saved receiver and there is no empty row for it. 1172 // Receiver did not match any saved receiver and there is no empty row for it.
1170 // Increment total counter to indicate polymorphic case. 1173 // Increment total counter to indicate polymorphic case.
1171 increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); 1174 increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
1172 jmp(done); 1175 jmp(done);
1295 } 1298 }
1296 } 1299 }
1297 1300
1298 1301
1299 void InterpreterMacroAssembler::profile_typecheck_failed(Register mdp) { 1302 void InterpreterMacroAssembler::profile_typecheck_failed(Register mdp) {
1300 if (ProfileInterpreter && TypeProfileCasts) { 1303 // changed for GRAAL (use counter to indicate polymorphism instead of failed typechecks)
1304 if (ProfileInterpreter && TypeProfileCasts && !UseGraal) {
1301 Label profile_continue; 1305 Label profile_continue;
1302 1306
1303 // If no method data exists, go to profile_continue. 1307 // If no method data exists, go to profile_continue.
1304 test_method_data_pointer(mdp, profile_continue); 1308 test_method_data_pointer(mdp, profile_continue);
1305 1309