# HG changeset patch # User Doug Simon # Date 1381996697 -7200 # Node ID 3661954321aa6dd0f8d40bd30d615d3a7e670914 # Parent 88d451c7c48491c01541588a1d23aceeb23fe571 removed more uses of HotSpotGraalRuntime.getHostProviders() (GRAAL-363) diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java Thu Oct 17 09:58:17 2013 +0200 @@ -49,9 +49,8 @@ } @Override - public void initialize(HotSpotProviders providers) { - Kind word = runtime.getTarget().wordKind; - HotSpotVMConfig config = runtime.getConfig(); + public void initialize(HotSpotProviders providers, HotSpotVMConfig config) { + Kind word = providers.getCodeCache().getTarget().wordKind; // The calling convention for the exception handler stub is (only?) defined in // TemplateInterpreterGenerator::generate_throw_exception() @@ -69,7 +68,7 @@ registerForeignCall(DECRYPT, config.cipherBlockChainingDecryptAESCryptStub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, ANY_LOCATION); registerForeignCall(UPDATE_BYTES_CRC32, config.updateBytesCRC32Stub, NativeCall, PRESERVES_REGISTERS, LEAF, NOT_REEXECUTABLE, ANY_LOCATION); - super.initialize(providers); + super.initialize(providers, config); } @Override diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLoweringProvider.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLoweringProvider.java Thu Oct 17 09:58:17 2013 +0200 @@ -40,10 +40,9 @@ } @Override - public void initialize() { - HotSpotProviders providers = runtime.getHostProviders(); - convertSnippets = new AMD64ConvertSnippets.Templates(providers, runtime.getTarget()); - super.initialize(); + public void initialize(HotSpotProviders providers, HotSpotVMConfig config) { + convertSnippets = new AMD64ConvertSnippets.Templates(providers, providers.getCodeCache().getTarget()); + super.initialize(providers, config); } @Override diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotForeignCallsProvider.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotForeignCallsProvider.java Thu Oct 17 09:58:17 2013 +0200 @@ -25,6 +25,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; +import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; public class HSAILHotSpotForeignCallsProvider implements HotSpotForeignCallsProvider { @@ -55,6 +56,6 @@ throw GraalInternalError.unimplemented(); } - public void initialize(HotSpotProviders providers) { + public void initialize(HotSpotProviders providers, HotSpotVMConfig config) { } } diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotForeignCallsProvider.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXHotSpotForeignCallsProvider.java Thu Oct 17 09:58:17 2013 +0200 @@ -25,6 +25,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; +import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; public class PTXHotSpotForeignCallsProvider implements HotSpotForeignCallsProvider { @@ -49,7 +50,7 @@ throw GraalInternalError.unimplemented(); } - public void initialize(HotSpotProviders providers) { + public void initialize(HotSpotProviders providers, HotSpotVMConfig config) { throw GraalInternalError.unimplemented(); } } diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java Thu Oct 17 09:58:17 2013 +0200 @@ -45,8 +45,8 @@ } @Override - public void initialize(HotSpotProviders providers) { - Kind word = runtime.getTarget().wordKind; + public void initialize(HotSpotProviders providers, HotSpotVMConfig config) { + Kind word = providers.getCodeCache().getTarget().wordKind; // The calling convention for the exception handler stub is (only?) defined in // TemplateInterpreterGenerator::generate_throw_exception() @@ -59,6 +59,8 @@ CallingConvention incomingExceptionCc = new CallingConvention(0, ILLEGAL, incomingException, incomingExceptionPc); register(new HotSpotForeignCallLinkage(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, ANY_LOCATION)); register(new HotSpotForeignCallLinkage(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, ANY_LOCATION)); + + super.initialize(providers, config); } @Override diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Thu Oct 17 09:58:17 2013 +0200 @@ -128,7 +128,7 @@ bootstrapRunning = bootstrapEnabled; - HotSpotVMConfig config = runtime.getConfig(); + final HotSpotVMConfig config = runtime.getConfig(); long offset = config.graalMirrorInClassOffset; initMirror(typeBoolean, offset); initMirror(typeChar, offset); @@ -198,8 +198,8 @@ for (ReplacementsProvider provider : serviceLoader) { provider.registerReplacements(metaAccess, lowerer, replacements, target); } - providers.getForeignCalls().initialize(providers); - lowerer.initialize(); + providers.getForeignCalls().initialize(providers, config); + lowerer.initialize(providers, config); if (BootstrapReplacements.getValue()) { for (ResolvedJavaMethod method : replacements.getAllReplacements()) { replacements.getMacroSubstitution(method); diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotForeignCallsProvider.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotForeignCallsProvider.java Thu Oct 17 09:58:17 2013 +0200 @@ -24,13 +24,14 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.hotspot.*; /** * HotSpot extension of {@link ForeignCallsProvider}. */ public interface HotSpotForeignCallsProvider extends ForeignCallsProvider { - void initialize(HotSpotProviders providers); + void initialize(HotSpotProviders providers, HotSpotVMConfig config); /** * Gets the registers that must be saved across a foreign call into the runtime. diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Thu Oct 17 09:58:17 2013 +0200 @@ -159,8 +159,7 @@ public static final LocationIdentity[] NO_LOCATIONS = {}; - public void initialize(HotSpotProviders providers) { - HotSpotVMConfig c = runtime.getConfig(); + public void initialize(HotSpotProviders providers, HotSpotVMConfig c) { TargetDescription target = providers.getCodeCache().getTarget(); registerForeignCall(UNCOMMON_TRAP, c.uncommonTrapStub, NativeCall, PRESERVES_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS); diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Thu Oct 17 09:58:17 2013 +0200 @@ -78,9 +78,7 @@ this.foreignCalls = foreignCalls; } - public void initialize() { - HotSpotVMConfig c = runtime.getConfig(); - HotSpotProviders providers = runtime.getHostProviders(); + public void initialize(HotSpotProviders providers, HotSpotVMConfig config) { Replacements r = providers.getReplacements(); r.registerSubstitutions(ObjectSubstitutions.class); @@ -93,16 +91,17 @@ r.registerSubstitutions(CRC32Substitutions.class); r.registerSubstitutions(ReflectionSubstitutions.class); - checkcastDynamicSnippets = new CheckCastDynamicSnippets.Templates(providers, runtime.getTarget()); - instanceofSnippets = new InstanceOfSnippets.Templates(providers, runtime.getTarget()); - newObjectSnippets = new NewObjectSnippets.Templates(providers, runtime.getTarget()); - monitorSnippets = new MonitorSnippets.Templates(providers, runtime.getTarget(), c.useFastLocking); - writeBarrierSnippets = new WriteBarrierSnippets.Templates(providers, runtime.getTarget()); - boxingSnippets = new BoxingSnippets.Templates(providers, runtime.getTarget()); - exceptionObjectSnippets = new LoadExceptionObjectSnippets.Templates(providers, runtime.getTarget()); - unsafeLoadSnippets = new UnsafeLoadSnippets.Templates(providers, runtime.getTarget()); + TargetDescription target = providers.getCodeCache().getTarget(); + checkcastDynamicSnippets = new CheckCastDynamicSnippets.Templates(providers, target); + instanceofSnippets = new InstanceOfSnippets.Templates(providers, target); + newObjectSnippets = new NewObjectSnippets.Templates(providers, target); + monitorSnippets = new MonitorSnippets.Templates(providers, target, config.useFastLocking); + writeBarrierSnippets = new WriteBarrierSnippets.Templates(providers, target); + boxingSnippets = new BoxingSnippets.Templates(providers, target); + exceptionObjectSnippets = new LoadExceptionObjectSnippets.Templates(providers, target); + unsafeLoadSnippets = new UnsafeLoadSnippets.Templates(providers, target); - r.registerSnippetTemplateCache(new UnsafeArrayCopySnippets.Templates(providers, runtime.getTarget())); + r.registerSnippetTemplateCache(new UnsafeArrayCopySnippets.Templates(providers, target)); } @Override diff -r 88d451c7c484 -r 3661954321aa graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Thu Oct 17 09:25:58 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Thu Oct 17 09:58:17 2013 +0200 @@ -113,7 +113,7 @@ * Gets the address of the C++ Method object for this method. */ public Constant getMetaspaceMethodConstant() { - return Constant.forIntegerKind(runtime().getTarget().wordKind, metaspaceMethod, this); + return Constant.forIntegerKind(wordKind(), metaspaceMethod, this); } @Override