Skip to content

Commit 000f4d8

Browse files
author
Daniel D. Daugherty
committed
8319251: [REDO] Change LockingMode default from LM_LEGACY to LM_LIGHTWEIGHT
Reviewed-by: rkennke, dholmes
1 parent fbeac98 commit 000f4d8

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

src/hotspot/share/runtime/globals.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,11 +1969,11 @@ const int ObjectAlignmentInBytes = 8;
19691969
"Mark all threads after a safepoint, and clear on a modify " \
19701970
"fence. Add cleanliness checks.") \
19711971
\
1972-
product(int, LockingMode, LM_LEGACY, \
1972+
product(int, LockingMode, LM_LIGHTWEIGHT, \
19731973
"Select locking mode: " \
19741974
"0: monitors only (LM_MONITOR), " \
1975-
"1: monitors & legacy stack-locking (LM_LEGACY, default), " \
1976-
"2: monitors & new lightweight locking (LM_LIGHTWEIGHT)") \
1975+
"1: monitors & legacy stack-locking (LM_LEGACY), " \
1976+
"2: monitors & new lightweight locking (LM_LIGHTWEIGHT, default)") \
19771977
range(0, 2) \
19781978
\
19791979
product(uint, TrimNativeHeapInterval, 0, \

test/jtreg-ext/requires/VMProps.java

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,13 +419,15 @@ protected String vmHasDTrace() {
419419
}
420420

421421
/**
422-
* @return true if compiler in use supports RTM and false otherwise.
422+
* @return "true" if compiler in use supports RTM and "false" otherwise.
423+
* Note: Lightweight locking does not support RTM (for now).
423424
*/
424425
protected String vmRTMCompiler() {
425426
boolean isRTMCompiler = false;
426427

427428
if (Compiler.isC2Enabled() &&
428-
(Platform.isX86() || Platform.isX64() || Platform.isPPC())) {
429+
(Platform.isX86() || Platform.isX64() || Platform.isPPC()) &&
430+
is_LM_LIGHTWEIGHT().equals("false")) {
429431
isRTMCompiler = true;
430432
}
431433
return "" + isRTMCompiler;
@@ -481,6 +483,34 @@ protected String vmPageSize() {
481483
return "" + WB.getVMPageSize();
482484
}
483485

486+
/**
487+
* @return LockingMode.
488+
*/
489+
protected String vmLockingMode() {
490+
return "" + WB.getIntVMFlag("LockingMode");
491+
}
492+
493+
/**
494+
* @return "true" if LockingMode == 0 (LM_MONITOR)
495+
*/
496+
protected String is_LM_MONITOR() {
497+
return "" + vmLockingMode().equals("0");
498+
}
499+
500+
/**
501+
* @return "true" if LockingMode == 1 (LM_LEGACY)
502+
*/
503+
protected String is_LM_LEGACY() {
504+
return "" + vmLockingMode().equals("1");
505+
}
506+
507+
/**
508+
* @return "true" if LockingMode == 2 (LM_LIGHTWEIGHT)
509+
*/
510+
protected String is_LM_LIGHTWEIGHT() {
511+
return "" + vmLockingMode().equals("2");
512+
}
513+
484514
/**
485515
* Check if Graal is used as JIT compiler.
486516
*

0 commit comments

Comments
 (0)