< prev index next >

src/hotspot/share/runtime/vframe.cpp

Print this page
@@ -42,10 +42,11 @@
  #include "prims/jvmtiExport.hpp"
  #include "runtime/frame.inline.hpp"
  #include "runtime/globals.hpp"
  #include "runtime/handles.inline.hpp"
  #include "runtime/javaThread.inline.hpp"
+ #include "runtime/lockStack.inline.hpp"
  #include "runtime/objectMonitor.hpp"
  #include "runtime/objectMonitor.inline.hpp"
  #include "runtime/osThread.hpp"
  #include "runtime/signature.hpp"
  #include "runtime/stackFrameStream.inline.hpp"

@@ -270,17 +271,21 @@
            // an inflated monitor that is first on the monitor list in
            // the first frame can block us on a monitor enter.
            markWord mark = monitor->owner()->mark();
            // The first stage of async deflation does not affect any field
            // used by this comparison so the ObjectMonitor* is usable here.
-           if (mark.has_monitor() &&
-               ( // we have marked ourself as pending on this monitor
-                 mark.monitor() == thread()->current_pending_monitor() ||
-                 // we are not the owner of this monitor
-                 !mark.monitor()->is_entered(thread())
-               )) {
-             lock_state = "waiting to lock";
+           if (mark.has_monitor()) {
+             if (mark.monitor()->is_owner_anonymous()) {
+               if (!thread()->lock_stack().contains(monitor->owner())) {
+                 lock_state = "waiting to lock";
+               }
+             } else if (// we have marked ourself as pending on this monitor
+                     mark.monitor() == thread()->current_pending_monitor() ||
+                     // we are not the owner of this monitor
+                     !mark.monitor()->is_entered(thread())) {
+               lock_state = "waiting to lock";
+             }
            }
          }
          print_locked_object_class_name(st, Handle(current, monitor->owner()), lock_state);
  
          found_first_monitor = true;

@@ -311,11 +316,11 @@
    GrowableArray<MonitorInfo*>* result = new GrowableArray<MonitorInfo*>(5);
    if (stack_chunk() == NULL) { // no monitors in continuations
      for (BasicObjectLock* current = (fr().previous_monitor_in_interpreter_frame(fr().interpreter_frame_monitor_begin()));
          current >= fr().interpreter_frame_monitor_end();
          current = fr().previous_monitor_in_interpreter_frame(current)) {
-       result->push(new MonitorInfo(current->obj(), current->lock(), false, false));
+       result->push(new MonitorInfo(current->obj(), false, false));
      }
    }
    return result;
  }
  

@@ -504,21 +509,20 @@
  // ------------- cChunk --------------
  
  entryVFrame::entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread)
  : externalVFrame(fr, reg_map, thread) {}
  
- MonitorInfo::MonitorInfo(oop owner, BasicLock* lock, bool eliminated, bool owner_is_scalar_replaced) {
+ MonitorInfo::MonitorInfo(oop owner, bool eliminated, bool owner_is_scalar_replaced) {
    Thread* thread = Thread::current();
    if (!owner_is_scalar_replaced) {
      _owner = Handle(thread, owner);
      _owner_klass = Handle();
    } else {
      assert(eliminated, "monitor should be eliminated for scalar replaced object");
      _owner = Handle();
      _owner_klass = Handle(thread, owner);
    }
-   _lock = lock;
    _eliminated = eliminated;
    _owner_is_scalar_replaced = owner_is_scalar_replaced;
  }
  
  #ifdef ASSERT

@@ -741,13 +745,10 @@
        } else {
          tty->print(" ( lock is eliminated, frame not compiled )");
        }
      }
      tty->cr();
-     tty->print("\t  ");
-     monitor->lock()->print_on(tty, monitor->owner());
-     tty->cr();
    }
  }
  
  
  void javaVFrame::print_value() const {
< prev index next >