src/cpu/x86/vm/interp_masm_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/cpu/x86/vm

src/cpu/x86/vm/interp_masm_x86_32.cpp

Print this page
rev 5411 : 8026251: New type profiling points: parameters to methods
Summary: x86 interpreter and c1 type profiling for parameters on method entries
Reviewed-by:


1182       Label do_profile;
1183       cmpb(Address(rsi, 0), Bytecodes::_invokedynamic);
1184       jcc(Assembler::equal, do_profile);
1185       cmpb(Address(rsi, 0), Bytecodes::_invokehandle);
1186       jcc(Assembler::equal, do_profile);
1187       get_method(tmp);
1188       cmpb(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
1189       jcc(Assembler::notEqual, profile_continue);
1190 
1191       bind(do_profile);
1192     }
1193 
1194     Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size()));
1195     mov(tmp, ret);
1196     profile_obj_type(tmp, mdo_ret_addr);
1197 
1198     bind(profile_continue);
1199   }
1200 }
1201 





































1202 void InterpreterMacroAssembler::profile_call(Register mdp) {
1203   if (ProfileInterpreter) {
1204     Label profile_continue;
1205 
1206     // If no method data exists, go to profile_continue.
1207     test_method_data_pointer(mdp, profile_continue);
1208 
1209     // We are making a call.  Increment the count.
1210     increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
1211 
1212     // The method data pointer needs to be updated to reflect the new target.
1213     update_mdp_by_constant(mdp, in_bytes(CounterData::counter_data_size()));
1214     bind (profile_continue);
1215   }
1216 }
1217 
1218 
1219 void InterpreterMacroAssembler::profile_final_call(Register mdp) {
1220   if (ProfileInterpreter) {
1221     Label profile_continue;




1182       Label do_profile;
1183       cmpb(Address(rsi, 0), Bytecodes::_invokedynamic);
1184       jcc(Assembler::equal, do_profile);
1185       cmpb(Address(rsi, 0), Bytecodes::_invokehandle);
1186       jcc(Assembler::equal, do_profile);
1187       get_method(tmp);
1188       cmpb(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
1189       jcc(Assembler::notEqual, profile_continue);
1190 
1191       bind(do_profile);
1192     }
1193 
1194     Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size()));
1195     mov(tmp, ret);
1196     profile_obj_type(tmp, mdo_ret_addr);
1197 
1198     bind(profile_continue);
1199   }
1200 }
1201 
1202 void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register tmp1, Register tmp2) {
1203   if (ProfileInterpreter && MethodData::profile_parameters()) {
1204     Label profile_continue, done;
1205 
1206     test_method_data_pointer(mdp, profile_continue);
1207 
1208     movl(tmp1, Address(mdp, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset())));
1209     testl(tmp1, tmp1);
1210     jcc(Assembler::negative, profile_continue);
1211 
1212     // start with last parameter
1213     addptr(mdp, tmp1);
1214     movl(tmp1, Address(mdp, in_bytes(ArrayData::array_len_offset())));
1215     decrement(tmp1, TypeStackSlotEntries::per_arg_count());
1216 
1217     Label loop;
1218     bind(loop);
1219 
1220     int off_base = in_bytes(ParametersTypeData::stack_slot_offset(0));
1221     int type_base = in_bytes(ParametersTypeData::type_offset(0));
1222     Address::ScaleFactor per_arg_scale = Address::times(DataLayout::cell_size);
1223     Address arg_off(mdp, tmp1, per_arg_scale, off_base);
1224     Address arg_type(mdp, tmp1, per_arg_scale, type_base);
1225 
1226     movl(tmp2, arg_off);
1227     negl(tmp2);
1228     movptr(tmp2, Address(rdi, tmp2, Interpreter::stackElementScale()));
1229 
1230     profile_obj_type(tmp2, arg_type);
1231 
1232     decrement(tmp1, TypeStackSlotEntries::per_arg_count());
1233     jcc(Assembler::positive, loop);
1234 
1235     bind(profile_continue);
1236   }
1237 }
1238 
1239 void InterpreterMacroAssembler::profile_call(Register mdp) {
1240   if (ProfileInterpreter) {
1241     Label profile_continue;
1242 
1243     // If no method data exists, go to profile_continue.
1244     test_method_data_pointer(mdp, profile_continue);
1245 
1246     // We are making a call.  Increment the count.
1247     increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
1248 
1249     // The method data pointer needs to be updated to reflect the new target.
1250     update_mdp_by_constant(mdp, in_bytes(CounterData::counter_data_size()));
1251     bind (profile_continue);
1252   }
1253 }
1254 
1255 
1256 void InterpreterMacroAssembler::profile_final_call(Register mdp) {
1257   if (ProfileInterpreter) {
1258     Label profile_continue;


src/cpu/x86/vm/interp_masm_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File