diff jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java @ 22429:a1b0a76567c7

Select default compiler from jvmci.compiler system property.
author Roland Schatz <roland.schatz@oracle.com>
date Mon, 17 Aug 2015 18:32:44 +0200
parents cefff7d980bc
children 267eecd6d92a
line wrap: on
line diff
--- a/jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java	Tue Aug 11 15:17:53 2015 +0200
+++ b/jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java	Mon Aug 17 18:32:44 2015 +0200
@@ -27,6 +27,7 @@
 import java.util.*;
 
 import jdk.internal.jvmci.code.*;
+import jdk.internal.jvmci.compiler.*;
 import jdk.internal.jvmci.hotspot.*;
 import jdk.internal.jvmci.inittimer.*;
 import jdk.internal.jvmci.runtime.*;
@@ -37,15 +38,12 @@
 @ServiceProvider(HotSpotJVMCIBackendFactory.class)
 public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory {
 
-    protected Architecture createArchitecture(HotSpotVMConfig config) {
-        return new SPARC(computeFeatures(config));
-    }
-
-    protected TargetDescription createTarget(HotSpotVMConfig config) {
+    protected TargetDescription createTarget(HotSpotVMConfig config, CompilerFactory compilerFactory) {
         final int stackFrameAlignment = 16;
         final int implicitNullCheckLimit = 4096;
         final boolean inlineObjects = false;
-        return new TargetDescription(createArchitecture(config), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects);
+        Architecture arch = new SPARC(computeFeatures(config));
+        return new TargetDescription(compilerFactory.initializeArchitecture(arch), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects);
     }
 
     protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) {
@@ -72,18 +70,19 @@
         return features;
     }
 
+    @Override
     public String getArchitecture() {
         return "SPARC";
     }
 
     @Override
     public String toString() {
-        return getJVMCIRuntimeName() + ":" + getArchitecture();
+        return "JVMCIBackend:" + getArchitecture();
     }
 
-    public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) {
+    public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, CompilerFactory compilerFactory, JVMCIBackend host) {
         assert host == null;
-        TargetDescription target = createTarget(runtime.getConfig());
+        TargetDescription target = createTarget(runtime.getConfig(), compilerFactory);
 
         HotSpotMetaAccessProvider metaAccess = new HotSpotMetaAccessProvider(runtime);
         RegisterConfig regConfig = new SPARCHotSpotRegisterConfig(target, runtime.getConfig());
@@ -97,8 +96,4 @@
     protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, HotSpotConstantReflectionProvider constantReflection) {
         return new JVMCIBackend(metaAccess, codeCache, constantReflection);
     }
-
-    public String getJVMCIRuntimeName() {
-        return "basic";
-    }
 }