< prev index next >

src/hotspot/share/runtime/sharedRuntime.cpp

Print this page
*** 3239,20 ***
    for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
         kptr2 < fr.interpreter_frame_monitor_begin();
         kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
      if (kptr2->obj() != NULL) {         // Avoid 'holes' in the monitor array
        BasicLock *lock = kptr2->lock();
!       // Inflate so the object's header no longer refers to the BasicLock.
!       if (lock->displaced_header().is_unlocked()) {
!         // The object is locked and the resulting ObjectMonitor* will also be
!         // locked so it can't be async deflated until ownership is dropped.
!         // See the big comment in basicLock.cpp: BasicLock::move_to().
!         ObjectSynchronizer::inflate_helper(kptr2->obj());
        }
!       // Now the displaced header is free to move because the
!       // object's header no longer refers to it.
!       buf[i++] = (intptr_t)lock->displaced_header().value();
        buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
      }
    }
    assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
  
--- 3239,28 ---
    for (BasicObjectLock *kptr2 = fr.interpreter_frame_monitor_end();
         kptr2 < fr.interpreter_frame_monitor_begin();
         kptr2 = fr.next_monitor_in_interpreter_frame(kptr2) ) {
      if (kptr2->obj() != NULL) {         // Avoid 'holes' in the monitor array
        BasicLock *lock = kptr2->lock();
!       if (LockingMode == LM_LEGACY) {
!         // Inflate so the object's header no longer refers to the BasicLock.
!         if (lock->displaced_header().is_unlocked()) {
!           // The object is locked and the resulting ObjectMonitor* will also be
!           // locked so it can't be async deflated until ownership is dropped.
!           // See the big comment in basicLock.cpp: BasicLock::move_to().
+           ObjectSynchronizer::inflate_helper(kptr2->obj());
+         }
+         // Now the displaced header is free to move because the
+         // object's header no longer refers to it.
+         buf[i] = (intptr_t)lock->displaced_header().value();
        }
! #ifdef ASSERT
!       else {
!         buf[i] = badDispHeaderOSR;
+       }
+ #endif
+       i++;
        buf[i++] = cast_from_oop<intptr_t>(kptr2->obj());
      }
    }
    assert(i - max_locals == active_monitor_count*2, "found the expected number of monitors");
  
< prev index next >