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 5462 : 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     // Load the offset of the area within the MDO used for
1231     // parameters. If it's negative we're not profiling any parameters
1232     movl(tmp1, Address(mdp, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset())));
1233     testl(tmp1, tmp1);
1234     jcc(Assembler::negative, profile_continue);
1235 
1236     // Compute a pointer to the area for parameters from the offset
1237     // and move the pointer to the slot for the last
1238     // parameters. Collect profiling from last parameter down.
1239     // mdo start + parameters offset + array length - 1
1240     addptr(mdp, tmp1);
1241     movq(tmp1, Address(mdp, in_bytes(ArrayData::array_len_offset())));
1242     decrement(tmp1, TypeStackSlotEntries::per_arg_count());
1243 
1244     Label loop;
1245     bind(loop);
1246 
1247     int off_base = in_bytes(ParametersTypeData::stack_slot_offset(0));
1248     int type_base = in_bytes(ParametersTypeData::type_offset(0));
1249     Address::ScaleFactor per_arg_scale = Address::times(DataLayout::cell_size);
1250     Address arg_off(mdp, tmp1, per_arg_scale, off_base);
1251     Address arg_type(mdp, tmp1, per_arg_scale, type_base);
1252 
1253     // load offset on the stack from the slot for this parameter
1254     movq(tmp2, arg_off);
1255     negq(tmp2);
1256     // read the parameter from the local area
1257     movptr(tmp2, Address(r14, tmp2, Interpreter::stackElementScale()));
1258 
1259     // profile the parameter
1260     profile_obj_type(tmp2, arg_type);
1261 
1262     // go to next parameter
1263     decrement(tmp1, TypeStackSlotEntries::per_arg_count());
1264     jcc(Assembler::positive, loop);
1265 
1266     bind(profile_continue);
1267   }
1268 }
1269 
1270 void InterpreterMacroAssembler::profile_call(Register mdp) {
1271   if (ProfileInterpreter) {
1272     Label profile_continue;
1273 
1274     // If no method data exists, go to profile_continue.
1275     test_method_data_pointer(mdp, profile_continue);
1276 
1277     // We are making a call.  Increment the count.
1278     increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
1279 
1280     // The method data pointer needs to be updated to reflect the new target.
1281     update_mdp_by_constant(mdp, in_bytes(CounterData::counter_data_size()));
1282     bind(profile_continue);
1283   }
1284 }
1285 
1286 
1287 void InterpreterMacroAssembler::profile_final_call(Register mdp) {
1288   if (ProfileInterpreter) {
1289     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