< prev index next >

src/hotspot/cpu/x86/frame_x86.cpp

Print this page
rev 50307 : [mq]: cont

@@ -27,10 +27,11 @@
 #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,14 +274,30 @@
     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");
+  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,11 +343,11 @@
 
 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");
+  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,11 +392,11 @@
   // 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 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,10 +440,14 @@
     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,10 +475,12 @@
   // 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,16 +511,16 @@
 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);
+  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 sender_for_compiled_frame(map);
+    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 >