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 // Load the offset of the area within the MDO used for
1209 // parameters. If it's negative we're not profiling any parameters
1210 movl(tmp1, Address(mdp, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset())));
1211 testl(tmp1, tmp1);
1212 jcc(Assembler::negative, profile_continue);
1213
1214 // Compute a pointer to the area for parameters from the offset
1215 // and move the pointer to the slot for the last
1216 // parameters. Collect profiling from last parameter down.
1217 // mdo start + parameters offset + array length - 1
1218 addptr(mdp, tmp1);
1219 movl(tmp1, Address(mdp, in_bytes(ArrayData::array_len_offset())));
1220 decrement(tmp1, TypeStackSlotEntries::per_arg_count());
1221
1222 Label loop;
1223 bind(loop);
1224
1225 int off_base = in_bytes(ParametersTypeData::stack_slot_offset(0));
1226 int type_base = in_bytes(ParametersTypeData::type_offset(0));
1227 Address::ScaleFactor per_arg_scale = Address::times(DataLayout::cell_size);
1228 Address arg_off(mdp, tmp1, per_arg_scale, off_base);
1229 Address arg_type(mdp, tmp1, per_arg_scale, type_base);
1230
1231 // load offset on the stack from the slot for this parameter
1232 movl(tmp2, arg_off);
1233 negl(tmp2);
1234 // read the parameter from the local area
1235 movptr(tmp2, Address(rdi, tmp2, Interpreter::stackElementScale()));
1236
1237 // profile the parameter
1238 profile_obj_type(tmp2, arg_type);
1239
1240 // go to next parameter
1241 decrement(tmp1, TypeStackSlotEntries::per_arg_count());
1242 jcc(Assembler::positive, loop);
1243
1244 bind(profile_continue);
1245 }
1246 }
1247
1248 void InterpreterMacroAssembler::profile_call(Register mdp) {
1249 if (ProfileInterpreter) {
1250 Label profile_continue;
1251
1252 // If no method data exists, go to profile_continue.
1253 test_method_data_pointer(mdp, profile_continue);
1254
1255 // We are making a call. Increment the count.
1256 increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
1257
1258 // The method data pointer needs to be updated to reflect the new target.
1259 update_mdp_by_constant(mdp, in_bytes(CounterData::counter_data_size()));
1260 bind (profile_continue);
1261 }
1262 }
1263
1264
1265 void InterpreterMacroAssembler::profile_final_call(Register mdp) {
1266 if (ProfileInterpreter) {
1267 Label profile_continue;
|