--- old/src/hotspot/share/runtime/objectMonitor.hpp 2019-04-18 22:07:22.696307022 -0400 +++ new/src/hotspot/share/runtime/objectMonitor.hpp 2019-04-18 22:07:21.892307035 -0400 @@ -150,7 +150,7 @@ sizeof(volatile markOop) + sizeof(void * volatile) + sizeof(ObjectMonitor *)); protected: // protected for JvmtiRawMonitor - // Used by async monitor deflation as a marker in the _owner field: + // Used by async deflation as a marker in the _owner field: #define DEFLATER_MARKER reinterpret_cast(-1) void * volatile _owner; // pointer to owning thread OR BasicLock volatile jlong _previous_owner_tid; // thread id of the previous owner of the monitor @@ -349,7 +349,7 @@ int TrySpin(Thread * Self); void ExitEpilog(Thread * Self, ObjectWaiter * Wakee); bool ExitSuspendEquivalent(JavaThread * Self); - void install_displaced_markword_in_object(); + void install_displaced_markword_in_object(const oop obj); }; // A helper object for managing an ObjectMonitor*'s ref_count. There @@ -372,4 +372,15 @@ void set_om_ptr(ObjectMonitor * om_ptr); }; +// Macro to use guarantee() for more strict AsyncDeflateIdleMonitors +// checks and assert() otherwise. +#define ADIM_guarantee(p, ...) \ + do { \ + if (AsyncDeflateIdleMonitors) { \ + guarantee(p, __VA_ARGS__); \ + } else { \ + assert(p, __VA_ARGS__); \ + } \ + } while (0) + #endif // SHARE_RUNTIME_OBJECTMONITOR_HPP