--- old/src/hotspot/share/compiler/compilerDefinitions.cpp 2019-03-28 11:22:29.000000000 -0700 +++ new/src/hotspot/share/compiler/compilerDefinitions.cpp 2019-03-28 11:22:29.000000000 -0700 @@ -253,22 +253,6 @@ if (FLAG_IS_DEFAULT(TypeProfileWidth)) { FLAG_SET_DEFAULT(TypeProfileWidth, 8); } - if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) { - FLAG_SET_DEFAULT(OnStackReplacePercentage, 933); - } - // JVMCI needs values not less than defaults - if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { - FLAG_SET_DEFAULT(ReservedCodeCacheSize, MAX2(64*M, ReservedCodeCacheSize)); - } - if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) { - FLAG_SET_DEFAULT(InitialCodeCacheSize, MAX2(16*M, InitialCodeCacheSize)); - } - if (FLAG_IS_DEFAULT(MetaspaceSize)) { - FLAG_SET_DEFAULT(MetaspaceSize, MIN2(MAX2(12*M, MetaspaceSize), MaxMetaspaceSize)); - } - if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) { - FLAG_SET_DEFAULT(NewSizeThreadIncrease, MAX2(4*K, NewSizeThreadIncrease)); - } if (TieredStopAtLevel != CompLevel_full_optimization) { // Currently JVMCI compiler can only work at the full optimization level warning("forcing TieredStopAtLevel to full optimization because JVMCI is enabled"); @@ -277,7 +261,33 @@ if (FLAG_IS_DEFAULT(TypeProfileLevel)) { FLAG_SET_DEFAULT(TypeProfileLevel, 0); } - } + + if (UseJVMCINativeLibrary) { + // SVM compiled code requires more stack space + if (FLAG_IS_DEFAULT(CompilerThreadStackSize)) { + FLAG_SET_DEFAULT(CompilerThreadStackSize, 2*M); + } + } else { + // Adjust the on stack replacement percentage to avoid early + // OSR compilations while JVMCI itself is warming up + if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) { + FLAG_SET_DEFAULT(OnStackReplacePercentage, 933); + } + // JVMCI needs values not less than defaults + if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { + FLAG_SET_DEFAULT(ReservedCodeCacheSize, MAX2(64*M, ReservedCodeCacheSize)); + } + if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) { + FLAG_SET_DEFAULT(InitialCodeCacheSize, MAX2(16*M, InitialCodeCacheSize)); + } + if (FLAG_IS_DEFAULT(MetaspaceSize)) { + FLAG_SET_DEFAULT(MetaspaceSize, MIN2(MAX2(12*M, MetaspaceSize), MaxMetaspaceSize)); + } + if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) { + FLAG_SET_DEFAULT(NewSizeThreadIncrease, MAX2(4*K, NewSizeThreadIncrease)); + } + } // !UseJVMCINativeLibrary + } // UseJVMCICompiler } #endif // INCLUDE_JVMCI @@ -392,6 +402,8 @@ // Check that JVMCI compiler supports selested GC. // Should be done after GCConfig::initialize() was called. JVMCIGlobals::check_jvmci_supported_gc(); + + // Do JVMCI specific settings set_jvmci_specific_flags(); #endif