@@ -3654,33 +3654,35 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
3654
3654
Arguments::print_on (&st);
3655
3655
}
3656
3656
3657
+ return JNI_OK;
3658
+ }
3659
+
3660
+ void Arguments::set_compact_headers_flags () {
3657
3661
#ifdef _LP64
3658
3662
if (UseCompactObjectHeaders && FLAG_IS_CMDLINE (UseCompressedClassPointers) && !UseCompressedClassPointers) {
3659
3663
warning (" Compact object headers require compressed class pointers. Disabling compact object headers." );
3660
3664
FLAG_SET_DEFAULT (UseCompactObjectHeaders, false );
3661
3665
}
3662
- if (UseCompactObjectHeaders && LockingMode != LM_LIGHTWEIGHT) {
3663
- FLAG_SET_DEFAULT (LockingMode, LM_LIGHTWEIGHT);
3664
- }
3665
3666
if (UseCompactObjectHeaders && !UseObjectMonitorTable) {
3666
3667
// If UseCompactObjectHeaders is on the command line, turn on UseObjectMonitorTable.
3667
3668
if (FLAG_IS_CMDLINE (UseCompactObjectHeaders)) {
3668
3669
FLAG_SET_DEFAULT (UseObjectMonitorTable, true );
3669
3670
3670
- // If UseObjectMonitorTable is on the command line, turn off UseCompactObjectHeaders.
3671
+ // If UseObjectMonitorTable is on the command line, turn off UseCompactObjectHeaders.
3671
3672
} else if (FLAG_IS_CMDLINE (UseObjectMonitorTable)) {
3672
3673
FLAG_SET_DEFAULT (UseCompactObjectHeaders, false );
3673
- // If neither on the command line, the defaults are incompatible, but turn on UseObjectMonitorTable.
3674
+ // If neither on the command line, the defaults are incompatible, but turn on UseObjectMonitorTable.
3674
3675
} else {
3675
3676
FLAG_SET_DEFAULT (UseObjectMonitorTable, true );
3676
3677
}
3677
3678
}
3679
+ if (UseCompactObjectHeaders && LockingMode != LM_LIGHTWEIGHT) {
3680
+ FLAG_SET_DEFAULT (LockingMode, LM_LIGHTWEIGHT);
3681
+ }
3678
3682
if (UseCompactObjectHeaders && !UseCompressedClassPointers) {
3679
3683
FLAG_SET_DEFAULT (UseCompressedClassPointers, true );
3680
3684
}
3681
3685
#endif
3682
-
3683
- return JNI_OK;
3684
3686
}
3685
3687
3686
3688
jint Arguments::apply_ergo () {
@@ -3693,6 +3695,8 @@ jint Arguments::apply_ergo() {
3693
3695
3694
3696
GCConfig::arguments ()->initialize ();
3695
3697
3698
+ set_compact_headers_flags ();
3699
+
3696
3700
if (UseCompressedClassPointers) {
3697
3701
CompressedKlassPointers::pre_initialize ();
3698
3702
}
0 commit comments