changeset 22546:f95eb4e457af

made HotSpotJVMCIRuntime.compilerToVm final (GRAAL-1255)
author Doug Simon <doug.simon@oracle.com>
date Wed, 09 Sep 2015 21:11:57 +0200
parents e96cf3780359
children 10a9e989850e
files jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMEventListener.java
diffstat 2 files changed, 6 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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) {
     }
 
     /**