# HG changeset patch # User Doug Simon # Date 1442358559 -7200 # Node ID 70a4415a824b6009a838c29c9b831e045c400232 # Parent 4dab2545d43559f81c7dddc6cc09a6dc6ea403a7 removed methods from HotSpotGraalRuntimeProvider that access statically available JVMCI functionality (GRAAL-1235) diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/CompressedNullCheckTest.java --- a/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/CompressedNullCheckTest.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/CompressedNullCheckTest.java Wed Sep 16 01:09:19 2015 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.hotspot.amd64.test; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import jdk.internal.jvmci.meta.ResolvedJavaMethod; import jdk.internal.jvmci.options.OptionValue; import jdk.internal.jvmci.options.OptionValue.OverrideScope; @@ -52,7 +53,7 @@ @SuppressWarnings("try") private void testImplicit(Integer i) { - Assume.assumeTrue(runtime().getConfig().useCompressedOops); + Assume.assumeTrue(config().useCompressedOops); Container c = new Container(); c.i = i; @@ -71,7 +72,7 @@ @SuppressWarnings("try") private void testExplicit(Integer i) { - Assume.assumeTrue(runtime().getConfig().useCompressedOops); + Assume.assumeTrue(config().useCompressedOops); Container c = new Container(); c.i = i; diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java --- a/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java Wed Sep 16 01:09:19 2015 +0200 @@ -110,7 +110,7 @@ @Test public void narrowOopTest() { - Assume.assumeTrue("skipping narrow oop data patch test", runtime().getConfig().useCompressedOops); + Assume.assumeTrue("skipping narrow oop data patch test", config().useCompressedOops); test("narrowOopSnippet"); } @@ -131,7 +131,7 @@ @Test public void compareTest() { - Assume.assumeTrue("skipping narrow oop data patch test", runtime().getConfig().useCompressedOops); + Assume.assumeTrue("skipping narrow oop data patch test", config().useCompressedOops); test("compareSnippet"); } diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Wed Sep 16 01:09:19 2015 +0200 @@ -29,6 +29,7 @@ import static jdk.internal.jvmci.amd64.AMD64.rsp; import static jdk.internal.jvmci.code.CallingConvention.Type.JavaCallee; import static jdk.internal.jvmci.code.ValueUtil.asRegister; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import java.lang.reflect.Field; import java.util.Set; @@ -94,7 +95,7 @@ @Override public LIRGeneratorTool newLIRGenerator(CallingConvention cc, LIRGenerationResult lirGenRes) { - return new AMD64HotSpotLIRGenerator(getProviders(), getRuntime().getConfig(), cc, lirGenRes); + return new AMD64HotSpotLIRGenerator(getProviders(), config(), cc, lirGenRes); } @Override @@ -104,7 +105,7 @@ @Override public NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen) { - return new AMD64HotSpotNodeLIRBuilder(getRuntime(), graph, lirGen); + return new AMD64HotSpotNodeLIRBuilder(graph, lirGen); } @Override @@ -252,7 +253,7 @@ AMD64MacroAssembler asm = (AMD64MacroAssembler) crb.asm; FrameMap frameMap = crb.frameMap; RegisterConfig regConfig = frameMap.getRegisterConfig(); - HotSpotVMConfig config = getRuntime().getConfig(); + HotSpotVMConfig config = config(); Label verifiedEntry = new Label(); // Emit the prefix diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Wed Sep 16 01:09:19 2015 +0200 @@ -25,6 +25,7 @@ import static com.oracle.graal.hotspot.HotSpotBackend.*; import static jdk.internal.jvmci.amd64.AMD64.*; import static jdk.internal.jvmci.code.ValueUtil.*; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import com.oracle.graal.compiler.amd64.*; import com.oracle.graal.compiler.common.spi.*; @@ -51,11 +52,8 @@ */ public class AMD64HotSpotNodeLIRBuilder extends AMD64NodeLIRBuilder implements HotSpotNodeLIRBuilder { - private final HotSpotGraalRuntimeProvider runtime; - - public AMD64HotSpotNodeLIRBuilder(HotSpotGraalRuntimeProvider runtime, StructuredGraph graph, LIRGeneratorTool gen) { + public AMD64HotSpotNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool gen) { super(graph, gen); - this.runtime = runtime; assert gen instanceof AMD64HotSpotLIRGenerator; assert getDebugInfoBuilder() instanceof HotSpotDebugInfoBuilder; ((AMD64HotSpotLIRGenerator) gen).setLockStack(((HotSpotDebugInfoBuilder) getDebugInfoBuilder()).lockStack()); @@ -111,12 +109,12 @@ protected void emitDirectCall(DirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) { InvokeKind invokeKind = ((HotSpotDirectCallTargetNode) callTarget).invokeKind(); if (invokeKind.isIndirect()) { - append(new AMD64HotspotDirectVirtualCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, runtime.getConfig())); + append(new AMD64HotspotDirectVirtualCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, config())); } else { assert invokeKind.isDirect(); HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.targetMethod(); assert resolvedMethod.isConcrete() : "Cannot make direct call to abstract method."; - append(new AMD64HotSpotDirectStaticCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, runtime.getConfig())); + append(new AMD64HotSpotDirectStaticCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, config())); } } @@ -129,7 +127,7 @@ AllocatableValue targetAddressDst = AMD64.rax.asValue(targetAddressSrc.getLIRKind()); gen.emitMove(metaspaceMethodDst, metaspaceMethodSrc); gen.emitMove(targetAddressDst, targetAddressSrc); - append(new AMD64IndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethodDst, targetAddressDst, callState, runtime.getConfig())); + append(new AMD64IndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethodDst, targetAddressDst, callState, config())); } else { super.emitIndirectCall(callTarget, result, parameters, temps, callState); } diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Wed Sep 16 01:09:19 2015 +0200 @@ -30,6 +30,7 @@ import static jdk.internal.jvmci.code.CallingConvention.Type.JavaCall; import static jdk.internal.jvmci.code.ValueUtil.asRegister; import static jdk.internal.jvmci.code.ValueUtil.isRegister; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import static jdk.internal.jvmci.sparc.SPARC.g0; import static jdk.internal.jvmci.sparc.SPARC.g5; import static jdk.internal.jvmci.sparc.SPARC.isGlobalRegister; @@ -133,7 +134,7 @@ @Override public LIRGeneratorTool newLIRGenerator(CallingConvention cc, LIRGenerationResult lirGenRes) { - return new SPARCHotSpotLIRGenerator(getProviders(), getRuntime().getConfig(), cc, lirGenRes); + return new SPARCHotSpotLIRGenerator(getProviders(), config(), cc, lirGenRes); } @Override @@ -143,7 +144,7 @@ @Override public NodeLIRBuilderTool newNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen) { - return new SPARCHotSpotNodeLIRBuilder(getRuntime(), graph, lirGen); + return new SPARCHotSpotNodeLIRBuilder(graph, lirGen); } /** @@ -321,7 +322,7 @@ masm.setImmediateConstantLoad(canUseImmediateConstantLoad); FrameMap frameMap = crb.frameMap; RegisterConfig regConfig = frameMap.getRegisterConfig(); - HotSpotVMConfig config = getRuntime().getConfig(); + HotSpotVMConfig config = config(); Label unverifiedStub = installedCodeOwner == null || installedCodeOwner.isStatic() ? null : new Label(); boolean hasUnsafeAccess = crb.compilationResult.hasUnsafeAccess(); int i = 0; diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Wed Sep 16 01:09:19 2015 +0200 @@ -22,35 +22,47 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.hotspot.HotSpotBackend.*; -import static jdk.internal.jvmci.sparc.SPARC.*; +import static com.oracle.graal.hotspot.HotSpotBackend.EXCEPTION_HANDLER_IN_CALLER; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; +import static jdk.internal.jvmci.sparc.SPARC.g5; +import static jdk.internal.jvmci.sparc.SPARC.o7; +import jdk.internal.jvmci.code.BytecodeFrame; +import jdk.internal.jvmci.code.CallingConvention; +import jdk.internal.jvmci.code.Register; +import jdk.internal.jvmci.code.RegisterValue; +import jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethod; +import jdk.internal.jvmci.meta.AllocatableValue; +import jdk.internal.jvmci.meta.JavaKind; +import jdk.internal.jvmci.meta.LIRKind; +import jdk.internal.jvmci.meta.Value; -import com.oracle.graal.compiler.common.spi.*; -import com.oracle.graal.compiler.gen.*; -import com.oracle.graal.compiler.sparc.*; -import com.oracle.graal.hotspot.*; -import com.oracle.graal.hotspot.nodes.*; -import com.oracle.graal.lir.*; -import com.oracle.graal.lir.gen.*; -import com.oracle.graal.lir.sparc.SPARCMove.*; -import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.CallTargetNode.*; -import com.oracle.graal.nodes.spi.*; - -import jdk.internal.jvmci.code.*; - -import com.oracle.graal.debug.*; - -import jdk.internal.jvmci.hotspot.*; -import jdk.internal.jvmci.meta.*; +import com.oracle.graal.compiler.common.spi.ForeignCallLinkage; +import com.oracle.graal.compiler.gen.DebugInfoBuilder; +import com.oracle.graal.compiler.sparc.SPARCNodeLIRBuilder; +import com.oracle.graal.debug.Debug; +import com.oracle.graal.hotspot.HotSpotDebugInfoBuilder; +import com.oracle.graal.hotspot.HotSpotLockStack; +import com.oracle.graal.hotspot.HotSpotNodeLIRBuilder; +import com.oracle.graal.hotspot.nodes.DirectCompareAndSwapNode; +import com.oracle.graal.hotspot.nodes.HotSpotDirectCallTargetNode; +import com.oracle.graal.hotspot.nodes.HotSpotIndirectCallTargetNode; +import com.oracle.graal.lir.LIRFrameState; +import com.oracle.graal.lir.Variable; +import com.oracle.graal.lir.gen.LIRGeneratorTool; +import com.oracle.graal.lir.sparc.SPARCMove.CompareAndSwapOp; +import com.oracle.graal.nodes.CallTargetNode.InvokeKind; +import com.oracle.graal.nodes.DirectCallTargetNode; +import com.oracle.graal.nodes.FullInfopointNode; +import com.oracle.graal.nodes.IndirectCallTargetNode; +import com.oracle.graal.nodes.SafepointNode; +import com.oracle.graal.nodes.StructuredGraph; +import com.oracle.graal.nodes.ValueNode; +import com.oracle.graal.nodes.spi.NodeValueMap; public class SPARCHotSpotNodeLIRBuilder extends SPARCNodeLIRBuilder implements HotSpotNodeLIRBuilder { - private HotSpotGraalRuntimeProvider runtime; - - public SPARCHotSpotNodeLIRBuilder(HotSpotGraalRuntimeProvider runtime, StructuredGraph graph, LIRGeneratorTool lirGen) { + public SPARCHotSpotNodeLIRBuilder(StructuredGraph graph, LIRGeneratorTool lirGen) { super(graph, lirGen); - this.runtime = runtime; assert gen instanceof SPARCHotSpotLIRGenerator; assert getDebugInfoBuilder() instanceof HotSpotDebugInfoBuilder; ((SPARCHotSpotLIRGenerator) gen).setLockStack(((HotSpotDebugInfoBuilder) getDebugInfoBuilder()).lockStack()); @@ -89,12 +101,12 @@ protected void emitDirectCall(DirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) { InvokeKind invokeKind = ((HotSpotDirectCallTargetNode) callTarget).invokeKind(); if (invokeKind.isIndirect()) { - append(new SPARCHotspotDirectVirtualCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, runtime.getConfig())); + append(new SPARCHotspotDirectVirtualCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, config())); } else { assert invokeKind.isDirect(); HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) callTarget.targetMethod(); assert resolvedMethod.isConcrete() : "Cannot make direct call to abstract method."; - append(new SPARCHotspotDirectStaticCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, runtime.getConfig())); + append(new SPARCHotspotDirectStaticCallOp(callTarget.targetMethod(), result, parameters, temps, callState, invokeKind, config())); } } @@ -107,7 +119,7 @@ Value targetAddressSrc = operand(callTarget.computedAddress()); AllocatableValue targetAddress = o7.asValue(targetAddressSrc.getLIRKind()); gen.emitMove(targetAddress, targetAddressSrc); - append(new SPARCIndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethod, targetAddress, callState, runtime.getConfig())); + append(new SPARCIndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethod, targetAddress, callState, config())); } @Override diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/DataPatchTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/DataPatchTest.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/DataPatchTest.java Wed Sep 16 01:09:19 2015 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.hotspot.test; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import jdk.internal.jvmci.hotspot.*; import org.junit.*; @@ -71,7 +72,7 @@ test("narrowOopSnippet"); } - private static final HotSpotVMConfig config = HotSpotJVMCIRuntime.runtime().getConfig(); + private static final HotSpotVMConfig config = config(); private static boolean initReplacements = false; @Before diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Wed Sep 16 01:09:19 2015 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.hotspot.test; import static com.oracle.graal.graphbuilderconf.IntrinsicContext.CompilationContext.*; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import java.io.*; import java.lang.reflect.*; @@ -54,8 +55,8 @@ HotSpotResolvedJavaMethod hsMethod = (HotSpotResolvedJavaMethod) method; HotSpotNmethod installedCode = new HotSpotNmethod(hsMethod, compResult.getName(), true); HotSpotCompiledNmethod compiledNmethod = new HotSpotCompiledNmethod(hsMethod, compResult); - int result = runtime().getCompilerToVM().installCode(getTarget(), compiledNmethod, installedCode, null); - HotSpotVMConfig config = runtime().getConfig(); + int result = HotSpotJVMCIRuntime.runtime().getCompilerToVM().installCode(getTarget(), compiledNmethod, installedCode, null); + HotSpotVMConfig config = config(); Assert.assertEquals("Error installing method " + method + ": " + config.getCodeInstallResultDescription(result), result, config.codeInstallResultOk); // HotSpotRuntime hsRuntime = (HotSpotRuntime) getCodeCache(); @@ -138,7 +139,7 @@ Assert.assertNotNull(getCode(installedCodeOwner, graph, true)); atLeastOneCompiled = true; } else { - Assert.assertFalse(runtime().getConfig().useAESIntrinsics); + Assert.assertFalse(config().useAESIntrinsics); } } } diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotResolvedObjectTypeTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotResolvedObjectTypeTest.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotResolvedObjectTypeTest.java Wed Sep 16 01:09:19 2015 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.hotspot.test; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import jdk.internal.jvmci.hotspot.*; import jdk.internal.jvmci.meta.*; @@ -44,7 +45,7 @@ public void testKlassLayoutHelper() { Constant klass = HotSpotResolvedObjectTypeImpl.fromObjectClass(this.getClass()).klass(); MemoryAccessProvider memoryAccess = getProviders().getConstantReflection().getMemoryAccessProvider(); - HotSpotVMConfig config = runtime().getConfig(); + HotSpotVMConfig config = config(); Constant c = StampFactory.forKind(JavaKind.Int).readConstant(memoryAccess, klass, config.klassLayoutHelperOffset); assertTrue(c.toString(), c.getClass() == PrimitiveConstant.class); PrimitiveConstant pc = (PrimitiveConstant) c; diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Wed Sep 16 01:09:19 2015 +0200 @@ -71,7 +71,7 @@ */ public class WriteBarrierAdditionTest extends HotSpotGraalCompilerTest { - private final HotSpotVMConfig config = runtime().getConfig(); + private final HotSpotVMConfig config = config(); private static final long referentOffset = referentOffset(); public static class Container { diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java Wed Sep 16 01:09:19 2015 +0200 @@ -22,6 +22,8 @@ */ package com.oracle.graal.hotspot.test; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; + import java.util.List; import java.util.Map; @@ -78,7 +80,7 @@ public static int barrierIndex; - private final HotSpotVMConfig config = runtime().getConfig(); + private final HotSpotVMConfig config = config(); public static class Container { diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Wed Sep 16 01:09:19 2015 +0200 @@ -24,6 +24,7 @@ import static com.oracle.graal.hotspot.CompileTheWorld.Options.*; import static jdk.internal.jvmci.compiler.Compiler.*; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import java.io.*; import java.lang.annotation.*; @@ -499,7 +500,7 @@ if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) { return false; } - HotSpotVMConfig c = HotSpotJVMCIRuntime.runtime().getConfig(); + HotSpotVMConfig c = config(); if (c.dontCompileHugeMethods && javaMethod.getCodeSize() > c.hugeMethodLimit) { return false; } diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalCompiler.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalCompiler.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalCompiler.java Wed Sep 16 01:09:19 2015 +0200 @@ -186,7 +186,7 @@ } protected PhaseSuite getGraphBuilderSuite(HotSpotProviders providers, boolean isOSR) { - PhaseSuite suite = HotSpotSuitesProvider.withSimpleDebugInfoIfRequested(providers.getSuites().getDefaultGraphBuilderSuite(), graalRuntime); + PhaseSuite suite = HotSpotSuitesProvider.withSimpleDebugInfoIfRequested(providers.getSuites().getDefaultGraphBuilderSuite()); if (isOSR) { suite = suite.copy(); suite.appendPhase(new OnStackReplacementPhase()); diff -r 4dab2545d435 -r 70a4415a824b 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 Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Wed Sep 16 01:09:19 2015 +0200 @@ -29,6 +29,7 @@ import static com.oracle.graal.debug.GraalDebugConfig.MethodFilter; import static com.oracle.graal.debug.GraalDebugConfig.Verify; import static com.oracle.graal.debug.GraalDebugConfig.areScopedMetricsOrTimersEnabled; +import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime.runtime; import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import static jdk.internal.jvmci.inittimer.InitTimer.timer; @@ -169,7 +170,7 @@ } } - BenchmarkCounters.initialize(getCompilerToVM()); + BenchmarkCounters.initialize(runtime().getCompilerToVM()); assert checkArrayIndexScaleInvariants(); @@ -227,7 +228,7 @@ final HotSpotResolvedJavaMethodImpl[] initialMetaMethods = toHotSpotResolvedJavaMethodImpls(initialMethods); final HotSpotResolvedJavaMethodImpl[] matchingMetaMethods = toHotSpotResolvedJavaMethodImpls(matchingMethods); - CompilerToVM compilerToVM = getCompilerToVM(); + CompilerToVM compilerToVM = runtime().getCompilerToVM(); HotSpotStackFrameReference current = compilerToVM.getNextStackFrame(null, initialMetaMethods, initialSkip); while (current != null) { T result = visitor.visitFrame(current); @@ -271,6 +272,6 @@ phaseTransition("final"); SnippetCounter.printGroups(TTY.out().out()); - BenchmarkCounters.shutdown(getCompilerToVM(), runtimeStartTime); + BenchmarkCounters.shutdown(runtime().getCompilerToVM(), runtimeStartTime); } } diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntimeProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntimeProvider.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntimeProvider.java Wed Sep 16 01:09:19 2015 +0200 @@ -24,13 +24,6 @@ import jdk.internal.jvmci.code.TargetDescription; import jdk.internal.jvmci.code.stack.StackIntrospection; -import jdk.internal.jvmci.hotspot.CompilerToVM; -import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; -import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider; -import jdk.internal.jvmci.hotspot.HotSpotResolvedObjectType; -import jdk.internal.jvmci.hotspot.HotSpotVMConfig; -import jdk.internal.jvmci.meta.JavaType; -import jdk.internal.jvmci.meta.ResolvedJavaType; import com.oracle.graal.api.runtime.GraalRuntime; import com.oracle.graal.hotspot.meta.HotSpotProviders; @@ -43,39 +36,10 @@ */ public interface HotSpotGraalRuntimeProvider extends GraalRuntime, RuntimeProvider, StackIntrospection { - default HotSpotJVMCIRuntimeProvider getJVMCIRuntime() { - return HotSpotJVMCIRuntime.runtime(); - } - - default HotSpotVMConfig getConfig() { - return getJVMCIRuntime().getConfig(); - } - default TargetDescription getTarget() { return getHostBackend().getTarget(); } - default CompilerToVM getCompilerToVM() { - return getJVMCIRuntime().getCompilerToVM(); - } - - /** - * Converts a name to a Java type. This method attempts to resolve {@code name} to a - * {@link ResolvedJavaType}. - * - * @param name a well formed Java type in {@linkplain JavaType#getName() internal} format - * @param accessingType the context of resolution which must be non-null - * @param resolve specifies whether resolution failure results in an unresolved type being - * return or a {@link LinkageError} being thrown - * @return a Java type for {@code name} which is guaranteed to be of type - * {@link ResolvedJavaType} if {@code resolve == true} - * @throws LinkageError if {@code resolve == true} and the resolution failed - * @throws NullPointerException if {@code accessingClass} is {@code null} - */ - default JavaType lookupType(String name, HotSpotResolvedObjectType accessingType, boolean resolve) { - return getJVMCIRuntime().lookupType(name, accessingType, resolve); - } - HotSpotProviders getHostProviders(); default String getName() { diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Wed Sep 16 01:09:19 2015 +0200 @@ -34,6 +34,7 @@ import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.OBJ_ARRAY_KLASS_ELEMENT_KLASS_LOCATION; import static com.oracle.graal.hotspot.replacements.NewObjectSnippets.INIT_LOCATION; import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import static jdk.internal.jvmci.meta.LocationIdentity.any; import java.lang.ref.Reference; @@ -236,7 +237,7 @@ } } else if (n instanceof VerifyHeapNode) { if (graph.getGuardsStage().areFrameStatesAtDeopts()) { - newObjectSnippets.lower((VerifyHeapNode) n, registers, runtime, tool); + newObjectSnippets.lower((VerifyHeapNode) n, registers, tool); } } else if (n instanceof RawMonitorEnterNode) { if (graph.getGuardsStage().areFrameStatesAtDeopts()) { @@ -319,7 +320,7 @@ } StructuredGraph graph = n.graph(); assert !n.getHub().isConstant(); - AddressNode address = createOffsetAddress(graph, n.getHub(), runtime.getConfig().klassLayoutHelperOffset); + AddressNode address = createOffsetAddress(graph, n.getHub(), config().klassLayoutHelperOffset); graph.replaceFloating(n, graph.unique(new FloatingReadNode(address, KLASS_LAYOUT_HELPER_LOCATION, null, n.stamp(), n.getGuard(), BarrierType.NONE))); } @@ -330,7 +331,7 @@ StructuredGraph graph = n.graph(); assert !n.getHub().isConstant(); - AddressNode address = createOffsetAddress(graph, n.getHub(), runtime.getConfig().classMirrorOffset); + AddressNode address = createOffsetAddress(graph, n.getHub(), config().classMirrorOffset); FloatingReadNode read = graph.unique(new FloatingReadNode(address, CLASS_MIRROR_LOCATION, null, n.stamp(), n.getGuard(), BarrierType.NONE)); graph.replaceFloating(n, read); } @@ -342,7 +343,7 @@ StructuredGraph graph = n.graph(); assert !n.getValue().isConstant(); - AddressNode address = createOffsetAddress(graph, n.getValue(), runtime.getConfig().klassOffset); + AddressNode address = createOffsetAddress(graph, n.getValue(), config().klassOffset); FloatingReadNode read = graph.unique(new FloatingReadNode(address, CLASS_KLASS_LOCATION, null, n.stamp(), n.getGuard(), BarrierType.NONE)); graph.replaceFloating(n, read); } @@ -371,7 +372,7 @@ // We use LocationNode.ANY_LOCATION for the reads that access the // compiled code entry as HotSpot does not guarantee they are final // values. - int methodCompiledEntryOffset = runtime.getConfig().methodCompiledEntryOffset; + int methodCompiledEntryOffset = config().methodCompiledEntryOffset; AddressNode address = createOffsetAddress(graph, metaspaceMethod, methodCompiledEntryOffset); ReadNode compiledEntry = graph.add(new ReadNode(address, any(), StampFactory.forKind(wordKind), BarrierType.NONE)); @@ -393,16 +394,16 @@ @Override protected Stamp loadStamp(Stamp stamp, JavaKind kind, boolean compressible) { - if (kind == JavaKind.Object && compressible && runtime.getConfig().useCompressedOops) { - return NarrowOopStamp.compressed((ObjectStamp) stamp, runtime.getConfig().getOopEncoding()); + if (kind == JavaKind.Object && compressible && config().useCompressedOops) { + return NarrowOopStamp.compressed((ObjectStamp) stamp, config().getOopEncoding()); } return super.loadStamp(stamp, kind, compressible); } @Override protected ValueNode implicitLoadConvert(StructuredGraph graph, JavaKind kind, ValueNode value, boolean compressible) { - if (kind == JavaKind.Object && compressible && runtime.getConfig().useCompressedOops) { - return CompressionNode.uncompress(value, runtime.getConfig().getOopEncoding()); + if (kind == JavaKind.Object && compressible && config().useCompressedOops) { + return CompressionNode.uncompress(value, config().getOopEncoding()); } return super.implicitLoadConvert(graph, kind, value, compressible); } @@ -416,8 +417,8 @@ @Override protected ValueNode implicitStoreConvert(StructuredGraph graph, JavaKind kind, ValueNode value, boolean compressible) { - if (kind == JavaKind.Object && compressible && runtime.getConfig().useCompressedOops) { - return CompressionNode.compress(value, runtime.getConfig().getOopEncoding()); + if (kind == JavaKind.Object && compressible && config().useCompressedOops) { + return CompressionNode.compress(value, config().getOopEncoding()); } return super.implicitStoreConvert(graph, kind, value, compressible); } @@ -428,7 +429,7 @@ * Anchor the read of the element klass to the cfg, because it is only valid when arrayClass * is an object class, which might not be the case in other parts of the compiled method. */ - AddressNode address = createOffsetAddress(graph, arrayHub, runtime.getConfig().arrayClassElementOffset); + AddressNode address = createOffsetAddress(graph, arrayHub, config().arrayClassElementOffset); return graph.unique(new FloatingReadNode(address, OBJ_ARRAY_KLASS_ELEMENT_KLASS_LOCATION, null, KlassPointerStamp.klassNonNull(), AbstractBeginNode.prevBegin(anchor))); } @@ -465,12 +466,12 @@ @Override protected BarrierType fieldInitializationBarrier(JavaKind entryKind) { - return (entryKind == JavaKind.Object && !runtime.getConfig().useDeferredInitBarriers) ? BarrierType.IMPRECISE : BarrierType.NONE; + return (entryKind == JavaKind.Object && !config().useDeferredInitBarriers) ? BarrierType.IMPRECISE : BarrierType.NONE; } @Override protected BarrierType arrayInitializationBarrier(JavaKind entryKind) { - return (entryKind == JavaKind.Object && !runtime.getConfig().useDeferredInitBarriers) ? BarrierType.PRECISE : BarrierType.NONE; + return (entryKind == JavaKind.Object && !config().useDeferredInitBarriers) ? BarrierType.PRECISE : BarrierType.NONE; } private void lowerOSRStartNode(OSRStartNode osrStart) { @@ -550,9 +551,9 @@ } } - private boolean addReadBarrier(UnsafeLoadNode load) { - if (runtime.getConfig().useG1GC && load.graph().getGuardsStage() == StructuredGraph.GuardsStage.FIXED_DEOPTS && load.object().getStackKind() == JavaKind.Object && - load.accessKind() == JavaKind.Object && !StampTool.isPointerAlwaysNull(load.object())) { + private static boolean addReadBarrier(UnsafeLoadNode load) { + if (config().useG1GC && load.graph().getGuardsStage() == StructuredGraph.GuardsStage.FIXED_DEOPTS && load.object().getStackKind() == JavaKind.Object && load.accessKind() == JavaKind.Object && + !StampTool.isPointerAlwaysNull(load.object())) { ResolvedJavaType type = StampTool.typeOrNull(load.object()); if (type != null && !type.isArray()) { return true; @@ -580,33 +581,31 @@ if (tool.getLoweringStage() != LoweringTool.StandardLoweringStage.LOW_TIER) { return graph.unique(new LoadHubNode(tool.getStampProvider(), object, guard != null ? guard.asNode() : null)); } - HotSpotVMConfig config = runtime.getConfig(); assert !object.isConstant() || object.isNullConstant(); KlassPointerStamp hubStamp = KlassPointerStamp.klassNonNull(); - if (config.useCompressedClassPointers) { - hubStamp = hubStamp.compressed(config.getKlassEncoding()); + if (config().useCompressedClassPointers) { + hubStamp = hubStamp.compressed(config().getKlassEncoding()); } - AddressNode address = createOffsetAddress(graph, object, config.hubOffset); + AddressNode address = createOffsetAddress(graph, object, config().hubOffset); FloatingReadNode memoryRead = graph.unique(new FloatingReadNode(address, HUB_LOCATION, null, hubStamp, guard, BarrierType.NONE)); - if (config.useCompressedClassPointers) { - return CompressionNode.uncompress(memoryRead, config.getKlassEncoding()); + if (config().useCompressedClassPointers) { + return CompressionNode.uncompress(memoryRead, config().getKlassEncoding()); } else { return memoryRead; } } private WriteNode createWriteHub(StructuredGraph graph, ValueNode object, ValueNode value) { - HotSpotVMConfig config = runtime.getConfig(); assert !object.isConstant() || object.asConstant().isDefaultForKind(); ValueNode writeValue = value; - if (config.useCompressedClassPointers) { - writeValue = CompressionNode.compress(value, config.getKlassEncoding()); + if (config().useCompressedClassPointers) { + writeValue = CompressionNode.compress(value, config().getKlassEncoding()); } - AddressNode address = createOffsetAddress(graph, object, config.hubOffset); + AddressNode address = createOffsetAddress(graph, object, config().hubOffset); return graph.add(new WriteNode(address, HUB_WRITE_LOCATION, writeValue, BarrierType.NONE)); } @@ -614,7 +613,7 @@ protected BarrierType fieldLoadBarrierType(ResolvedJavaField f) { HotSpotResolvedJavaField loadField = (HotSpotResolvedJavaField) f; BarrierType barrierType = BarrierType.NONE; - if (runtime.getConfig().useG1GC && loadField.getJavaKind() == JavaKind.Object && metaAccess.lookupJavaType(Reference.class).equals(loadField.getDeclaringClass()) && + if (config().useG1GC && loadField.getJavaKind() == JavaKind.Object && metaAccess.lookupJavaType(Reference.class).equals(loadField.getDeclaringClass()) && loadField.getName().equals("referent")) { barrierType = BarrierType.PRECISE; } @@ -629,7 +628,7 @@ @Override public int arrayScalingFactor(JavaKind kind) { - if (runtime.getConfig().useCompressedOops && kind == JavaKind.Object) { + if (config().useCompressedOops && kind == JavaKind.Object) { return super.arrayScalingFactor(JavaKind.Int); } else { return super.arrayScalingFactor(kind); @@ -643,7 +642,7 @@ @Override protected int arrayLengthOffset() { - return runtime.getConfig().arrayOopDescLengthOffset(); + return config().arrayOopDescLengthOffset(); } @Override diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java Wed Sep 16 01:09:19 2015 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.hotspot.meta; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import jdk.internal.jvmci.hotspot.*; import jdk.internal.jvmci.meta.*; @@ -68,8 +69,9 @@ if (type.isInstance(runtime)) { return runtime; } - if (type.isInstance(runtime.getConfig())) { - return runtime.getConfig(); + HotSpotVMConfig config = config(); + if (type.isInstance(config)) { + return config; } return null; } @@ -82,11 +84,12 @@ public Object getInjectedNodeIntrinsicParameter(ResolvedJavaType type) { // Need to test all fields since there no guarantee under the JMM // about the order in which these fields are written. + HotSpotVMConfig config = config(); if (configType == null || wordTypesType == null || configType == null) { MetaAccessProvider metaAccess = runtime.getHostProviders().getMetaAccess(); wordTypesType = metaAccess.lookupJavaType(runtime.getHostProviders().getWordTypes().getClass()); runtimeType = metaAccess.lookupJavaType(runtime.getClass()); - configType = metaAccess.lookupJavaType(runtime.getConfig().getClass()); + configType = metaAccess.lookupJavaType(config.getClass()); } if (type.isAssignableFrom(wordTypesType)) { @@ -96,7 +99,7 @@ return runtime; } if (type.isAssignableFrom(configType)) { - return runtime.getConfig(); + return config; } return null; } diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java Wed Sep 16 01:09:19 2015 +0200 @@ -25,6 +25,7 @@ import static com.oracle.graal.compiler.common.GraalOptions.ImmutableCode; import static com.oracle.graal.compiler.common.GraalOptions.VerifyPhases; import jdk.internal.jvmci.hotspot.CompilerToVM; +import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; import jdk.internal.jvmci.hotspot.HotSpotVMConfig; import jdk.internal.jvmci.options.DerivedOptionValue; import jdk.internal.jvmci.options.DerivedOptionValue.OptionSupplier; @@ -162,11 +163,10 @@ * {@linkplain CompilerToVM#shouldDebugNonSafepoints() requests} it. * * @param gbs the current graph builder suite - * @param graalRuntime * @return a possibly modified graph builder suite */ - public static PhaseSuite withSimpleDebugInfoIfRequested(PhaseSuite gbs, HotSpotGraalRuntimeProvider graalRuntime) { - if (graalRuntime.getCompilerToVM().shouldDebugNonSafepoints()) { + public static PhaseSuite withSimpleDebugInfoIfRequested(PhaseSuite gbs) { + if (HotSpotJVMCIRuntime.runtime().getCompilerToVM().shouldDebugNonSafepoints()) { PhaseSuite newGbs = gbs.copy(); GraphBuilderPhase graphBuilderPhase = (GraphBuilderPhase) newGbs.findPhase(GraphBuilderPhase.class).previous(); GraphBuilderConfiguration graphBuilderConfig = graphBuilderPhase.getGraphBuilderConfig(); diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Wed Sep 16 01:09:19 2015 +0200 @@ -86,7 +86,6 @@ import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.hotspot.HotSpotBackend; -import com.oracle.graal.hotspot.HotSpotGraalRuntimeProvider; import com.oracle.graal.hotspot.meta.HotSpotLoweringProvider; import com.oracle.graal.hotspot.meta.HotSpotProviders; import com.oracle.graal.hotspot.meta.HotSpotRegistersProvider; @@ -616,8 +615,8 @@ return size; } - public void lower(VerifyHeapNode verifyHeapNode, HotSpotRegistersProvider registers, HotSpotGraalRuntimeProvider runtime, LoweringTool tool) { - if (runtime.getConfig().cAssertions) { + public void lower(VerifyHeapNode verifyHeapNode, HotSpotRegistersProvider registers, LoweringTool tool) { + if (config().cAssertions) { Arguments args = new Arguments(verifyHeap, verifyHeapNode.graph().getGuardsStage(), tool.getLoweringStage()); args.addConst("threadRegister", registers.getThreadRegister()); diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java Wed Sep 16 01:09:19 2015 +0200 @@ -25,6 +25,7 @@ import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import jdk.internal.jvmci.code.CodeUtil; import jdk.internal.jvmci.meta.JavaConstant; import jdk.internal.jvmci.meta.JavaKind; @@ -218,8 +219,8 @@ return uninitialized; } - boolean isHeapWordAligned(JavaConstant value, JavaKind kind) { - return (getArrayBaseOffset(kind) + (long) value.asInt() * getArrayIndexScale(kind)) % runtime.getConfig().heapWordSize == 0; + static boolean isHeapWordAligned(JavaConstant value, JavaKind kind) { + return (getArrayBaseOffset(kind) + (long) value.asInt() * getArrayIndexScale(kind)) % config().heapWordSize == 0; } public void updateAlignedDisjoint() { diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Wed Sep 16 01:09:19 2015 +0200 @@ -25,6 +25,7 @@ import static com.oracle.graal.compiler.GraalCompiler.emitBackEnd; import static com.oracle.graal.compiler.GraalCompiler.emitFrontEnd; import static com.oracle.graal.compiler.GraalCompiler.getProfilingInfo; +import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import java.util.ArrayList; import java.util.Collection; @@ -42,6 +43,7 @@ import jdk.internal.jvmci.common.JVMCIError; import jdk.internal.jvmci.hotspot.HotSpotCodeCacheProvider; import jdk.internal.jvmci.hotspot.HotSpotCompiledCode; +import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; import jdk.internal.jvmci.hotspot.HotSpotVMConfig; import jdk.internal.jvmci.meta.ResolvedJavaMethod; @@ -49,10 +51,8 @@ import com.oracle.graal.debug.Debug; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.debug.internal.DebugScope; -import com.oracle.graal.hotspot.HotSpotBackend; import com.oracle.graal.hotspot.HotSpotCompiledRuntimeStub; import com.oracle.graal.hotspot.HotSpotForeignCallLinkage; -import com.oracle.graal.hotspot.HotSpotGraalRuntimeProvider; import com.oracle.graal.hotspot.meta.HotSpotProviders; import com.oracle.graal.hotspot.meta.HotSpotRuntimeStub; import com.oracle.graal.hotspot.nodes.StubStartNode; @@ -213,9 +213,8 @@ HotSpotRuntimeStub installedCode = new HotSpotRuntimeStub(stub); HotSpotCompiledCode hsCompResult = new HotSpotCompiledRuntimeStub(compResult); - HotSpotGraalRuntimeProvider runtime = ((HotSpotBackend) backend).getRuntime(); - int result = runtime.getCompilerToVM().installCode(backend.getTarget(), hsCompResult, installedCode, null); - HotSpotVMConfig config = runtime.getConfig(); + int result = HotSpotJVMCIRuntime.runtime().getCompilerToVM().installCode(backend.getTarget(), hsCompResult, installedCode, null); + HotSpotVMConfig config = config(); if (result != config.codeInstallResultOk) { throw new JVMCIError("Error installing stub %s: %s", Stub.this, config.getCodeInstallResultDescription(result)); } diff -r 4dab2545d435 -r 70a4415a824b graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Wed Sep 16 00:48:33 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Wed Sep 16 01:09:19 2015 +0200 @@ -53,6 +53,8 @@ import jdk.internal.jvmci.code.CodeCacheProvider; import jdk.internal.jvmci.code.CompilationResult; import jdk.internal.jvmci.common.JVMCIError; +import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; +import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider; import jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethod; import jdk.internal.jvmci.hotspot.HotSpotSpeculationLog; import jdk.internal.jvmci.hotspot.HotSpotVMConfig; @@ -73,7 +75,6 @@ import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.graphbuilderconf.InvocationPlugins; import com.oracle.graal.hotspot.HotSpotBackend; -import com.oracle.graal.hotspot.HotSpotGraalRuntimeProvider; import com.oracle.graal.hotspot.meta.HotSpotProviders; import com.oracle.graal.java.GraphBuilderPhase; import com.oracle.graal.lir.asm.CompilationResultBuilderFactory; @@ -222,7 +223,7 @@ private static CompilationResultBuilderFactory getOptimizedCallTargetInstrumentationFactory(String arch) { for (OptimizedCallTargetInstrumentationFactory factory : Services.load(OptimizedCallTargetInstrumentationFactory.class)) { if (factory.getArchitecture().equals(arch)) { - factory.init(getHotSpotGraalRuntime().getConfig(), getHotSpotProviders().getRegisters()); + factory.init(getJVMCIRuntime().getConfig(), getHotSpotProviders().getRegisters()); return factory; } } @@ -240,7 +241,7 @@ MetaAccessProvider metaAccess = providers.getMetaAccess(); Plugins plugins = new Plugins(new InvocationPlugins(metaAccess)); - boolean infoPoints = getHotSpotGraalRuntime().getCompilerToVM().shouldDebugNonSafepoints(); + boolean infoPoints = getJVMCIRuntime().getCompilerToVM().shouldDebugNonSafepoints(); GraphBuilderConfiguration config = infoPoints ? GraphBuilderConfiguration.getInfopointEagerDefault(plugins) : GraphBuilderConfiguration.getEagerDefault(plugins); new GraphBuilderPhase.Instance(metaAccess, providers.getStampProvider(), providers.getConstantReflection(), config, OptimisticOptimizations.ALL, null).apply(graph); @@ -256,8 +257,8 @@ return (HotSpotBackend) runtimeProvider.getHostBackend(); } - private static HotSpotGraalRuntimeProvider getHotSpotGraalRuntime() { - return getHotSpotBackend().getRuntime(); + private static HotSpotJVMCIRuntimeProvider getJVMCIRuntime() { + return HotSpotJVMCIRuntime.runtime(); } private static HotSpotProviders getHotSpotProviders() { @@ -266,7 +267,7 @@ private static PhaseSuite getGraphBuilderSuite(SuitesProvider suitesProvider) { PhaseSuite graphBuilderSuite = suitesProvider.getDefaultGraphBuilderSuite(); - return withSimpleDebugInfoIfRequested(graphBuilderSuite, getHotSpotGraalRuntime()); + return withSimpleDebugInfoIfRequested(graphBuilderSuite); } private static void removeInliningPhase(Suites suites) { @@ -353,7 +354,7 @@ @Override public void invalidateInstalledCode(OptimizedCallTarget optimizedCallTarget, Object source, CharSequence reason) { - getHotSpotGraalRuntime().getCompilerToVM().invalidateInstalledCode(optimizedCallTarget); + getJVMCIRuntime().getCompilerToVM().invalidateInstalledCode(optimizedCallTarget); getCompilationNotify().notifyCompilationInvalidated(optimizedCallTarget, source, reason); } @@ -364,7 +365,7 @@ @Override public boolean platformEnableInfopoints() { - return getHotSpotGraalRuntime().getCompilerToVM().shouldDebugNonSafepoints(); + return getJVMCIRuntime().getCompilerToVM().shouldDebugNonSafepoints(); } @Override @@ -391,7 +392,7 @@ } public static NativeFunctionInterface createNativeFunctionInterface() { - HotSpotVMConfig config = getHotSpotGraalRuntime().getConfig(); + HotSpotVMConfig config = getJVMCIRuntime().getConfig(); Backend backend = getHotSpotBackend(); RawNativeCallNodeFactory factory = getRawNativeCallNodeFactory(backend.getTarget().arch.getName()); if (factory == null) { @@ -413,7 +414,7 @@ static void traceTransferToInterpreter() { long thread = UNSAFE.getLong(Thread.currentThread(), THREAD_EETOP_OFFSET); - long pendingTransferToInterpreterAddress = thread + getHotSpotGraalRuntime().getConfig().pendingTransferToInterpreterOffset; + long pendingTransferToInterpreterAddress = thread + getJVMCIRuntime().getConfig().pendingTransferToInterpreterOffset; boolean deoptimized = UNSAFE.getByte(pendingTransferToInterpreterAddress) != 0; if (deoptimized) { UNSAFE.putByte(pendingTransferToInterpreterAddress, (byte) 0); diff -r 4dab2545d435 -r 70a4415a824b mx.graal/suite.py --- a/mx.graal/suite.py Wed Sep 16 00:48:33 2015 +0200 +++ b/mx.graal/suite.py Wed Sep 16 01:09:19 2015 +0200 @@ -6,7 +6,7 @@ "suites": [ { "name" : "jvmci", - "version" : "28fe5850735eb206b1ff7c7015b6501bb92cd721", + "version" : "c345ad3a1cbb33587482209d5a0b106948c06f4e", "urls" : [ {"url" : "http://lafo.ssw.uni-linz.ac.at/hg/graal-jvmci-8", "kind" : "hg"}, {"url" : "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind" : "binary"},