< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java

Print this page

        

*** 23,32 **** --- 23,33 ---- package org.graalvm.compiler.hotspot; import static jdk.vm.ci.common.InitTimer.timer; + import static jdk.vm.ci.services.Services.IS_BUILDING_NATIVE_IMAGE; import static org.graalvm.compiler.hotspot.HotSpotGraalOptionValues.GRAAL_OPTION_PROPERTY_PREFIX; import java.io.PrintStream; import org.graalvm.compiler.api.runtime.GraalRuntime;
*** 69,87 **** @Override public void onSelection() { JVMCIVersionCheck.check(false); assert options == null : "cannot select " + getClass() + " service more than once"; ! options = HotSpotGraalOptionValues.HOTSPOT_OPTIONS; initializeGraalCompilePolicyFields(options); isGraalPredicate = compileGraalWithC1Only ? new IsGraalPredicate() : null; /* * Exercise this code path early to encourage loading now. This doesn't solve problem of * deadlock during class loading but seems to eliminate it in practice. */ adjustCompilationLevelInternal(Object.class, "hashCode", "()I", CompilationLevel.FullOptimization); adjustCompilationLevelInternal(Object.class, "hashCode", "()I", CompilationLevel.Simple); } private static void initializeGraalCompilePolicyFields(OptionValues options) { compileGraalWithC1Only = Options.CompileGraalWithC1Only.getValue(options); String optionValue = Options.GraalCompileOnly.getValue(options); --- 70,92 ---- @Override public void onSelection() { JVMCIVersionCheck.check(false); assert options == null : "cannot select " + getClass() + " service more than once"; ! options = HotSpotGraalOptionValues.defaultOptions(); initializeGraalCompilePolicyFields(options); isGraalPredicate = compileGraalWithC1Only ? new IsGraalPredicate() : null; /* * Exercise this code path early to encourage loading now. This doesn't solve problem of * deadlock during class loading but seems to eliminate it in practice. */ adjustCompilationLevelInternal(Object.class, "hashCode", "()I", CompilationLevel.FullOptimization); adjustCompilationLevelInternal(Object.class, "hashCode", "()I", CompilationLevel.Simple); + if (IS_BUILDING_NATIVE_IMAGE) { + // Triggers initialization of all option descriptors + Options.CompileGraalWithC1Only.getName(); + } } private static void initializeGraalCompilePolicyFields(OptionValues options) { compileGraalWithC1Only = Options.CompileGraalWithC1Only.getValue(options); String optionValue = Options.GraalCompileOnly.getValue(options);
< prev index next >