< prev index next >

src/hotspot/share/jvmci/jvmciCodeInstaller.cpp

Print this page

1143       DebugToken* monitors_token = nullptr;
1144 
1145       if (full_info) {
1146         u1 frame_flags = stream->read_u1("flags");
1147         rethrow_exception = is_set(frame_flags, DIF_RETHROW_EXCEPTION);
1148 
1149         if (bci >= 0) {
1150           reexecute = !is_set(frame_flags, DIF_DURING_CALL);
1151         }
1152 
1153         GrowableArray<ScopeValue*>* locals = read_local_or_stack_values(stream, frame_flags, true, JVMCI_CHECK);
1154         GrowableArray<ScopeValue*>* stack = read_local_or_stack_values(stream, frame_flags, false, JVMCI_CHECK);
1155         GrowableArray<MonitorValue*>* monitors = read_monitor_values(stream, frame_flags, JVMCI_CHECK);
1156 
1157         locals_token = _debug_recorder->create_scope_values(locals);
1158         stack_token = _debug_recorder->create_scope_values(stack);
1159         monitors_token = _debug_recorder->create_monitor_values(monitors);
1160       }
1161 
1162       // has_ea_local_in_scope and arg_escape should be added to JVMCI

1163       const bool has_ea_local_in_scope = false;
1164       const bool arg_escape            = false;
1165       _debug_recorder->describe_scope(pc_offset, method, nullptr, bci, reexecute, rethrow_exception, is_mh_invoke, return_oop,
1166                                       has_ea_local_in_scope, arg_escape,
1167                                       locals_token, stack_token, monitors_token);
1168     }
1169   }
1170   if (full_info) {
1171     // Clear the virtual objects as they are specific to one DebugInfo
1172     stream->set_virtual_objects(nullptr);
1173   }
1174 }
1175 
1176 void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, HotSpotCompiledCodeStream* stream, u1 tag, JVMCI_TRAPS) {
1177   u1 flags = stream->read_u1("debugInfo:flags");
1178   OopMap *map = create_oop_map(stream, flags, JVMCI_CHECK);
1179   _debug_recorder->add_safepoint(pc_offset, map);
1180   record_scope(pc_offset, stream, flags, true, JVMCI_CHECK);
1181   _debug_recorder->end_safepoint(pc_offset);
1182   if (_orig_pc_offset < 0) {
1183     JVMCI_ERROR("method contains safepoint, but has no deopt rescue slot");
1184   }
1185   if (tag == SITE_IMPLICIT_EXCEPTION_DISPATCH) {
1186     jint dispatch_offset = stream->read_s4("dispatchOffset");

1286         JVMCI_ERROR("data offset 0x%x points outside data section (size 0x%x)%s", data_offset, _constants_size, stream->context());
1287       }
1288       break;
1289     }
1290     default: {
1291       JVMCI_ERROR("unknown data patch tag: %d%s", tag, stream->context());
1292     }
1293   }
1294 }
1295 
1296 void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, HotSpotCompiledCodeStream* stream, JVMCI_TRAPS) {
1297   u1 id = stream->read_u1("mark:id");
1298   address pc = _instructions->start() + pc_offset;
1299 
1300   switch (id) {
1301     case UNVERIFIED_ENTRY:
1302       _offsets.set_value(CodeOffsets::Entry, pc_offset);
1303       break;
1304     case VERIFIED_ENTRY:
1305       _offsets.set_value(CodeOffsets::Verified_Entry, pc_offset);


1306       break;
1307     case OSR_ENTRY:
1308       _offsets.set_value(CodeOffsets::OSR_Entry, pc_offset);
1309       break;
1310     case EXCEPTION_HANDLER_ENTRY:
1311       _offsets.set_value(CodeOffsets::Exceptions, pc_offset);
1312       break;
1313     case DEOPT_HANDLER_ENTRY:
1314       _offsets.set_value(CodeOffsets::Deopt, pc_offset);
1315       break;
1316     case DEOPT_MH_HANDLER_ENTRY:
1317       _offsets.set_value(CodeOffsets::DeoptMH, pc_offset);
1318       break;
1319     case FRAME_COMPLETE:
1320       _offsets.set_value(CodeOffsets::Frame_Complete, pc_offset);
1321       break;
1322     case ENTRY_BARRIER_PATCH:
1323       _nmethod_entry_patch_offset = pc_offset;
1324       break;
1325     case INVOKEVIRTUAL:

1143       DebugToken* monitors_token = nullptr;
1144 
1145       if (full_info) {
1146         u1 frame_flags = stream->read_u1("flags");
1147         rethrow_exception = is_set(frame_flags, DIF_RETHROW_EXCEPTION);
1148 
1149         if (bci >= 0) {
1150           reexecute = !is_set(frame_flags, DIF_DURING_CALL);
1151         }
1152 
1153         GrowableArray<ScopeValue*>* locals = read_local_or_stack_values(stream, frame_flags, true, JVMCI_CHECK);
1154         GrowableArray<ScopeValue*>* stack = read_local_or_stack_values(stream, frame_flags, false, JVMCI_CHECK);
1155         GrowableArray<MonitorValue*>* monitors = read_monitor_values(stream, frame_flags, JVMCI_CHECK);
1156 
1157         locals_token = _debug_recorder->create_scope_values(locals);
1158         stack_token = _debug_recorder->create_scope_values(stack);
1159         monitors_token = _debug_recorder->create_monitor_values(monitors);
1160       }
1161 
1162       // has_ea_local_in_scope and arg_escape should be added to JVMCI
1163       const bool return_scalarized     = false;
1164       const bool has_ea_local_in_scope = false;
1165       const bool arg_escape            = false;
1166       _debug_recorder->describe_scope(pc_offset, method, nullptr, bci, reexecute, rethrow_exception, is_mh_invoke, return_oop,
1167                                       return_scalarized, has_ea_local_in_scope, arg_escape,
1168                                       locals_token, stack_token, monitors_token);
1169     }
1170   }
1171   if (full_info) {
1172     // Clear the virtual objects as they are specific to one DebugInfo
1173     stream->set_virtual_objects(nullptr);
1174   }
1175 }
1176 
1177 void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, HotSpotCompiledCodeStream* stream, u1 tag, JVMCI_TRAPS) {
1178   u1 flags = stream->read_u1("debugInfo:flags");
1179   OopMap *map = create_oop_map(stream, flags, JVMCI_CHECK);
1180   _debug_recorder->add_safepoint(pc_offset, map);
1181   record_scope(pc_offset, stream, flags, true, JVMCI_CHECK);
1182   _debug_recorder->end_safepoint(pc_offset);
1183   if (_orig_pc_offset < 0) {
1184     JVMCI_ERROR("method contains safepoint, but has no deopt rescue slot");
1185   }
1186   if (tag == SITE_IMPLICIT_EXCEPTION_DISPATCH) {
1187     jint dispatch_offset = stream->read_s4("dispatchOffset");

1287         JVMCI_ERROR("data offset 0x%x points outside data section (size 0x%x)%s", data_offset, _constants_size, stream->context());
1288       }
1289       break;
1290     }
1291     default: {
1292       JVMCI_ERROR("unknown data patch tag: %d%s", tag, stream->context());
1293     }
1294   }
1295 }
1296 
1297 void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, HotSpotCompiledCodeStream* stream, JVMCI_TRAPS) {
1298   u1 id = stream->read_u1("mark:id");
1299   address pc = _instructions->start() + pc_offset;
1300 
1301   switch (id) {
1302     case UNVERIFIED_ENTRY:
1303       _offsets.set_value(CodeOffsets::Entry, pc_offset);
1304       break;
1305     case VERIFIED_ENTRY:
1306       _offsets.set_value(CodeOffsets::Verified_Entry, pc_offset);
1307       _offsets.set_value(CodeOffsets::Verified_Inline_Entry, pc_offset);
1308       _offsets.set_value(CodeOffsets::Verified_Inline_Entry_RO, pc_offset);
1309       break;
1310     case OSR_ENTRY:
1311       _offsets.set_value(CodeOffsets::OSR_Entry, pc_offset);
1312       break;
1313     case EXCEPTION_HANDLER_ENTRY:
1314       _offsets.set_value(CodeOffsets::Exceptions, pc_offset);
1315       break;
1316     case DEOPT_HANDLER_ENTRY:
1317       _offsets.set_value(CodeOffsets::Deopt, pc_offset);
1318       break;
1319     case DEOPT_MH_HANDLER_ENTRY:
1320       _offsets.set_value(CodeOffsets::DeoptMH, pc_offset);
1321       break;
1322     case FRAME_COMPLETE:
1323       _offsets.set_value(CodeOffsets::Frame_Complete, pc_offset);
1324       break;
1325     case ENTRY_BARRIER_PATCH:
1326       _nmethod_entry_patch_offset = pc_offset;
1327       break;
1328     case INVOKEVIRTUAL:
< prev index next >