< prev index next >
src/hotspot/share/runtime/sharedRuntime.cpp
Print this page
rev 59470 : 8153224.v2.1[12].patch merged with 8153224.v2.13.patch.
@@ -63,10 +63,11 @@
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
+#include "runtime/synchronizer.hpp"
#include "runtime/vframe.inline.hpp"
#include "runtime/vframeArray.hpp"
#include "utilities/copy.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
@@ -3068,14 +3069,19 @@
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 displaced header becomes position-independent
- if (lock->displaced_header().is_unlocked())
+ // 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
+ }
+ // 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");
< prev index next >