JDK-8336325 : Add back UseHeavyMonitors as a develop option
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-07-12
  • Updated: 2025-04-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26Unresolved
Related Reports
Relates :  
Relates :  
Description
Add back UseHeavyMonitors as a develop option if wanted to replace LockingMode=LM_MONITOR.  Also fix platform dependent code:

static bool useHeavyMonitors() {
#if defined(X86) || defined(AARCH64) || defined(PPC64) || defined(RISCV64) || defined(S390)
  return LockingMode == LM_MONITOR;
#else
  return false;
#endif
}

Why is ARM excluded?
Comments
When we remove LockingMode == LM_LEGACY, we should remove LockingMode=LM_MONITOR also. UseHeavyMonitors shouldn't be added back but we could add a develop option to go slow path from the assembly code instead, which was the original intent of UseHeavyMonitors. It was for debugging which is a lot easier from C++ code than macroAssembler.
11-03-2025