< prev index next >

src/hotspot/cpu/x86/frame_x86.cpp

Print this page
rev 50307 : [mq]: cont

*** 27,36 **** --- 27,37 ---- #include "memory/resourceArea.hpp" #include "oops/markOop.hpp" #include "oops/method.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" + #include "runtime/continuation.hpp" #include "runtime/frame.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/javaCalls.hpp" #include "runtime/monitorChunk.hpp" #include "runtime/os.inline.hpp"
*** 273,286 **** tty->print_cr("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "]", p2i(pc_addr), p2i(*pc_addr), p2i(pc)); } // Either the return address is the original one or we are going to // patch in the same address that's already there. ! assert(_pc == *pc_addr || pc == *pc_addr, "must be"); *pc_addr = pc; _cb = CodeCache::find_blob(pc); address original_pc = CompiledMethod::get_deopt_original_pc(this); if (original_pc != NULL) { assert(original_pc == _pc, "expected original PC to be stored before patching"); _deopt_state = is_deoptimized; // leave _pc as is } else { --- 274,303 ---- tty->print_cr("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "]", p2i(pc_addr), p2i(*pc_addr), p2i(pc)); } // Either the return address is the original one or we are going to // patch in the same address that's already there. ! assert(!Continuation::is_return_barrier_entry(*pc_addr), "return barrier"); ! // #ifdef ASSERT ! // bool good = (_pc == *pc_addr || pc == *pc_addr); ! // if (!good) { ! // tty->print_cr("pc: %p", pc); os::print_location(tty, *(intptr_t*)&pc); ! // tty->print_cr("_pc: %p", _pc); os::print_location(tty, *(intptr_t*)&_pc); ! // tty->print_cr("*pc_addr: %p", *pc_addr); os::print_location(tty, *(intptr_t*)pc_addr); ! // } ! // #endif ! assert(_pc == *pc_addr || pc == *pc_addr, "must be (pc: %p _pc: %p *pc_addr: %p)", pc, _pc, *pc_addr); *pc_addr = pc; _cb = CodeCache::find_blob(pc); address original_pc = CompiledMethod::get_deopt_original_pc(this); + // #ifdef ASSERT + // if (!good) { + // tty->print_cr("_pc: %p original_pc: %p", _pc, original_pc); + // CompiledMethod* cm = _cb->as_compiled_method_or_null(); + // tty->print_cr("_pc: %p is_deopt _pc: %d is_deopt pc: %d", _pc, cm->is_deopt_pc(_pc), cm->is_deopt_pc(pc)); + // } + // #endif if (original_pc != NULL) { assert(original_pc == _pc, "expected original PC to be stored before patching"); _deopt_state = is_deoptimized; // leave _pc as is } else {
*** 326,336 **** BasicObjectLock* frame::interpreter_frame_monitor_end() const { BasicObjectLock* result = (BasicObjectLock*) *addr_at(interpreter_frame_monitor_block_top_offset); // make sure the pointer points inside the frame assert(sp() <= (intptr_t*) result, "monitor end should be above the stack pointer"); ! assert((intptr_t*) result < fp(), "monitor end should be strictly below the frame pointer"); return result; } void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) { *((BasicObjectLock**)addr_at(interpreter_frame_monitor_block_top_offset)) = value; --- 343,353 ---- BasicObjectLock* frame::interpreter_frame_monitor_end() const { BasicObjectLock* result = (BasicObjectLock*) *addr_at(interpreter_frame_monitor_block_top_offset); // make sure the pointer points inside the frame assert(sp() <= (intptr_t*) result, "monitor end should be above the stack pointer"); ! assert((intptr_t*) result < fp(), "monitor end should be strictly below the frame pointer: result: %p fp: %p", result, fp()); return result; } void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) { *((BasicObjectLock**)addr_at(interpreter_frame_monitor_block_top_offset)) = value;
*** 375,385 **** // method anyway. fr._unextended_sp = unextended_sp; address original_pc = nm->get_original_pc(&fr); assert(nm->insts_contains_inclusive(original_pc), ! "original PC must be in the main code section of the the compiled method (or must be immediately following it)"); } #endif //------------------------------------------------------------------------------ // frame::adjust_unextended_sp --- 392,402 ---- // method anyway. fr._unextended_sp = unextended_sp; address original_pc = nm->get_original_pc(&fr); assert(nm->insts_contains_inclusive(original_pc), ! "original PC must be in the main code section of the the compiled method (or must be immediately following it) original_pc: %p unextended_sp: %p name: %s", original_pc, unextended_sp, nm->name()); } #endif //------------------------------------------------------------------------------ // frame::adjust_unextended_sp
*** 423,432 **** --- 440,453 ---- map->set_location(rbp->as_VMReg()->next(), (address) link_addr); } #endif // AMD64 } + intptr_t** frame::saved_link_address(RegisterMap* map) { + return (intptr_t**)map->location(rbp->as_VMReg()); + } + //------------------------------------------------------------------------------ // frame::sender_for_interpreter_frame frame frame::sender_for_interpreter_frame(RegisterMap* map) const { // SP is the raw SP from the sender after adapter or interpreter
*** 454,463 **** --- 475,486 ---- // frame owned by optimizing compiler assert(_cb->frame_size() >= 0, "must have non-zero frame size"); intptr_t* sender_sp = unextended_sp() + _cb->frame_size(); intptr_t* unextended_sp = sender_sp; + assert (sender_sp == real_fp(), "sender_sp: %p real_fp: %p", sender_sp, real_fp()); + // On Intel the return_address is always the word on the stack address sender_pc = (address) *(sender_sp-1); // This is the saved value of EBP which may or may not really be an FP. // It is only an FP if the sender is an interpreter frame (or C1?).
*** 488,503 **** frame frame::sender(RegisterMap* map) const { // Default is we done have to follow them. The sender_for_xxx will // update it accordingly map->set_include_argument_oops(false); ! if (is_entry_frame()) return sender_for_entry_frame(map); ! if (is_interpreted_frame()) return sender_for_interpreter_frame(map); assert(_cb == CodeCache::find_blob(pc()),"Must be the same"); if (_cb != NULL) { ! return sender_for_compiled_frame(map); } // Must be native-compiled frame, i.e. the marshaling code for native // methods that exists in the core system. return frame(sender_sp(), link(), sender_pc()); } --- 511,526 ---- frame frame::sender(RegisterMap* map) const { // Default is we done have to follow them. The sender_for_xxx will // update it accordingly map->set_include_argument_oops(false); ! if (is_entry_frame()) return Continuation::fix_continuation_bottom_sender(*this, sender_for_entry_frame(map), map); ! if (is_interpreted_frame()) return Continuation::fix_continuation_bottom_sender(*this, sender_for_interpreter_frame(map), map); assert(_cb == CodeCache::find_blob(pc()),"Must be the same"); if (_cb != NULL) { ! return Continuation::fix_continuation_bottom_sender(*this, sender_for_compiled_frame(map), map); } // Must be native-compiled frame, i.e. the marshaling code for native // methods that exists in the core system. return frame(sender_sp(), link(), sender_pc()); }
< prev index next >