src/cpu/x86/vm/interp_masm_x86_64.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_64.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:


1204       Label do_profile;
1205       cmpb(Address(r13, 0), Bytecodes::_invokedynamic);
1206       jcc(Assembler::equal, do_profile);
1207       cmpb(Address(r13, 0), Bytecodes::_invokehandle);
1208       jcc(Assembler::equal, do_profile);
1209       get_method(tmp);
1210       cmpb(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
1211       jcc(Assembler::notEqual, profile_continue);
1212 
1213       bind(do_profile);
1214     }
1215 
1216     Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size()));
1217     mov(tmp, ret);
1218     profile_obj_type(tmp, mdo_ret_addr);
1219 
1220     bind(profile_continue);
1221   }
1222 }
1223 





































1224 void InterpreterMacroAssembler::profile_call(Register mdp) {
1225   if (ProfileInterpreter) {
1226     Label profile_continue;
1227 
1228     // If no method data exists, go to profile_continue.
1229     test_method_data_pointer(mdp, profile_continue);
1230 
1231     // We are making a call.  Increment the count.
1232     increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
1233 
1234     // The method data pointer needs to be updated to reflect the new target.
1235     update_mdp_by_constant(mdp, in_bytes(CounterData::counter_data_size()));
1236     bind(profile_continue);
1237   }
1238 }
1239 
1240 
1241 void InterpreterMacroAssembler::profile_final_call(Register mdp) {
1242   if (ProfileInterpreter) {
1243     Label profile_continue;




1204       Label do_profile;
1205       cmpb(Address(r13, 0), Bytecodes::_invokedynamic);
1206       jcc(Assembler::equal, do_profile);
1207       cmpb(Address(r13, 0), Bytecodes::_invokehandle);
1208       jcc(Assembler::equal, do_profile);
1209       get_method(tmp);
1210       cmpb(Address(tmp, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_compiledLambdaForm);
1211       jcc(Assembler::notEqual, profile_continue);
1212 
1213       bind(do_profile);
1214     }
1215 
1216     Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size()));
1217     mov(tmp, ret);
1218     profile_obj_type(tmp, mdo_ret_addr);
1219 
1220     bind(profile_continue);
1221   }
1222 }
1223 
1224 void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register tmp1, Register tmp2) {
1225   if (ProfileInterpreter && MethodData::profile_parameters()) {
1226     Label profile_continue, done;
1227 
1228     test_method_data_pointer(mdp, profile_continue);
1229 
1230     movl(tmp1, Address(mdp, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset())));
1231     testl(tmp1, tmp1);
1232     jcc(Assembler::negative, profile_continue);
1233 
1234     // start with last parameter
1235     addptr(mdp, tmp1);
1236     movq(tmp1, Address(mdp, in_bytes(ArrayData::array_len_offset())));
1237     decrement(tmp1, TypeStackSlotEntries::per_arg_count());
1238 
1239     Label loop;
1240     bind(loop);
1241 
1242     int off_base = in_bytes(ParametersTypeData::stack_slot_offset(0));
1243     int type_base = in_bytes(ParametersTypeData::type_offset(0));
1244     Address::ScaleFactor per_arg_scale = Address::times(DataLayout::cell_size);
1245     Address arg_off(mdp, tmp1, per_arg_scale, off_base);
1246     Address arg_type(mdp, tmp1, per_arg_scale, type_base);
1247 
1248     movq(tmp2, arg_off);
1249     negq(tmp2);
1250     movptr(tmp2, Address(r14, tmp2, Interpreter::stackElementScale()));
1251 
1252     profile_obj_type(tmp2, arg_type);
1253 
1254     decrement(tmp1, TypeStackSlotEntries::per_arg_count());
1255     jcc(Assembler::positive, loop);
1256 
1257     bind(profile_continue);
1258   }
1259 }
1260 
1261 void InterpreterMacroAssembler::profile_call(Register mdp) {
1262   if (ProfileInterpreter) {
1263     Label profile_continue;
1264 
1265     // If no method data exists, go to profile_continue.
1266     test_method_data_pointer(mdp, profile_continue);
1267 
1268     // We are making a call.  Increment the count.
1269     increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
1270 
1271     // The method data pointer needs to be updated to reflect the new target.
1272     update_mdp_by_constant(mdp, in_bytes(CounterData::counter_data_size()));
1273     bind(profile_continue);
1274   }
1275 }
1276 
1277 
1278 void InterpreterMacroAssembler::profile_final_call(Register mdp) {
1279   if (ProfileInterpreter) {
1280     Label profile_continue;


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