< prev index next >

src/hotspot/cpu/arm/frame_arm.cpp

Print this page
@@ -228,14 +228,16 @@
    address* pc_addr = &((address *)sp())[-sender_sp_offset+return_addr_offset];
    if (TracePcPatching) {
      tty->print_cr("patch_pc at address" INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "] ",
                    p2i(pc_addr), p2i(*pc_addr), p2i(pc));
    }
+   DEBUG_ONLY(address old_pc = _pc;)
    *pc_addr = pc;
+   _pc = pc; // must be set before call to get_deopt_original_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");
+     assert(original_pc == old_pc, "expected original PC to be stored before patching");
      _deopt_state = is_deoptimized;
      // leave _pc as is
    } else {
      _deopt_state = not_deoptimized;
      _pc = pc;

@@ -244,15 +246,10 @@
  
  bool frame::is_interpreted_frame() const  {
    return Interpreter::contains(pc());
  }
  
- int frame::frame_size(RegisterMap* map) const {
-   frame sender = this->sender(map);
-   return sender.sp() - sp();
- }
- 
  intptr_t* frame::entry_frame_argument_at(int offset) const {
    assert(is_entry_frame(), "entry frame expected");
    // convert offset to index to deal with tsi
    int index = (Interpreter::expr_offset_in_bytes(offset)/wordSize);
    // Entry frame's arguments are always in relation to unextended_sp()

@@ -275,11 +272,16 @@
  
  BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
    return (BasicObjectLock*) addr_at(interpreter_frame_monitor_block_bottom_offset);
  }
  
- BasicObjectLock* frame::interpreter_frame_monitor_end() const {
+ // Pointer beyond the "oldest/deepest" BasicObjectLock on stack.
+ template BasicObjectLock* frame::interpreter_frame_monitor_end<true>() const;
+ template BasicObjectLock* frame::interpreter_frame_monitor_end<false>() const;
+ 
+ template <bool relative>
+ inline 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((intptr_t) fp() >  (intptr_t) result, "result must <  than frame pointer");
    assert((intptr_t) sp() <= (intptr_t) result, "result must >= than stack pointer");
    return result;

@@ -395,10 +397,11 @@
  #endif // COMPILER2
  
    return frame(sender_sp, unextended_sp, link(), sender_pc());
  }
  
+ template <bool stub>
  frame frame::sender_for_compiled_frame(RegisterMap* map) const {
    assert(map != NULL, "map must be set");
  
    // frame owned by optimizing compiler
    assert(_cb->frame_size() >= 0, "must have non-zero frame size");

@@ -438,11 +441,11 @@
    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);
+     return sender_for_compiled_frame<false>(map);
    }
  
    assert(false, "should not be called for a C frame");
    return frame();
  }

@@ -543,12 +546,15 @@
    }
  
    return type;
  }
  
+ template intptr_t* frame::interpreter_frame_tos_at<false>(jint offset) const;
+ template intptr_t* frame::interpreter_frame_tos_at<true >(jint offset) const;
  
- intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
+ template <bool relative>
+ inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
    int index = (Interpreter::expr_offset_in_bytes(offset)/wordSize);
    return &interpreter_frame_tos_address()[index];
  }
  
  #ifndef PRODUCT

@@ -572,10 +578,13 @@
  // This is a generic constructor which is only used by pns() in debug.cpp.
  frame::frame(void* sp, void* fp, void* pc) {
    init((intptr_t*)sp, (intptr_t*)fp, (address)pc);
  }
  
+ void frame::describe_top_pd(FrameValues& values) {
+   Unimplemented();
+ }
  #endif
  
  intptr_t *frame::initial_deoptimization_info() {
    // used to reset the saved FP
    return fp();
< prev index next >