< prev index next >

src/hotspot/share/runtime/frame.cpp

Print this page
@@ -495,11 +495,10 @@
    }
    assert(stack_size <= (size_t)max_jint, "stack size too big");
    return (jint)stack_size;
  }
  
- 
  // (frame::interpreter_frame_sender_sp accessor is in frame_<arch>.cpp)
  
  const char* frame::print_name() const {
    if (is_native_frame())      return "Native";
    if (is_interpreted_frame()) return "Interpreted";

@@ -575,14 +574,25 @@
    // locks for synchronization
    for (BasicObjectLock* current = interpreter_frame_monitor_end();
         current < interpreter_frame_monitor_begin();
         current = next_monitor_in_interpreter_frame(current)) {
      st->print(" - obj    [%s", current->obj() == nullptr ? "null" : "");
-     if (current->obj() != nullptr) current->obj()->print_value_on(st);
+     oop obj = current->obj();
+     if (obj != nullptr) {
+       if (!is_heap_frame()) {
+         obj->print_value_on(st);
+       } else {
+         // Might be an invalid oop. We don't have the
+         // stackChunk to correct it so just print address.
+         st->print(INTPTR_FORMAT, p2i(obj));
+       }
+     }
      st->print_cr("]");
      st->print(" - lock   [");
-     current->lock()->print_on(st, current->obj());
+     if (!is_heap_frame()) {
+       current->lock()->print_on(st, obj);
+     }
      st->print_cr("]");
    }
    // monitor
    st->print_cr(" - monitor[" INTPTR_FORMAT "]", p2i(interpreter_frame_monitor_begin()));
    // bcp

@@ -1083,20 +1093,20 @@
    assert(Universe::heap()->is_in_or_null(r), "bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", p2i(r), p2i(r));
    return r;
  }
  
  
- BasicLock* frame::get_native_monitor() {
+ BasicLock* frame::get_native_monitor() const {
    nmethod* nm = (nmethod*)_cb;
    assert(_cb != nullptr && _cb->is_nmethod() && nm->method()->is_native(),
           "Should not call this unless it's a native nmethod");
    int byte_offset = in_bytes(nm->native_basic_lock_sp_offset());
    assert(byte_offset >= 0, "should not see invalid offset");
    return (BasicLock*) &sp()[byte_offset / wordSize];
  }
  
- oop frame::get_native_receiver() {
+ oop frame::get_native_receiver() const {
    nmethod* nm = (nmethod*)_cb;
    assert(_cb != nullptr && _cb->is_nmethod() && nm->method()->is_native(),
           "Should not call this unless it's a native nmethod");
    int byte_offset = in_bytes(nm->native_receiver_sp_offset());
    assert(byte_offset >= 0, "should not see invalid offset");

@@ -1338,13 +1348,18 @@
    }
  };
  
  // callers need a ResourceMark because of name_and_sig_as_C_string() usage,
  // RA allocated string is returned to the caller
- void frame::describe(FrameValues& values, int frame_no, const RegisterMap* reg_map) {
+ void frame::describe(FrameValues& values, int frame_no, const RegisterMap* reg_map, bool top) {
    // boundaries: sp and the 'real' frame pointer
    values.describe(-1, sp(), err_msg("sp for #%d", frame_no), 0);
+   if (top) {
+     values.describe(-1, sp() - 1, err_msg("sp[-1] for #%d", frame_no), 0);
+     values.describe(-1, sp() - 2, err_msg("sp[-2] for #%d", frame_no), 0);
+   }
+ 
    intptr_t* frame_pointer = real_fp(); // Note: may differ from fp()
  
    // print frame info at the highest boundary
    intptr_t* info_address = MAX2(sp(), frame_pointer);
  

@@ -1412,11 +1427,11 @@
        oopsFn.describe(values, frame_no);
      }
    } else if (is_entry_frame()) {
      // For now just label the frame
      values.describe(-1, info_address, err_msg("#%d entry frame", frame_no), 2);
-   } else if (cb()->is_nmethod()) {
+   } else if (is_compiled_frame()) {
      // For now just label the frame
      nmethod* nm = cb()->as_nmethod();
      values.describe(-1, info_address,
                      FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for method J %s%s", frame_no,
                                         p2i(nm),

@@ -1515,21 +1530,20 @@
          FrameValuesOopMapClosure valuesFn(this, reg_map, values, frame_no);
          // also OopMapValue::live_value ??
          oop_map()->all_type_do(this, OopMapValue::callee_saved_value, &valuesFn);
        }
      }
- 
-     if (nm->method()->is_continuation_enter_intrinsic()) {
-       ContinuationEntry* ce = Continuation::get_continuation_entry_for_entry_frame(reg_map->thread(), *this); // (ContinuationEntry*)unextended_sp();
-       ce->describe(values, frame_no);
-     }
    } else if (is_native_frame()) {
      // For now just label the frame
      nmethod* nm = cb()->as_nmethod_or_null();
      values.describe(-1, info_address,
                      FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no,
                                         p2i(nm), nm->method()->name_and_sig_as_C_string()), 2);
+     if (nm->method()->is_continuation_enter_intrinsic()) {
+       ContinuationEntry* ce = Continuation::get_continuation_entry_for_entry_frame(reg_map->thread(), *this); // (ContinuationEntry*)unextended_sp();
+       ce->describe(values, frame_no);
+     }
    } else {
      // provide default info if not handled before
      char *info = (char *) "special frame";
      if ((_cb != nullptr) &&
          (_cb->name() != nullptr)) {
< prev index next >