@@ -1043,7 +1043,7 @@ GrowableArray<ScopeValue*>* CodeInstaller::record_virtual_objects(JVMCIObject de
1043
1043
return objects;
1044
1044
}
1045
1045
1046
- void CodeInstaller::record_scope (jint pc_offset, JVMCIObject debug_info, ScopeMode scope_mode, bool return_oop, JVMCI_TRAPS) {
1046
+ void CodeInstaller::record_scope (jint pc_offset, JVMCIObject debug_info, ScopeMode scope_mode, bool is_mh_invoke, bool return_oop, JVMCI_TRAPS) {
1047
1047
JVMCIObject position = jvmci_env ()->get_DebugInfo_bytecodePosition (debug_info);
1048
1048
if (position.is_null ()) {
1049
1049
// Stubs do not record scope info, just oop maps
@@ -1056,7 +1056,7 @@ void CodeInstaller::record_scope(jint pc_offset, JVMCIObject debug_info, ScopeMo
1056
1056
} else {
1057
1057
objectMapping = NULL ;
1058
1058
}
1059
- record_scope (pc_offset, position, scope_mode, objectMapping, return_oop, JVMCI_CHECK);
1059
+ record_scope (pc_offset, position, scope_mode, objectMapping, is_mh_invoke, return_oop, JVMCI_CHECK);
1060
1060
}
1061
1061
1062
1062
int CodeInstaller::map_jvmci_bci (int bci) {
@@ -1079,7 +1079,7 @@ int CodeInstaller::map_jvmci_bci(int bci) {
1079
1079
return bci;
1080
1080
}
1081
1081
1082
- void CodeInstaller::record_scope (jint pc_offset, JVMCIObject position, ScopeMode scope_mode, GrowableArray<ScopeValue*>* objects, bool return_oop, JVMCI_TRAPS) {
1082
+ void CodeInstaller::record_scope (jint pc_offset, JVMCIObject position, ScopeMode scope_mode, GrowableArray<ScopeValue*>* objects, bool is_mh_invoke, bool return_oop, JVMCI_TRAPS) {
1083
1083
JVMCIObject frame;
1084
1084
if (scope_mode == CodeInstaller::FullFrame) {
1085
1085
if (!jvmci_env ()->isa_BytecodeFrame (position)) {
@@ -1089,7 +1089,7 @@ void CodeInstaller::record_scope(jint pc_offset, JVMCIObject position, ScopeMode
1089
1089
}
1090
1090
JVMCIObject caller_frame = jvmci_env ()->get_BytecodePosition_caller (position);
1091
1091
if (caller_frame.is_non_null ()) {
1092
- record_scope (pc_offset, caller_frame, scope_mode, objects, return_oop, JVMCI_CHECK);
1092
+ record_scope (pc_offset, caller_frame, scope_mode, objects, is_mh_invoke, return_oop, JVMCI_CHECK);
1093
1093
}
1094
1094
1095
1095
JVMCIObject hotspot_method = jvmci_env ()->get_BytecodePosition_method (position);
@@ -1181,7 +1181,7 @@ void CodeInstaller::record_scope(jint pc_offset, JVMCIObject position, ScopeMode
1181
1181
throw_exception = jvmci_env ()->get_BytecodeFrame_rethrowException (frame) == JNI_TRUE;
1182
1182
}
1183
1183
1184
- _debug_recorder->describe_scope (pc_offset, method, NULL , bci, reexecute, throw_exception, false , return_oop,
1184
+ _debug_recorder->describe_scope (pc_offset, method, NULL , bci, reexecute, throw_exception, is_mh_invoke , return_oop,
1185
1185
locals_token, expressions_token, monitors_token);
1186
1186
}
1187
1187
@@ -1236,9 +1236,19 @@ void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, JVMCIObject si
1236
1236
OopMap *map = create_oop_map (debug_info, JVMCI_CHECK);
1237
1237
_debug_recorder->add_safepoint (next_pc_offset, map);
1238
1238
1239
- bool return_oop = hotspot_method.is_non_null () && jvmci_env ()->asMethod (hotspot_method)->is_returning_oop ();
1240
-
1241
- record_scope (next_pc_offset, debug_info, CodeInstaller::FullFrame, return_oop, JVMCI_CHECK);
1239
+ if (hotspot_method.is_non_null ()) {
1240
+ Method *method = jvmci_env ()->asMethod (hotspot_method);
1241
+ vmIntrinsics::ID iid = method->intrinsic_id ();
1242
+ bool is_mh_invoke = false ;
1243
+ if (jvmci_env ()->get_site_Call_direct (site)) {
1244
+ is_mh_invoke = !method->is_static () && (iid == vmIntrinsics::_compiledLambdaForm ||
1245
+ (MethodHandles::is_signature_polymorphic (iid) && MethodHandles::is_signature_polymorphic_intrinsic (iid)));
1246
+ }
1247
+ bool return_oop = method->is_returning_oop ();
1248
+ record_scope (next_pc_offset, debug_info, CodeInstaller::FullFrame, is_mh_invoke, return_oop, JVMCI_CHECK);
1249
+ } else {
1250
+ record_scope (next_pc_offset, debug_info, CodeInstaller::FullFrame, JVMCI_CHECK);
1251
+ }
1242
1252
}
1243
1253
1244
1254
if (foreign_call.is_non_null ()) {
@@ -1347,6 +1357,9 @@ void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, JVMCIObject si
1347
1357
case DEOPT_HANDLER_ENTRY:
1348
1358
_offsets.set_value (CodeOffsets::Deopt, pc_offset);
1349
1359
break ;
1360
+ case DEOPT_MH_HANDLER_ENTRY:
1361
+ _offsets.set_value (CodeOffsets::DeoptMH, pc_offset);
1362
+ break ;
1350
1363
case FRAME_COMPLETE:
1351
1364
_offsets.set_value (CodeOffsets::Frame_Complete, pc_offset);
1352
1365
break ;
0 commit comments