--- old/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java 2019-03-28 11:23:51.000000000 -0700 +++ new/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java 2019-03-28 11:23:50.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,10 +22,12 @@ */ package jdk.vm.ci.hotspot; +import java.util.List; import java.util.Set; import jdk.vm.ci.code.CompilationRequest; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.common.NativeImageReinitialize; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.runtime.JVMCICompilerFactory; @@ -61,7 +63,7 @@ /** * Factory of the selected system compiler. */ - private static JVMCICompilerFactory compilerFactory; + @NativeImageReinitialize private static JVMCICompilerFactory compilerFactory; /** * Gets the selected system compiler factory. @@ -78,7 +80,7 @@ if (compilerName.isEmpty() || compilerName.equals("null")) { factory = new DummyCompilerFactory(); } else { - for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) { + for (JVMCICompilerFactory f : getJVMCICompilerFactories()) { if (f.getCompilerName().equals(compilerName)) { factory = f; } @@ -89,7 +91,7 @@ } } else { // Auto select a single available compiler - for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) { + for (JVMCICompilerFactory f : getJVMCICompilerFactories()) { if (factory == null) { openJVMCITo(f.getClass().getModule()); factory = f; @@ -124,4 +126,8 @@ } } } + + private static List getJVMCICompilerFactories() { + return JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class); + } }