src/share/vm/jvmci/jvmciCodeInstaller.cpp
Print this page
*** 725,738 ****
// three reasons for infopoints denote actual safepoints
oop reason = CompilationResult_Infopoint::reason(site);
if (InfopointReason::SAFEPOINT() == reason || InfopointReason::CALL() == reason || InfopointReason::IMPLICIT_EXCEPTION() == reason) {
TRACE_jvmci_4("safepoint at %i", pc_offset);
site_Safepoint(buffer, pc_offset, site, CHECK_OK);
- } else if (InfopointReason::METHOD_START() == reason || InfopointReason::METHOD_END() == reason || InfopointReason::LINE_NUMBER() == reason) {
- site_Infopoint(buffer, pc_offset, site, CHECK_OK);
} else {
! JVMCI_ERROR_OK("unknown infopoint reason at %i", pc_offset);
}
} else if (site->is_a(CompilationResult_DataPatch::klass())) {
TRACE_jvmci_4("datapatch at %i", pc_offset);
site_DataPatch(buffer, pc_offset, site, CHECK_OK);
} else if (site->is_a(CompilationResult_Mark::klass())) {
--- 725,737 ----
// three reasons for infopoints denote actual safepoints
oop reason = CompilationResult_Infopoint::reason(site);
if (InfopointReason::SAFEPOINT() == reason || InfopointReason::CALL() == reason || InfopointReason::IMPLICIT_EXCEPTION() == reason) {
TRACE_jvmci_4("safepoint at %i", pc_offset);
site_Safepoint(buffer, pc_offset, site, CHECK_OK);
} else {
! TRACE_jvmci_4("infopoint at %i", pc_offset);
! site_Infopoint(buffer, pc_offset, site, CHECK_OK);
}
} else if (site->is_a(CompilationResult_DataPatch::klass())) {
TRACE_jvmci_4("datapatch at %i", pc_offset);
site_DataPatch(buffer, pc_offset, site, CHECK_OK);
} else if (site->is_a(CompilationResult_Mark::klass())) {
*** 866,894 ****
}
_debug_recorder->dump_object_pool(objects);
return objects;
}
! void CodeInstaller::record_scope(jint pc_offset, Handle debug_info, TRAPS) {
Handle position = DebugInfo::bytecodePosition(debug_info);
if (position.is_null()) {
// Stubs do not record scope info, just oop maps
return;
}
! GrowableArray<ScopeValue*>* objectMapping = record_virtual_objects(debug_info, CHECK);
! record_scope(pc_offset, position, objectMapping, CHECK);
}
! void CodeInstaller::record_scope(jint pc_offset, Handle position, GrowableArray<ScopeValue*>* objects, TRAPS) {
Handle frame;
! if (position->is_a(BytecodeFrame::klass())) {
frame = position;
}
Handle caller_frame = BytecodePosition::caller(position);
if (caller_frame.not_null()) {
! record_scope(pc_offset, caller_frame, objects, CHECK);
}
Handle hotspot_method = BytecodePosition::method(position);
Method* method = getMethodFromHotSpotMethod(hotspot_method());
jint bci = BytecodePosition::bci(position);
--- 865,901 ----
}
_debug_recorder->dump_object_pool(objects);
return objects;
}
! void CodeInstaller::record_scope(jint pc_offset, Handle debug_info, ScopeMode scope_mode, TRAPS) {
Handle position = DebugInfo::bytecodePosition(debug_info);
if (position.is_null()) {
// Stubs do not record scope info, just oop maps
return;
}
! GrowableArray<ScopeValue*>* objectMapping;
! if (scope_mode == CodeInstaller::FullFrame) {
! objectMapping = record_virtual_objects(debug_info, CHECK);
! } else {
! objectMapping = NULL;
! }
! record_scope(pc_offset, position, scope_mode, objectMapping, CHECK);
}
! void CodeInstaller::record_scope(jint pc_offset, Handle position, ScopeMode scope_mode, GrowableArray<ScopeValue*>* objects, TRAPS) {
Handle frame;
! if (scope_mode == CodeInstaller::FullFrame) {
! if (!position->is_a(BytecodeFrame::klass())) {
! JVMCI_ERROR("Full frame expected for debug info at %i", pc_offset);
! }
frame = position;
}
Handle caller_frame = BytecodePosition::caller(position);
if (caller_frame.not_null()) {
! record_scope(pc_offset, caller_frame, scope_mode, objects, CHECK);
}
Handle hotspot_method = BytecodePosition::method(position);
Method* method = getMethodFromHotSpotMethod(hotspot_method());
jint bci = BytecodePosition::bci(position);
*** 988,1009 ****
// address instruction = _instructions->start() + pc_offset;
// jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start();
OopMap *map = create_oop_map(debug_info, CHECK);
_debug_recorder->add_safepoint(pc_offset, map);
! record_scope(pc_offset, debug_info, CHECK);
_debug_recorder->end_safepoint(pc_offset);
}
void CodeInstaller::site_Infopoint(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) {
Handle debug_info = CompilationResult_Infopoint::debugInfo(site);
if (debug_info.is_null()) {
JVMCI_ERROR("debug info expected at infopoint at %i", pc_offset);
}
_debug_recorder->add_non_safepoint(pc_offset);
! record_scope(pc_offset, debug_info, CHECK);
_debug_recorder->end_non_safepoint(pc_offset);
}
void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) {
Handle target = CompilationResult_Call::target(site);
--- 995,1016 ----
// address instruction = _instructions->start() + pc_offset;
// jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start();
OopMap *map = create_oop_map(debug_info, CHECK);
_debug_recorder->add_safepoint(pc_offset, map);
! record_scope(pc_offset, debug_info, CodeInstaller::FullFrame, CHECK);
_debug_recorder->end_safepoint(pc_offset);
}
void CodeInstaller::site_Infopoint(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) {
Handle debug_info = CompilationResult_Infopoint::debugInfo(site);
if (debug_info.is_null()) {
JVMCI_ERROR("debug info expected at infopoint at %i", pc_offset);
}
_debug_recorder->add_non_safepoint(pc_offset);
! record_scope(pc_offset, debug_info, CodeInstaller::BytecodePosition, CHECK);
_debug_recorder->end_non_safepoint(pc_offset);
}
void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) {
Handle target = CompilationResult_Call::target(site);
*** 1026,1036 ****
jint next_pc_offset = CodeInstaller::pd_next_offset(inst, pc_offset, hotspot_method, CHECK);
if (debug_info.not_null()) {
OopMap *map = create_oop_map(debug_info, CHECK);
_debug_recorder->add_safepoint(next_pc_offset, map);
! record_scope(next_pc_offset, debug_info, CHECK);
}
if (foreign_call.not_null()) {
jlong foreign_call_destination = HotSpotForeignCallTarget::address(foreign_call);
CodeInstaller::pd_relocate_ForeignCall(inst, foreign_call_destination, CHECK);
--- 1033,1043 ----
jint next_pc_offset = CodeInstaller::pd_next_offset(inst, pc_offset, hotspot_method, CHECK);
if (debug_info.not_null()) {
OopMap *map = create_oop_map(debug_info, CHECK);
_debug_recorder->add_safepoint(next_pc_offset, map);
! record_scope(next_pc_offset, debug_info, CodeInstaller::FullFrame, CHECK);
}
if (foreign_call.not_null()) {
jlong foreign_call_destination = HotSpotForeignCallTarget::address(foreign_call);
CodeInstaller::pd_relocate_ForeignCall(inst, foreign_call_destination, CHECK);