comparison src/share/vm/jvmci/jvmciCodeInstaller.cpp @ 23299:805d58f2cd8c

Use explicit StackSlot instead of int offset for the deopt rescue slot.
author Roland Schatz <roland.schatz@oracle.com>
date Thu, 04 Feb 2016 10:38:07 +0100
parents b4ff1a18d19c
children b057a49aa52a
comparison
equal deleted inserted replaced
23298:657ccda6d281 23299:805d58f2cd8c
462 JVMCIEnv* env = (JVMCIEnv*) (address) HotSpotCompiledNmethod::jvmciEnv(compiled_code); 462 JVMCIEnv* env = (JVMCIEnv*) (address) HotSpotCompiledNmethod::jvmciEnv(compiled_code);
463 if (id == -1) { 463 if (id == -1) {
464 // Make sure a valid compile_id is associated with every compile 464 // Make sure a valid compile_id is associated with every compile
465 id = CompileBroker::assign_compile_id_unlocked(Thread::current(), method, entry_bci); 465 id = CompileBroker::assign_compile_id_unlocked(Thread::current(), method, entry_bci);
466 } 466 }
467 result = JVMCIEnv::register_method(method, nm, entry_bci, &_offsets, _custom_stack_area_offset, &buffer, 467 result = JVMCIEnv::register_method(method, nm, entry_bci, &_offsets, _orig_pc_offset, &buffer,
468 stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table, 468 stack_slots, _debug_recorder->_oopmaps, &_exception_handler_table,
469 compiler, _debug_recorder, _dependencies, env, id, 469 compiler, _debug_recorder, _dependencies, env, id,
470 has_unsafe_access, _has_wide_vector, installed_code, compiled_code, speculation_log); 470 has_unsafe_access, _has_wide_vector, installed_code, compiled_code, speculation_log);
471 cb = nm; 471 cb = nm;
472 } 472 }
492 _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code)); 492 _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code));
493 493
494 _code_handle = JNIHandles::make_local(HotSpotCompiledCode::targetCode(compiled_code)); 494 _code_handle = JNIHandles::make_local(HotSpotCompiledCode::targetCode(compiled_code));
495 _code_size = HotSpotCompiledCode::targetCodeSize(compiled_code); 495 _code_size = HotSpotCompiledCode::targetCodeSize(compiled_code);
496 _total_frame_size = HotSpotCompiledCode::totalFrameSize(compiled_code); 496 _total_frame_size = HotSpotCompiledCode::totalFrameSize(compiled_code);
497 _custom_stack_area_offset = HotSpotCompiledCode::customStackAreaOffset(compiled_code); 497
498 oop deoptRescueSlot = HotSpotCompiledCode::deoptRescueSlot(compiled_code);
499 if (deoptRescueSlot == NULL) {
500 _orig_pc_offset = -1;
501 } else {
502 _orig_pc_offset = StackSlot::offset(deoptRescueSlot);
503 if (StackSlot::addFrameSize(deoptRescueSlot)) {
504 _orig_pc_offset += _total_frame_size;
505 }
506 if (_orig_pc_offset < 0) {
507 JVMCI_ERROR("invalid deopt rescue slot: %d", _orig_pc_offset);
508 }
509 }
498 510
499 // Pre-calculate the constants section size. This is required for PC-relative addressing. 511 // Pre-calculate the constants section size. This is required for PC-relative addressing.
500 _data_section_handle = JNIHandles::make_local(HotSpotCompiledCode::dataSection(compiled_code)); 512 _data_section_handle = JNIHandles::make_local(HotSpotCompiledCode::dataSection(compiled_code));
501 if ((_constants->alignment() % HotSpotCompiledCode::dataSectionAlignment(compiled_code)) != 0) { 513 if ((_constants->alignment() % HotSpotCompiledCode::dataSectionAlignment(compiled_code)) != 0) {
502 JVMCI_ERROR("invalid data section alignment: %d", HotSpotCompiledCode::dataSectionAlignment(compiled_code)); 514 JVMCI_ERROR("invalid data section alignment: %d", HotSpotCompiledCode::dataSectionAlignment(compiled_code));
627 // three reasons for infopoints denote actual safepoints 639 // three reasons for infopoints denote actual safepoints
628 oop reason = site_Infopoint::reason(site); 640 oop reason = site_Infopoint::reason(site);
629 if (site_InfopointReason::SAFEPOINT() == reason || site_InfopointReason::CALL() == reason || site_InfopointReason::IMPLICIT_EXCEPTION() == reason) { 641 if (site_InfopointReason::SAFEPOINT() == reason || site_InfopointReason::CALL() == reason || site_InfopointReason::IMPLICIT_EXCEPTION() == reason) {
630 TRACE_jvmci_4("safepoint at %i", pc_offset); 642 TRACE_jvmci_4("safepoint at %i", pc_offset);
631 site_Safepoint(buffer, pc_offset, site, CHECK_OK); 643 site_Safepoint(buffer, pc_offset, site, CHECK_OK);
644 if (_orig_pc_offset < 0) {
645 JVMCI_ERROR_OK("method contains safepoint, but has not deopt rescue slot");
646 }
632 } else { 647 } else {
633 TRACE_jvmci_4("infopoint at %i", pc_offset); 648 TRACE_jvmci_4("infopoint at %i", pc_offset);
634 site_Infopoint(buffer, pc_offset, site, CHECK_OK); 649 site_Infopoint(buffer, pc_offset, site, CHECK_OK);
635 } 650 }
636 } else if (site->is_a(site_DataPatch::klass())) { 651 } else if (site->is_a(site_DataPatch::klass())) {