< prev index next >

src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java

Print this page

        

*** 40,59 **** --- 40,61 ---- import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CompilationRequestResult; import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.common.JVMCIError; + import jdk.vm.ci.hotspot.services.HotSpotJVMCICompilerFactory; import jdk.vm.ci.hotspot.services.HotSpotVMEventListener; import jdk.vm.ci.inittimer.InitTimer; import jdk.vm.ci.inittimer.SuppressFBWarnings; import jdk.vm.ci.meta.JVMCIMetaAccessContext; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; + import jdk.vm.ci.runtime.services.JVMCICompilerFactory; import jdk.vm.ci.services.Services; import jdk.internal.misc.VM; //JaCoCo Exclude
*** 202,218 **** --- 204,232 ---- protected final CompilerToVM compilerToVm; protected final HotSpotVMConfig config; private final JVMCIBackend hostBackend; + private final JVMCICompilerFactory compilerFactory; + private final HotSpotJVMCICompilerFactory hsCompilerFactory; private volatile JVMCICompiler compiler; protected final JVMCIMetaAccessContext metaAccessContext; + /** + * Stores the result of {@link HotSpotJVMCICompilerFactory#getCompilationLevelAdjustment} so + * that it can be read from the VM. + */ + @SuppressWarnings("unused") private final int compilationLevelAdjustment; + private final Map<Class<? extends Architecture>, JVMCIBackend> backends = new HashMap<>(); private final Iterable<HotSpotVMEventListener> vmEventListeners; + /** + * Stores the result of {@link HotSpotJVMCICompilerFactory#getTrivialPrefixes()} so that it can + * be read from the VM. + */ @SuppressWarnings("unused") private final String[] trivialPrefixes; @SuppressWarnings("try") private HotSpotJVMCIRuntime() { compilerToVm = new CompilerToVM();
*** 257,267 **** if (Option.PrintConfig.getBoolean()) { printConfig(config, compilerToVm); } ! trivialPrefixes = HotSpotJVMCICompilerConfig.getCompilerFactory().getTrivialPrefixes(); } private JVMCIBackend registerBackend(JVMCIBackend backend) { Class<? extends Architecture> arch = backend.getCodeCache().getTarget().arch.getClass(); JVMCIBackend oldValue = backends.put(arch, backend); --- 271,290 ---- if (Option.PrintConfig.getBoolean()) { printConfig(config, compilerToVm); } ! compilerFactory = HotSpotJVMCICompilerConfig.getCompilerFactory(); ! if (compilerFactory instanceof HotSpotJVMCICompilerFactory) { ! hsCompilerFactory = (HotSpotJVMCICompilerFactory) compilerFactory; ! trivialPrefixes = hsCompilerFactory.getTrivialPrefixes(); ! compilationLevelAdjustment = hsCompilerFactory.getCompilationLevelAdjustment(config); ! } else { ! hsCompilerFactory = null; ! trivialPrefixes = null; ! compilationLevelAdjustment = 0; ! } } private JVMCIBackend registerBackend(JVMCIBackend backend) { Class<? extends Architecture> arch = backend.getCodeCache().getTarget().arch.getClass(); JVMCIBackend oldValue = backends.put(arch, backend);
*** 287,297 **** public JVMCICompiler getCompiler() { if (compiler == null) { synchronized (this) { if (compiler == null) { ! compiler = HotSpotJVMCICompilerConfig.getCompilerFactory().createCompiler(this); } } } return compiler; } --- 310,320 ---- public JVMCICompiler getCompiler() { if (compiler == null) { synchronized (this) { if (compiler == null) { ! compiler = compilerFactory.createCompiler(this); } } } return compiler; }
*** 330,339 **** --- 353,370 ---- /** * Called from the VM. */ @SuppressWarnings({"unused"}) + private int adjustCompilationLevel(Class<?> declaringClass, String name, String signature, boolean isOsr, int level) { + return hsCompilerFactory.adjustCompilationLevel(config, declaringClass, name, signature, isOsr, level); + } + + /** + * Called from the VM. + */ + @SuppressWarnings({"unused"}) private CompilationRequestResult compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) { CompilationRequestResult result = getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id)); assert result != null : "compileMethod must always return something"; return result; }
< prev index next >