mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8319251: [REDO] Change LockingMode default from LM_LEGACY to LM_LIGHTWEIGHT
Reviewed-by: rkennke, dholmes
This commit is contained in:
parent
fbeac98c84
commit
000f4d8d15
@ -1969,11 +1969,11 @@ const int ObjectAlignmentInBytes = 8;
|
||||
"Mark all threads after a safepoint, and clear on a modify " \
|
||||
"fence. Add cleanliness checks.") \
|
||||
\
|
||||
product(int, LockingMode, LM_LEGACY, \
|
||||
product(int, LockingMode, LM_LIGHTWEIGHT, \
|
||||
"Select locking mode: " \
|
||||
"0: monitors only (LM_MONITOR), " \
|
||||
"1: monitors & legacy stack-locking (LM_LEGACY, default), " \
|
||||
"2: monitors & new lightweight locking (LM_LIGHTWEIGHT)") \
|
||||
"1: monitors & legacy stack-locking (LM_LEGACY), " \
|
||||
"2: monitors & new lightweight locking (LM_LIGHTWEIGHT, default)") \
|
||||
range(0, 2) \
|
||||
\
|
||||
product(uint, TrimNativeHeapInterval, 0, \
|
||||
|
||||
@ -419,13 +419,15 @@ public class VMProps implements Callable<Map<String, String>> {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if compiler in use supports RTM and false otherwise.
|
||||
* @return "true" if compiler in use supports RTM and "false" otherwise.
|
||||
* Note: Lightweight locking does not support RTM (for now).
|
||||
*/
|
||||
protected String vmRTMCompiler() {
|
||||
boolean isRTMCompiler = false;
|
||||
|
||||
if (Compiler.isC2Enabled() &&
|
||||
(Platform.isX86() || Platform.isX64() || Platform.isPPC())) {
|
||||
(Platform.isX86() || Platform.isX64() || Platform.isPPC()) &&
|
||||
is_LM_LIGHTWEIGHT().equals("false")) {
|
||||
isRTMCompiler = true;
|
||||
}
|
||||
return "" + isRTMCompiler;
|
||||
@ -481,6 +483,34 @@ public class VMProps implements Callable<Map<String, String>> {
|
||||
return "" + WB.getVMPageSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LockingMode.
|
||||
*/
|
||||
protected String vmLockingMode() {
|
||||
return "" + WB.getIntVMFlag("LockingMode");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return "true" if LockingMode == 0 (LM_MONITOR)
|
||||
*/
|
||||
protected String is_LM_MONITOR() {
|
||||
return "" + vmLockingMode().equals("0");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return "true" if LockingMode == 1 (LM_LEGACY)
|
||||
*/
|
||||
protected String is_LM_LEGACY() {
|
||||
return "" + vmLockingMode().equals("1");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return "true" if LockingMode == 2 (LM_LIGHTWEIGHT)
|
||||
*/
|
||||
protected String is_LM_LIGHTWEIGHT() {
|
||||
return "" + vmLockingMode().equals("2");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Graal is used as JIT compiler.
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user