544 JVMCIEnv* env = (JVMCIEnv*) (address) HotSpotCompiledNmethod::jvmciEnv(compiled_code); |
544 JVMCIEnv* env = (JVMCIEnv*) (address) HotSpotCompiledNmethod::jvmciEnv(compiled_code); |
545 if (id == -1) { |
545 if (id == -1) { |
546 // Make sure a valid compile_id is associated with every compile |
546 // Make sure a valid compile_id is associated with every compile |
547 id = CompileBroker::assign_compile_id_unlocked(Thread::current(), method, entry_bci); |
547 id = CompileBroker::assign_compile_id_unlocked(Thread::current(), method, entry_bci); |
548 } |
548 } |
549 result = JVMCIEnv::register_method(method, nm, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, |
549 result = JVMCIEnv::register_method(method, nm, entry_bci, &_offsets, _orig_pc_offset, &buffer, |
550 stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, |
550 stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, |
551 compiler, _debug_recorder, _dependencies, env, id, |
551 compiler, _debug_recorder, _dependencies, env, id, |
552 has_unsafe_access, _has_wide_vector, installed_code, compiled_code, speculation_log); |
552 has_unsafe_access, _has_wide_vector, installed_code, compiled_code, speculation_log); |
553 cb = nm; |
553 cb = nm; |
554 } |
554 } |
574 _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code)); |
574 _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code)); |
575 |
575 |
576 _code_handle = JNIHandles::make_local(HotSpotCompiledCode::targetCode(compiled_code)); |
576 _code_handle = JNIHandles::make_local(HotSpotCompiledCode::targetCode(compiled_code)); |
577 _code_size = HotSpotCompiledCode::targetCodeSize(compiled_code); |
577 _code_size = HotSpotCompiledCode::targetCodeSize(compiled_code); |
578 _total_frame_size = HotSpotCompiledCode::totalFrameSize(compiled_code); |
578 _total_frame_size = HotSpotCompiledCode::totalFrameSize(compiled_code); |
579 _custom_stack_area_offset = HotSpotCompiledCode::customStackAreaOffset(compiled_code); |
579 |
|
580 oop deoptRescueSlot = HotSpotCompiledCode::deoptRescueSlot(compiled_code); |
|
581 if (deoptRescueSlot == NULL) { |
|
582 _orig_pc_offset = -1; |
|
583 } else { |
|
584 _orig_pc_offset = StackSlot::offset(deoptRescueSlot); |
|
585 if (StackSlot::addFrameSize(deoptRescueSlot)) { |
|
586 _orig_pc_offset += _total_frame_size; |
|
587 } |
|
588 if (_orig_pc_offset < 0) { |
|
589 JVMCI_ERROR("invalid deopt rescue slot: %d", _orig_pc_offset); |
|
590 } |
|
591 } |
580 |
592 |
581 // Pre-calculate the constants section size. This is required for PC-relative addressing. |
593 // Pre-calculate the constants section size. This is required for PC-relative addressing. |
582 _data_section_handle = JNIHandles::make_local(HotSpotCompiledCode::dataSection(compiled_code)); |
594 _data_section_handle = JNIHandles::make_local(HotSpotCompiledCode::dataSection(compiled_code)); |
583 if ((_constants->alignment() % HotSpotCompiledCode::dataSectionAlignment(compiled_code)) != 0) { |
595 if ((_constants->alignment() % HotSpotCompiledCode::dataSectionAlignment(compiled_code)) != 0) { |
584 JVMCI_ERROR("invalid data section alignment: %d", HotSpotCompiledCode::dataSectionAlignment(compiled_code)); |
596 JVMCI_ERROR("invalid data section alignment: %d", HotSpotCompiledCode::dataSectionAlignment(compiled_code)); |
722 // three reasons for infopoints denote actual safepoints |
734 // three reasons for infopoints denote actual safepoints |
723 oop reason = site_Infopoint::reason(site); |
735 oop reason = site_Infopoint::reason(site); |
724 if (site_InfopointReason::SAFEPOINT() == reason || site_InfopointReason::CALL() == reason || site_InfopointReason::IMPLICIT_EXCEPTION() == reason) { |
736 if (site_InfopointReason::SAFEPOINT() == reason || site_InfopointReason::CALL() == reason || site_InfopointReason::IMPLICIT_EXCEPTION() == reason) { |
725 TRACE_jvmci_4("safepoint at %i", pc_offset); |
737 TRACE_jvmci_4("safepoint at %i", pc_offset); |
726 site_Safepoint(buffer, pc_offset, site, CHECK_OK); |
738 site_Safepoint(buffer, pc_offset, site, CHECK_OK); |
|
739 if (_orig_pc_offset < 0) { |
|
740 JVMCI_ERROR_OK("method contains safepoint, but has not deopt rescue slot"); |
|
741 } |
727 } else { |
742 } else { |
728 TRACE_jvmci_4("infopoint at %i", pc_offset); |
743 TRACE_jvmci_4("infopoint at %i", pc_offset); |
729 site_Infopoint(buffer, pc_offset, site, CHECK_OK); |
744 site_Infopoint(buffer, pc_offset, site, CHECK_OK); |
730 } |
745 } |
731 } else if (site->is_a(site_DataPatch::klass())) { |
746 } else if (site->is_a(site_DataPatch::klass())) { |