Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/hotspot/share/opto/phaseX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,8 @@ bool PhaseIterGVN::verify_Ideal_for(Node* n, bool can_reshape) {
//
// Found (linux x64 only?) with:
// serviceability/sa/ClhsdbThreadContext.java
// -XX:+UnlockExperimentalVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:VerifyIterativeGVN=1110
// -XX:+UnlockExperimentalVMOptions -XX:LockingMode=1 -XX:+IgnoreUnrecognizedVMOptions -XX:VerifyIterativeGVN=1110
// Note: The -XX:LockingMode option is not available anymore.
case Op_StrEquals:
return false;

Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/runtime/basicLock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class BasicLock {

static int displaced_header_offset_in_bytes() { return metadata_offset_in_bytes(); }

// For lightweight locking
inline ObjectMonitor* object_monitor_cache() const;
inline void clear_object_monitor_cache();
inline void set_object_monitor_cache(ObjectMonitor* mon);
Expand Down
19 changes: 9 additions & 10 deletions src/hotspot/share/runtime/lightweightSynchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,14 +766,13 @@ void LightweightSynchronizer::exit(oop object, BasicLock* lock, JavaThread* curr
}

// LightweightSynchronizer::inflate_locked_or_imse is used to to get an inflated
// ObjectMonitor* when lightweight locking is used. It is used from contexts
// which require an inflated ObjectMonitor* for a monitor, and expects to throw
// a java.lang.IllegalMonitorStateException if it is not held by the current
// thread. Such as notify/wait and jni_exit. Lightweight locking keeps it invariant
// that it only inflates if it is already locked by the current thread or the
// current thread is in the process of entering. To maintain this invariant we
// need to throw a java.lang.IllegalMonitorStateException before inflating if
// the current thread is not the owner.
// ObjectMonitor*. It is used from contexts which require an inflatedmonitor,
// and expects to throw a java.lang.IllegalMonitorStateException if it is not
// held by the current thread. Such as notify/wait and jni_exit.
// Lightweight locking keeps it invariant that it only inflates if it is already
// locked by the current thread or the current thread is in the process of entering.
// To maintain this invariant we need to throw a java.lang.IllegalMonitorStateException
// before inflating if the current thread is not the owner.
// LightweightSynchronizer::inflate_locked_or_imse facilitates this.
ObjectMonitor* LightweightSynchronizer::inflate_locked_or_imse(oop obj, ObjectSynchronizer::InflateCause cause, TRAPS) {
JavaThread* current = THREAD;
Expand Down Expand Up @@ -820,8 +819,8 @@ ObjectMonitor* LightweightSynchronizer::inflate_locked_or_imse(oop obj, ObjectSy

ObjectMonitor* LightweightSynchronizer::inflate_into_object_header(oop object, ObjectSynchronizer::InflateCause cause, JavaThread* locking_thread, Thread* current) {

// The JavaThread* locking_thread parameter is only used by lightweight locking and
// requires that the locking_thread == Thread::current() or is suspended throughout
// The JavaThread* locking parameter requires that the
// locking_thread == JavaThread::current, or is suspended throughout
// the call by some other mechanism.
// Even with lightweight locking the thread might be nullptr when called from a non
// JavaThread. (As may still be the case from FastHashCode). However it is only
Expand Down
6 changes: 2 additions & 4 deletions src/hotspot/share/runtime/synchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,7 @@ void ObjectSynchronizer::notify(Handle obj, TRAPS) {
// Not inflated so there can't be any waiters to notify.
return;
}
ObjectMonitor* monitor;
monitor = LightweightSynchronizer::inflate_locked_or_imse(obj(), inflate_cause_notify, CHECK);
ObjectMonitor* monitor = LightweightSynchronizer::inflate_locked_or_imse(obj(), inflate_cause_notify, CHECK);
monitor->notify(CHECK);
}

Expand All @@ -553,8 +552,7 @@ void ObjectSynchronizer::notifyall(Handle obj, TRAPS) {
return;
}

ObjectMonitor* monitor;
monitor = LightweightSynchronizer::inflate_locked_or_imse(obj(), inflate_cause_notify, CHECK);
ObjectMonitor* monitor = LightweightSynchronizer::inflate_locked_or_imse(obj(), inflate_cause_notify, CHECK);
monitor->notifyAll(CHECK);
}

Expand Down