# HG changeset patch # User Christian Wimmer # Date 1347656623 25200 # Node ID 4ee4f44b55c6cb1582ca1d49d815c14476e4be80 # Parent 0c7e719c8bf850bcd7837b00fabdd7de8a4abcff Create Backend instance directly instead of specifying the class name as a system property diff -r 0c7e719c8bf8 -r 4ee4f44b55c6 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java Fri Sep 14 13:58:17 2012 -0700 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java Fri Sep 14 14:03:43 2012 -0700 @@ -22,8 +22,6 @@ */ package com.oracle.graal.compiler.target; -import java.lang.reflect.*; - import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.*; @@ -38,12 +36,6 @@ */ public abstract class Backend { - /** - * The name of the system property whose value (if non-null) specifies the fully qualified - * name of the class to be instantiated by {@link #create(CodeCacheProvider, TargetDescription)}. - */ - public static final String BACKEND_CLASS_PROPERTY = "graal.compiler.backend.class"; - public final CodeCacheProvider runtime; public final TargetDescription target; @@ -52,22 +44,6 @@ this.target = target; } - /** - * Creates the architecture and runtime specific back-end object. - * The class of the object instantiated must be in the {@link #BACKEND_CLASS_PROPERTY} system property. - */ - public static Backend create(CodeCacheProvider runtime, TargetDescription target) { - String className = System.getProperty(BACKEND_CLASS_PROPERTY); - assert className != null : "System property must be defined: " + BACKEND_CLASS_PROPERTY; - try { - Class c = Class.forName(className); - Constructor cons = c.getDeclaredConstructor(CodeCacheProvider.class, TargetDescription.class); - return (Backend) cons.newInstance(runtime, target); - } catch (Exception e) { - throw new Error("Could not instantiate " + className, e); - } - } - public FrameMap newFrameMap(RegisterConfig registerConfig) { return new FrameMap(runtime, target, registerConfig); } diff -r 0c7e719c8bf8 -r 4ee4f44b55c6 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Fri Sep 14 13:58:17 2012 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Fri Sep 14 14:03:43 2012 -0700 @@ -123,7 +123,7 @@ generator = LoggingProxy.getProxy(XirGenerator.class, generator); } - Backend backend = Backend.create(runtime, target); + Backend backend = new HotSpotAMD64Backend(runtime, target); generator.initialize(backend.newXirAssembler()); compiler = new GraalCompiler(getRuntime(), getTarget(), backend, generator); diff -r 0c7e719c8bf8 -r 4ee4f44b55c6 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Fri Sep 14 13:58:17 2012 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Fri Sep 14 14:03:43 2012 -0700 @@ -36,7 +36,6 @@ import com.oracle.graal.api.meta.*; import com.oracle.graal.api.meta.JavaType.Representation; import com.oracle.graal.compiler.*; -import com.oracle.graal.compiler.target.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.nodes.*; @@ -70,8 +69,6 @@ this.graalRuntime = graalRuntime; regConfig = new HotSpotRegisterConfig(config, false); globalStubRegConfig = new HotSpotRegisterConfig(config, true); - - System.setProperty(Backend.BACKEND_CLASS_PROPERTY, HotSpotAMD64Backend.class.getName()); } public void installSnippets(SnippetInstaller installer) {