# HG changeset patch # User Doug Simon # Date 1441825917 -7200 # Node ID f95eb4e457af9965bc142a4345c6cebd926d4602 # Parent e96cf3780359a1c10220909cbd3ff07f38d0ebc4 made HotSpotJVMCIRuntime.compilerToVm final (GRAAL-1255) diff -r e96cf3780359 -r f95eb4e457af jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java --- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java Wed Sep 09 20:30:21 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java Wed Sep 09 21:11:57 2015 +0200 @@ -44,8 +44,8 @@ * initialization of the JVMCI and really should only ever be triggered through * {@link JVMCI#getRuntime}. However since {@link #runtime} can also be called directly it * should also trigger proper initialization. To ensure proper ordering, the static initializer - * of this class initializes {@link JVMCI} and then access to {@link Once#instance} triggers the - * final initialization of the {@link HotSpotJVMCIRuntime}. + * of this class initializes {@link JVMCI} and then access to {@link DelayedInit#instance} + * triggers the final initialization of the {@link HotSpotJVMCIRuntime}. */ static { JVMCI.initialize(); @@ -68,7 +68,6 @@ } try (InitTimer t = timer("HotSpotJVMCIRuntime.completeInitialization")) { - // Why deferred initialization? See comment in completeInitialization(). instance.completeInitialization(); } } @@ -88,21 +87,9 @@ */ public void completeInitialization() { compiler = HotSpotJVMCICompilerConfig.getCompilerFactory().createCompiler(this); - - // Proxies for the VM/Compiler interfaces cannot be initialized - // in the constructor as proxy creation causes static - // initializers to be executed for all the types involved in the - // proxied methods. Some of these static initializers (e.g. in - // HotSpotMethodData) rely on the static 'instance' field being set - // to retrieve configuration details. - - CompilerToVM toVM = this.compilerToVm; - for (HotSpotVMEventListener vmEventListener : vmEventListeners) { - toVM = vmEventListener.completeInitialization(this, toVM); + vmEventListener.completeInitialization(this); } - - this.compilerToVm = toVM; } public static HotSpotJVMCIBackendFactory findFactory(String architecture) { @@ -122,7 +109,7 @@ return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordKind; } - protected/* final */CompilerToVM compilerToVm; + protected final CompilerToVM compilerToVm; protected final HotSpotVMConfig config; private final JVMCIBackend hostBackend; diff -r e96cf3780359 -r f95eb4e457af jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMEventListener.java --- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMEventListener.java Wed Sep 09 20:30:21 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMEventListener.java Wed Sep 09 21:11:57 2015 +0200 @@ -46,12 +46,9 @@ /** * Perform any extra initialization required. * - * @param hotSpotJVMCIRuntime - * @param compilerToVM the current {@link CompilerToVM instance} - * @return the original compilerToVM instance or a proxied version. + * @param runtime */ - default CompilerToVM completeInitialization(HotSpotJVMCIRuntime hotSpotJVMCIRuntime, CompilerToVM compilerToVM) { - return compilerToVM; + default void completeInitialization(HotSpotJVMCIRuntime runtime) { } /**