Mercurial > hg > graal-compiler
changeset 13615:f4c776ad613e
Merge
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Mon, 13 Jan 2014 13:45:25 +0100 |
parents | 0774f3303c2e (diff) 428403544e77 (current diff) |
children | 6888c58b810b |
files | graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java |
diffstat | 41 files changed, 204 insertions(+), 198 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXPhase.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXPhase.java Mon Jan 13 13:45:25 2014 +0100 @@ -34,9 +34,9 @@ * Assume that null checks would be done on the CPU caller side prior to copying data onto * the GPU. */ - for (LocalNode local : graph.getNodes(LocalNode.class)) { - if (local.stamp() instanceof ObjectStamp) { - local.setStamp(StampFactory.declaredNonNull(((ObjectStamp) local.stamp()).type())); + for (ParameterNode param : graph.getNodes(ParameterNode.class)) { + if (param.stamp() instanceof ObjectStamp) { + param.setStamp(StampFactory.declaredNonNull(((ObjectStamp) param.stamp()).type())); } } }
--- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Mon Jan 13 13:45:25 2014 +0100 @@ -153,9 +153,9 @@ append(new PTXParameterOp(params, true)); } - for (LocalNode local : graph.getNodes(LocalNode.class)) { - Value param = params[local.index()]; - Annotation[] annos = graph.method().getParameterAnnotations()[local.index()]; + for (ParameterNode param : graph.getNodes(ParameterNode.class)) { + Value paramValue = params[param.index()]; + Annotation[] annos = graph.method().getParameterAnnotations()[param.index()]; Warp warpAnnotation = null; if (annos != null) { @@ -166,9 +166,9 @@ } } if (warpAnnotation != null) { - setResult(local, emitWarpParam(param.getKind(), warpAnnotation)); + setResult(param, emitWarpParam(paramValue.getKind(), warpAnnotation)); } else { - setResult(local, emitLoadParam(param.getKind(), param, null)); + setResult(param, emitLoadParam(paramValue.getKind(), paramValue, null)); } } }
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CompareCanonicalizerTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CompareCanonicalizerTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -103,9 +103,9 @@ ConditionalNode mat = (ConditionalNode) result; assertTrue(mat.condition() instanceof IntegerTestNode); IntegerTestNode test = (IntegerTestNode) mat.condition(); - LocalNode local0 = graph.getLocal(0); - LocalNode local1 = graph.getLocal(1); - assertTrue((test.x() == local0 && test.y() == local1) || (test.x() == local1 && test.y() == local0)); + ParameterNode param0 = graph.getParameter(0); + ParameterNode param1 = graph.getParameter(1); + assertTrue((test.x() == param0 && test.y() == param1) || (test.x() == param1 && test.y() == param0)); } }
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionalEliminationTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionalEliminationTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -171,7 +171,7 @@ new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), null)); IfNode ifNode = (IfNode) graph.start().next(); InstanceOfNode instanceOf = (InstanceOfNode) ifNode.condition(); - IsNullNode x = graph.unique(new IsNullNode(graph.getLocal(0))); + IsNullNode x = graph.unique(new IsNullNode(graph.getParameter(0))); InstanceOfNode y = instanceOf; ShortCircuitOrNode disjunction = graph.unique(new ShortCircuitOrNode(x, false, y, false, NOT_FREQUENT_PROBABILITY)); LogicNegationNode negation = graph.unique(new LogicNegationNode(disjunction));
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -590,30 +590,28 @@ * Parses a Java method to produce a graph. */ protected StructuredGraph parse(Method m) { - return parse0(m, GraphBuilderConfiguration.getEagerDefault()); + return parse0(m, getCustomGraphBuilderSuite(GraphBuilderConfiguration.getEagerDefault())); } /** * Parses a Java method to produce a graph. */ protected StructuredGraph parseProfiled(Method m) { - return parse0(m, GraphBuilderConfiguration.getDefault()); + return parse0(m, getDefaultGraphBuilderSuite()); } /** * Parses a Java method in debug mode to produce a graph with extra infopoints. */ protected StructuredGraph parseDebug(Method m) { - GraphBuilderConfiguration gbConf = GraphBuilderConfiguration.getEagerDefault(); - gbConf.setEagerInfopointMode(true); - return parse0(m, gbConf); + return parse0(m, getCustomGraphBuilderSuite(GraphBuilderConfiguration.getEagerInfopointDefault())); } - private StructuredGraph parse0(Method m, GraphBuilderConfiguration conf) { + private StructuredGraph parse0(Method m, PhaseSuite<HighTierContext> graphBuilderSuite) { assert m.getAnnotation(Test.class) == null : "shouldn't parse method with @Test annotation: " + m; ResolvedJavaMethod javaMethod = getMetaAccess().lookupJavaMethod(m); StructuredGraph graph = new StructuredGraph(javaMethod); - new GraphBuilderPhase.Instance(getMetaAccess(), conf, OptimisticOptimizations.ALL).apply(graph); + graphBuilderSuite.apply(graph, new HighTierContext(providers, null, null, graphBuilderSuite, OptimisticOptimizations.ALL)); return graph; } @@ -622,10 +620,7 @@ return backend.getSuites().getDefaultGraphBuilderSuite().copy(); } - protected PhaseSuite<HighTierContext> getEagerGraphBuilderSuite() { - GraphBuilderConfiguration gbConf = GraphBuilderConfiguration.getEagerDefault(); - gbConf.setEagerInfopointMode(true); - + protected PhaseSuite<HighTierContext> getCustomGraphBuilderSuite(GraphBuilderConfiguration gbConf) { PhaseSuite<HighTierContext> suite = getDefaultGraphBuilderSuite().copy(); ListIterator<BasePhase<? super HighTierContext>> iterator = suite.findPhase(GraphBuilderPhase.class); iterator.remove();
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/IfCanonicalizerTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/IfCanonicalizerTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -139,15 +139,15 @@ private void test(String snippet) { StructuredGraph graph = parse(snippet); - LocalNode local = graph.getNodes(LocalNode.class).iterator().next(); + ParameterNode param = graph.getNodes(ParameterNode.class).iterator().next(); ConstantNode constant = ConstantNode.forInt(0, graph); - for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) { - n.replaceFirstInput(local, constant); + for (Node n : param.usages().filter(isNotA(FrameState.class)).snapshot()) { + n.replaceFirstInput(param, constant); } Debug.dump(graph, "Graph"); new CanonicalizerPhase(true).apply(graph, new PhaseContext(getProviders(), new Assumptions(false))); - for (FrameState fs : local.usages().filter(FrameState.class).snapshot()) { - fs.replaceFirstInput(local, null); + for (FrameState fs : param.usages().filter(FrameState.class).snapshot()) { + fs.replaceFirstInput(param, null); } StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET); assertEquals(referenceGraph, graph);
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -34,9 +34,11 @@ import com.oracle.graal.api.code.CallingConvention.Type; import com.oracle.graal.api.code.CompilationResult.Call; import com.oracle.graal.api.code.CompilationResult.Infopoint; +import com.oracle.graal.java.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.*; +import com.oracle.graal.phases.tiers.*; import com.oracle.graal.test.*; /** @@ -82,7 +84,8 @@ } assertTrue(graphLineSPs > 0); CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); - final CompilationResult cr = compileGraph(graph, cc, graph.method(), getProviders(), getBackend(), getCodeCache().getTarget(), null, getEagerGraphBuilderSuite(), OptimisticOptimizations.ALL, + PhaseSuite<HighTierContext> graphBuilderSuite = getCustomGraphBuilderSuite(GraphBuilderConfiguration.getEagerInfopointDefault()); + final CompilationResult cr = compileGraph(graph, cc, graph.method(), getProviders(), getBackend(), getCodeCache().getTarget(), null, graphBuilderSuite, OptimisticOptimizations.ALL, getProfilingInfo(graph), new SpeculationLog(), getSuites(), true, new CompilationResult(), CompilationResultBuilderFactory.Default); int lineSPs = 0; for (Infopoint sp : cr.getInfopoints()) {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/MonitorGraphTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/MonitorGraphTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -84,10 +84,10 @@ private StructuredGraph parseAndProcess(String snippet) { StructuredGraph graph = parse(snippet); - LocalNode local = graph.getNodes(LocalNode.class).first(); + ParameterNode param = graph.getNodes(ParameterNode.class).first(); ConstantNode constant = ConstantNode.forInt(0, graph); - for (Node n : local.usages().filter(isNotA(FrameState.class)).snapshot()) { - n.replaceFirstInput(local, constant); + for (Node n : param.usages().filter(isNotA(FrameState.class)).snapshot()) { + n.replaceFirstInput(param, constant); } Map<Invoke, Double> hints = new HashMap<>(); for (Invoke invoke : graph.getInvokes()) {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/PushNodesThroughPiTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/PushNodesThroughPiTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -76,7 +76,7 @@ assert field != null : "Node " + rn + " tries to access a field which doesn't exists for this type"; if (field.getName().equals("x")) { - Assert.assertTrue(rn.object() instanceof LocalNode); + Assert.assertTrue(rn.object() instanceof ParameterNode); } else { Assert.assertTrue(rn.object().toString(), rn.object() instanceof PiNode); }
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ReadAfterCheckCastTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ReadAfterCheckCastTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -92,7 +92,7 @@ Debug.dump(graph, "After lowering"); - for (FloatingReadNode node : graph.getNodes(LocalNode.class).first().usages().filter(FloatingReadNode.class)) { + for (FloatingReadNode node : graph.getNodes(ParameterNode.class).first().usages().filter(FloatingReadNode.class)) { // Checking that the parameter a is not directly used for the access to field // x10 (because x10 must be guarded by the checkcast). Assert.assertTrue(node.location().getLocationIdentity() == LocationIdentity.FINAL_LOCATION);
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EAMergingTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EAMergingTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -35,8 +35,8 @@ testEscapeAnalysis("simpleMergeSnippet", null, false); assertTrue(returnNode.result() instanceof PhiNode); PhiNode phi = (PhiNode) returnNode.result(); - assertTrue(phi.valueAt(0) instanceof LocalNode); - assertTrue(phi.valueAt(1) instanceof LocalNode); + assertTrue(phi.valueAt(0) instanceof ParameterNode); + assertTrue(phi.valueAt(1) instanceof ParameterNode); } public static int simpleMergeSnippet(boolean b, int u, int v) {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/IterativeInliningTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/IterativeInliningTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -74,7 +74,7 @@ public void testSimple() { ValueNode result = getReturn("testSimpleSnippet").result(); assertTrue(graph.getNodes().filter(LoadFieldNode.class).isEmpty()); - assertEquals(graph.getLocal(0), result); + assertEquals(graph.getParameter(0), result); } final ReturnNode getReturn(String snippet) {
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PEAReadEliminationTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/PEAReadEliminationTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -113,7 +113,7 @@ public void testParam() { ValueNode result = getReturn("testParamSnippet").result(); assertTrue(graph.getNodes().filter(LoadFieldNode.class).isEmpty()); - assertEquals(graph.getLocal(1), result); + assertEquals(graph.getParameter(1), result); } @SuppressWarnings("all") @@ -127,7 +127,7 @@ public void testMaterialized() { ValueNode result = getReturn("testMaterializedSnippet").result(); assertTrue(graph.getNodes().filter(LoadFieldNode.class).isEmpty()); - assertEquals(graph.getLocal(0), result); + assertEquals(graph.getParameter(0), result); } @SuppressWarnings("all") @@ -143,7 +143,7 @@ public void testSimpleLoop() { ValueNode result = getReturn("testSimpleLoopSnippet").result(); assertTrue(graph.getNodes().filter(LoadFieldNode.class).isEmpty()); - assertEquals(graph.getLocal(1), result); + assertEquals(graph.getParameter(1), result); } @SuppressWarnings("all")
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -33,6 +33,7 @@ import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.graph.*; +import com.oracle.graal.java.*; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.common.*; @@ -232,7 +233,7 @@ try (Scope s = Debug.scope("InliningTest", new DebugDumpScope(snippet))) { Method method = getMethod(snippet); StructuredGraph graph = eagerInfopointMode ? parseDebug(method) : parse(method); - PhaseSuite<HighTierContext> graphBuilderSuite = eagerInfopointMode ? getEagerGraphBuilderSuite() : getDefaultGraphBuilderSuite(); + PhaseSuite<HighTierContext> graphBuilderSuite = eagerInfopointMode ? getCustomGraphBuilderSuite(GraphBuilderConfiguration.getEagerInfopointDefault()) : getDefaultGraphBuilderSuite(); Assumptions assumptions = new Assumptions(true); HighTierContext context = new HighTierContext(getProviders(), assumptions, null, graphBuilderSuite, OptimisticOptimizations.ALL); Debug.dump(graph, "Graph");
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Mon Jan 13 13:45:25 2014 +0100 @@ -581,10 +581,10 @@ emitIncomingValues(params); - for (LocalNode local : graph.getNodes(LocalNode.class)) { - Value param = params[local.index()]; - assert param.getKind() == local.kind().getStackKind(); - setResult(local, emitMove(param)); + for (ParameterNode param : graph.getNodes(ParameterNode.class)) { + Value paramValue = params[param.index()]; + assert paramValue.getKind() == param.kind().getStackKind(); + setResult(param, emitMove(paramValue)); } }
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Mon Jan 13 13:45:25 2014 +0100 @@ -176,10 +176,10 @@ saveRbp = new SaveRbp(new NoOp(currentBlock, lir.lir(currentBlock).size())); append(saveRbp.placeholder); - for (LocalNode local : graph.getNodes(LocalNode.class)) { - Value param = params[local.index()]; - assert param.getKind() == local.kind().getStackKind(); - setResult(local, emitMove(param)); + for (ParameterNode param : graph.getNodes(ParameterNode.class)) { + Value paramValue = params[param.index()]; + assert paramValue.getKind() == param.kind().getStackKind(); + setResult(param, emitMove(paramValue)); } }
--- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILCompilationResult.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILCompilationResult.java Mon Jan 13 13:45:25 2014 +0100 @@ -204,9 +204,9 @@ @Override protected void run(StructuredGraph graph) { - for (LocalNode local : graph.getNodes(LocalNode.class)) { - if (local.stamp() instanceof ObjectStamp) { - local.setStamp(StampFactory.declaredNonNull(((ObjectStamp) local.stamp()).type())); + for (ParameterNode param : graph.getNodes(ParameterNode.class)) { + if (param.stamp() instanceof ObjectStamp) { + param.setStamp(StampFactory.declaredNonNull(((ObjectStamp) param.stamp()).type())); } } }
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/InstalledCodeExecuteHelperTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/InstalledCodeExecuteHelperTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -88,10 +88,10 @@ JavaType[] parameterTypes = signatureToTypes(getMetaAccess().lookupJavaMethod(m)); assert parameterTypes.length == args.length; for (int i = 0; i < argsToBind.length; i++) { - LocalNode local = graph.getLocal(i); + ParameterNode param = graph.getParameter(i); Constant c = Constant.forBoxed(parameterTypes[i].getKind(), argsToBind[i]); ConstantNode replacement = ConstantNode.forConstant(c, getMetaAccess(), graph); - local.replaceAtUsages(replacement); + param.replaceAtUsages(replacement); } } return graph;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Mon Jan 13 13:45:25 2014 +0100 @@ -382,7 +382,7 @@ if (graph.getGuardsStage() == StructuredGraph.GuardsStage.FIXED_DEOPTS) { OSRStartNode osrStart = (OSRStartNode) n; StartNode newStart = graph.add(new StartNode()); - LocalNode buffer = graph.unique(new LocalNode(0, StampFactory.forKind(wordKind))); + ParameterNode buffer = graph.unique(new ParameterNode(0, StampFactory.forKind(wordKind))); ForeignCallNode migrationEnd = graph.add(new ForeignCallNode(foreignCalls, OSR_MIGRATION_END, buffer)); migrationEnd.setStateAfter(osrStart.stateAfter());
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopyNode.java Mon Jan 13 13:45:25 2014 +0100 @@ -83,9 +83,9 @@ } private static void unrollFixedLengthLoop(StructuredGraph snippetGraph, int length, LoweringTool tool) { - LocalNode lengthLocal = snippetGraph.getLocal(4); - if (lengthLocal != null) { - snippetGraph.replaceFloating(lengthLocal, ConstantNode.forInt(length, snippetGraph)); + ParameterNode lengthParam = snippetGraph.getParameter(4); + if (lengthParam != null) { + snippetGraph.replaceFloating(lengthParam, ConstantNode.forInt(length, snippetGraph)); } // the canonicalization before loop unrolling is needed to propagate the length into // additions, etc.
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneNode.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneNode.java Mon Jan 13 13:45:25 2014 +0100 @@ -80,14 +80,14 @@ type = getConcreteType(getObject().stamp(), tool.assumptions(), tool.getMetaAccess()); if (type != null) { StructuredGraph newGraph = new StructuredGraph(); - LocalNode local = newGraph.unique(new LocalNode(0, getObject().stamp())); + ParameterNode param = newGraph.unique(new ParameterNode(0, getObject().stamp())); NewInstanceNode newInstance = newGraph.add(new NewInstanceNode(type, true)); newGraph.addAfterFixed(newGraph.start(), newInstance); ReturnNode returnNode = newGraph.add(new ReturnNode(newInstance)); newGraph.addAfterFixed(newInstance, returnNode); for (ResolvedJavaField field : type.getInstanceFields(true)) { - LoadFieldNode load = newGraph.add(new LoadFieldNode(local, field)); + LoadFieldNode load = newGraph.add(new LoadFieldNode(param, field)); newGraph.addBeforeFixed(returnNode, load); newGraph.addBeforeFixed(returnNode, newGraph.add(new StoreFieldNode(newInstance, field, load))); }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Mon Jan 13 13:45:25 2014 +0100 @@ -188,10 +188,10 @@ graph.replaceFixed(graph.start(), graph.add(new StubStartNode(this))); GraphKit kit = new GraphKit(graph, providers); - LocalNode[] locals = createLocals(kit, args); + ParameterNode[] params = createParameters(kit, args); ReadRegisterNode thread = kit.append(new ReadRegisterNode(providers.getRegisters().getThreadRegister(), true, false)); - ValueNode result = createTargetCall(kit, locals, thread); + ValueNode result = createTargetCall(kit, params, thread); kit.createInvoke(StubUtil.class, "handlePendingException", thread, ConstantNode.forBoolean(isObjectResult, graph)); if (isObjectResult) { InvokeNode object = kit.createInvoke(HotSpotReplacementsUtil.class, "getAndClearObjectResult", thread); @@ -213,8 +213,8 @@ return graph; } - private LocalNode[] createLocals(GraphKit kit, Class<?>[] args) { - LocalNode[] locals = new LocalNode[args.length]; + private ParameterNode[] createParameters(GraphKit kit, Class<?>[] args) { + ParameterNode[] params = new ParameterNode[args.length]; ResolvedJavaType accessingClass = providers.getMetaAccess().lookupJavaType(getClass()); for (int i = 0; i < args.length; i++) { ResolvedJavaType type = providers.getMetaAccess().lookupJavaType(args[i]).resolve(accessingClass); @@ -225,20 +225,20 @@ } else { stamp = StampFactory.forKind(type.getKind()); } - LocalNode local = kit.unique(new LocalNode(i, stamp)); - locals[i] = local; + ParameterNode param = kit.unique(new ParameterNode(i, stamp)); + params[i] = param; } - return locals; + return params; } - private StubForeignCallNode createTargetCall(GraphKit kit, LocalNode[] locals, ReadRegisterNode thread) { + private StubForeignCallNode createTargetCall(GraphKit kit, ParameterNode[] params, ReadRegisterNode thread) { if (prependThread) { - ValueNode[] targetArguments = new ValueNode[1 + locals.length]; + ValueNode[] targetArguments = new ValueNode[1 + params.length]; targetArguments[0] = thread; - System.arraycopy(locals, 0, targetArguments, 1, locals.length); + System.arraycopy(params, 0, targetArguments, 1, params.length); return kit.append(new StubForeignCallNode(providers.getForeignCalls(), target.getDescriptor(), targetArguments)); } else { - return kit.append(new StubForeignCallNode(providers.getForeignCalls(), target.getDescriptor(), locals)); + return kit.append(new StubForeignCallNode(providers.getForeignCalls(), target.getDescriptor(), params)); } } }
--- a/graal/com.oracle.graal.java.decompiler/src/com/oracle/graal/java/decompiler/lines/DecompilerSyntaxLine.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.java.decompiler/src/com/oracle/graal/java/decompiler/lines/DecompilerSyntaxLine.java Mon Jan 13 13:45:25 2014 +0100 @@ -49,8 +49,8 @@ protected static String getStringRepresentation(Node node) { if (node instanceof ConstantNode) { return String.valueOf(((ConstantNode) node).asConstant().asBoxedValue()); - } else if (node instanceof LocalNode) { - return "local_" + ((LocalNode) node).index(); + } else if (node instanceof ParameterNode) { + return "param_" + ((ParameterNode) node).index(); } else { return getVariable(node); }
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Mon Jan 13 13:45:25 2014 +0100 @@ -72,8 +72,8 @@ int index = 0; if (!isStatic(method.getModifiers())) { // add the receiver - LocalNode local = graph.unique(new LocalNode(javaIndex, StampFactory.declaredNonNull(method.getDeclaringClass()))); - storeLocal(javaIndex, local); + ParameterNode receiver = graph.unique(new ParameterNode(javaIndex, StampFactory.declaredNonNull(method.getDeclaringClass()))); + storeLocal(javaIndex, receiver); javaIndex = 1; index = 1; } @@ -92,8 +92,8 @@ } else { stamp = StampFactory.forKind(type.getKind()); } - LocalNode local = graph.unique(new LocalNode(index, stamp)); - storeLocal(javaIndex, local); + ParameterNode param = graph.unique(new ParameterNode(index, stamp)); + storeLocal(javaIndex, param); javaIndex += stackSlots(kind); index++; }
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java Mon Jan 13 13:45:25 2014 +0100 @@ -38,9 +38,10 @@ */ private boolean eagerInfopointMode; - protected GraphBuilderConfiguration(boolean eagerResolving, boolean omitAllExceptionEdges) { + protected GraphBuilderConfiguration(boolean eagerResolving, boolean omitAllExceptionEdges, boolean eagerInfopointMode) { this.eagerResolving = eagerResolving; this.omitAllExceptionEdges = omitAllExceptionEdges; + this.eagerInfopointMode = eagerInfopointMode; } public void setSkippedExceptionTypes(ResolvedJavaType[] skippedExceptionTypes) { @@ -68,15 +69,19 @@ } public static GraphBuilderConfiguration getDefault() { - return new GraphBuilderConfiguration(false, false); + return new GraphBuilderConfiguration(false, false, false); } public static GraphBuilderConfiguration getEagerDefault() { - return new GraphBuilderConfiguration(true, false); + return new GraphBuilderConfiguration(true, false, false); } public static GraphBuilderConfiguration getSnippetDefault() { - return new GraphBuilderConfiguration(true, true); + return new GraphBuilderConfiguration(true, true, false); + } + + public static GraphBuilderConfiguration getEagerInfopointDefault() { + return new GraphBuilderConfiguration(true, false, true); } /**
--- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -62,10 +62,10 @@ JavaType[] parameterTypes = signatureToTypes(getMetaAccess().lookupJavaMethod(m)); assert parameterTypes.length == args.length; for (int i = 0; i < args.length; i++) { - LocalNode local = graph.getLocal(i); + ParameterNode param = graph.getParameter(i); Constant c = Constant.forBoxed(parameterTypes[i].getKind(), args[i]); ConstantNode replacement = ConstantNode.forConstant(c, getMetaAccess(), graph); - local.replaceAtUsages(replacement); + param.replaceAtUsages(replacement); } } return graph;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java Mon Jan 13 13:45:25 2014 +0100 @@ -410,7 +410,9 @@ closure.apply(this, value); } for (MonitorIdNode monitorId : monitorIds) { - closure.apply(this, monitorId); + if (monitorId != null) { + closure.apply(this, monitorId); + } } for (EscapeObjectState state : virtualObjectMappings) { state.applyToNonVirtual(closure);
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LocalNode.java Mon Jan 13 12:21:25 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.nodes; - -import com.oracle.graal.graph.*; -import com.oracle.graal.nodes.type.*; - -/** - * The {@code Local} instruction is a placeholder for an incoming argument to a function call. - */ -@NodeInfo(nameTemplate = "Local({p#index})") -public final class LocalNode extends AbstractLocalNode implements IterableNodeType { - - public LocalNode(int index, Stamp stamp) { - super(index, stamp); - } -}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ParameterNode.java Mon Jan 13 13:45:25 2014 +0100 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.nodes; + +import com.oracle.graal.graph.*; +import com.oracle.graal.nodes.type.*; + +/** + * The {@code Parameter} instruction is a placeholder for an incoming argument to a function call. + */ +@NodeInfo(nameTemplate = "Local({p#index})") +public final class ParameterNode extends AbstractLocalNode implements IterableNodeType { + + public ParameterNode(int index, Stamp stamp) { + super(index, stamp); + } +}
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Mon Jan 13 13:45:25 2014 +0100 @@ -189,10 +189,10 @@ return copy(newName, method); } - public LocalNode getLocal(int index) { - for (LocalNode local : getNodes(LocalNode.class)) { - if (local.index() == index) { - return local; + public ParameterNode getParameter(int index) { + for (ParameterNode param : getNodes(ParameterNode.class)) { + if (param.index() == index) { + return param; } } return null;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java Mon Jan 13 13:45:25 2014 +0100 @@ -46,8 +46,8 @@ private ReadNode(ValueNode object, ValueNode location, ValueNode guard, BarrierType barrierType, boolean compressible) { /* * Used by node intrinsics. Really, you can trust me on that! Since the initial value for - * location is a parameter, i.e., a LocalNode, the constructor cannot use the declared type - * LocationNode. + * location is a parameter, i.e., a ParameterNode, the constructor cannot use the declared + * type LocationNode. */ super(object, location, StampFactory.forNodeIntrinsic(), (GuardingNode) guard, barrierType, compressible); }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java Mon Jan 13 13:45:25 2014 +0100 @@ -249,16 +249,16 @@ boolean callerHasMoreInformationAboutArguments = false; NodeInputList<ValueNode> args = invoke.callTarget().arguments(); - for (LocalNode localNode : newGraph.getNodes(LocalNode.class).snapshot()) { - ValueNode arg = args.get(localNode.index()); + for (ParameterNode param : newGraph.getNodes(ParameterNode.class).snapshot()) { + ValueNode arg = args.get(param.index()); if (arg.isConstant()) { Constant constant = arg.asConstant(); - newGraph.replaceFloating(localNode, ConstantNode.forConstant(constant, context.getMetaAccess(), newGraph)); + newGraph.replaceFloating(param, ConstantNode.forConstant(constant, context.getMetaAccess(), newGraph)); callerHasMoreInformationAboutArguments = true; } else { - Stamp joinedStamp = localNode.stamp().join(arg.stamp()); - if (joinedStamp != null && !joinedStamp.equals(localNode.stamp())) { - localNode.setStamp(joinedStamp); + Stamp joinedStamp = param.stamp().join(arg.stamp()); + if (joinedStamp != null && !joinedStamp.equals(param.stamp())) { + param.setStamp(joinedStamp); callerHasMoreInformationAboutArguments = true; } }
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Mon Jan 13 13:45:25 2014 +0100 @@ -1051,7 +1051,7 @@ } if (receiverStamp.type() != null) { // the invoke target might be more specific than the holder (happens after inlining: - // locals lose their declared type...) + // parameters lose their declared type...) ResolvedJavaType receiverType = receiverStamp.type(); if (receiverType != null && holder.isAssignableFrom(receiverType)) { holder = receiverType; @@ -1313,7 +1313,7 @@ throw new IllegalStateException("Inlined graph is in invalid state"); } for (Node node : inlineGraph.getNodes()) { - if (node == entryPointNode || node == entryPointNode.stateAfter() || node instanceof LocalNode) { + if (node == entryPointNode || node == entryPointNode.stateAfter() || node instanceof ParameterNode) { // Do nothing. } else { nodes.add(node); @@ -1331,8 +1331,8 @@ DuplicationReplacement localReplacement = new DuplicationReplacement() { public Node replacement(Node node) { - if (node instanceof LocalNode) { - return parameters.get(((LocalNode) node).index()); + if (node instanceof ParameterNode) { + return parameters.get(((ParameterNode) node).index()); } else if (node == entryPointNode) { return prevBegin; } @@ -1432,7 +1432,7 @@ } Node returnValue = null; if (returnNode != null) { - if (returnNode.result() instanceof LocalNode) { + if (returnNode.result() instanceof ParameterNode) { returnValue = localReplacement.replacement(returnNode.result()); } else if (returnNode.result() != null) { returnValue = duplicates.get(returnNode.result());
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java Mon Jan 13 13:45:25 2014 +0100 @@ -135,7 +135,7 @@ if (block != null) { printProperty("block", Integer.toString(block.getId())); // if (!(node instanceof PhiNode || node instanceof FrameState || node instanceof - // LocalNode) && !block.nodes().contains(node)) { + // ParameterNode) && !block.nodes().contains(node)) { // printProperty("notInOwnBlock", "true"); // } } else { @@ -256,7 +256,7 @@ // if this is the first block: add all locals to this block if (block.getBeginNode() == ((StructuredGraph) graph).start()) { for (Node node : graph.getNodes()) { - if (node instanceof LocalNode) { + if (node instanceof ParameterNode) { nodes.add(node); } }
--- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -102,7 +102,7 @@ private static void assertRead(StructuredGraph graph, Kind kind, boolean indexConvert, LocationIdentity locationIdentity) { ReadNode read = (ReadNode) graph.start().next(); Assert.assertEquals(kind.getStackKind(), read.kind()); - Assert.assertEquals(graph.getLocal(0), read.object()); + Assert.assertEquals(graph.getParameter(0), read.object()); IndexedLocationNode location = (IndexedLocationNode) read.location(); Assert.assertEquals(kind, location.getValueKind()); @@ -113,9 +113,9 @@ ConvertNode convert = (ConvertNode) location.getIndex(); Assert.assertEquals(Kind.Int, convert.getFromKind()); Assert.assertEquals(Kind.Long, convert.getToKind()); - Assert.assertEquals(graph.getLocal(1), convert.value()); + Assert.assertEquals(graph.getParameter(1), convert.value()); } else { - Assert.assertEquals(graph.getLocal(1), location.getIndex()); + Assert.assertEquals(graph.getParameter(1), location.getIndex()); } ReturnNode ret = (ReturnNode) read.next(); @@ -124,8 +124,8 @@ private static void assertWrite(StructuredGraph graph, Kind kind, boolean indexConvert, LocationIdentity locationIdentity) { WriteNode write = (WriteNode) graph.start().next(); - Assert.assertEquals(graph.getLocal(2), write.value()); - Assert.assertEquals(graph.getLocal(0), write.object()); + Assert.assertEquals(graph.getParameter(2), write.value()); + Assert.assertEquals(graph.getParameter(0), write.object()); Assert.assertEquals(Kind.Void, write.kind()); Assert.assertEquals(FrameState.AFTER_BCI, write.stateAfter().bci); @@ -138,9 +138,9 @@ ConvertNode convert = (ConvertNode) location.getIndex(); Assert.assertEquals(Kind.Int, convert.getFromKind()); Assert.assertEquals(Kind.Long, convert.getToKind()); - Assert.assertEquals(graph.getLocal(1), convert.value()); + Assert.assertEquals(graph.getParameter(1), convert.value()); } else { - Assert.assertEquals(graph.getLocal(1), location.getIndex()); + Assert.assertEquals(graph.getParameter(1), location.getIndex()); } ReturnNode ret = (ReturnNode) write.next();
--- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -112,7 +112,7 @@ Assert.assertEquals(kind.getStackKind(), read.kind()); Assert.assertEquals(cast, read.object()); - Assert.assertEquals(graph.getLocal(0), cast.getInput()); + Assert.assertEquals(graph.getParameter(0), cast.getInput()); Assert.assertEquals(target.wordKind, cast.kind()); IndexedLocationNode location = (IndexedLocationNode) read.location(); @@ -124,9 +124,9 @@ ConvertNode convert = (ConvertNode) location.getIndex(); Assert.assertEquals(Kind.Int, convert.getFromKind()); Assert.assertEquals(Kind.Long, convert.getToKind()); - Assert.assertEquals(graph.getLocal(1), convert.value()); + Assert.assertEquals(graph.getParameter(1), convert.value()); } else { - Assert.assertEquals(graph.getLocal(1), location.getIndex()); + Assert.assertEquals(graph.getParameter(1), location.getIndex()); } ReturnNode ret = (ReturnNode) read.next(); @@ -137,12 +137,12 @@ WordCastNode cast = (WordCastNode) graph.start().next(); WriteNode write = (WriteNode) cast.next(); - Assert.assertEquals(graph.getLocal(2), write.value()); + Assert.assertEquals(graph.getParameter(2), write.value()); Assert.assertEquals(Kind.Void, write.kind()); Assert.assertEquals(FrameState.AFTER_BCI, write.stateAfter().bci); Assert.assertEquals(cast, write.object()); - Assert.assertEquals(graph.getLocal(0), cast.getInput()); + Assert.assertEquals(graph.getParameter(0), cast.getInput()); Assert.assertEquals(target.wordKind, cast.kind()); IndexedLocationNode location = (IndexedLocationNode) write.location(); @@ -154,9 +154,9 @@ ConvertNode convert = (ConvertNode) location.getIndex(); Assert.assertEquals(Kind.Int, convert.getFromKind()); Assert.assertEquals(Kind.Long, convert.getToKind()); - Assert.assertEquals(graph.getLocal(1), convert.value()); + Assert.assertEquals(graph.getParameter(1), convert.value()); } else { - Assert.assertEquals(graph.getLocal(1), location.getIndex()); + Assert.assertEquals(graph.getParameter(1), location.getIndex()); } ReturnNode ret = (ReturnNode) write.next();
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Mon Jan 13 13:45:25 2014 +0100 @@ -500,11 +500,11 @@ } else { constantArg = Constant.forBoxed(kind, arg); } - nodeReplacements.put(snippetGraph.getLocal(i), ConstantNode.forConstant(constantArg, metaAccess, snippetCopy)); + nodeReplacements.put(snippetGraph.getParameter(i), ConstantNode.forConstant(constantArg, metaAccess, snippetCopy)); } else if (args.info.isVarargsParameter(i)) { Varargs varargs = (Varargs) args.values[i]; VarargsPlaceholderNode placeholder = snippetCopy.unique(new VarargsPlaceholderNode(varargs, providers.getMetaAccess())); - nodeReplacements.put(snippetGraph.getLocal(i), placeholder); + nodeReplacements.put(snippetGraph.getParameter(i), placeholder); placeholders[i] = placeholder; } } @@ -521,18 +521,18 @@ if (args.info.isConstantParameter(i)) { parameters[i] = CONSTANT_PARAMETER; } else if (args.info.isVarargsParameter(i)) { - assert snippetCopy.getLocal(i) == null; + assert snippetCopy.getParameter(i) == null; Varargs varargs = (Varargs) args.values[i]; int length = varargs.length; - LocalNode[] locals = new LocalNode[length]; + ParameterNode[] params = new ParameterNode[length]; Stamp stamp = varargs.stamp; for (int j = 0; j < length; j++) { assert (parameterCount & 0xFFFF) == parameterCount; int idx = i << 16 | j; - LocalNode local = snippetCopy.unique(new LocalNode(idx, stamp)); - locals[j] = local; + ParameterNode local = snippetCopy.unique(new ParameterNode(idx, stamp)); + params[j] = local; } - parameters[i] = locals; + parameters[i] = params; VarargsPlaceholderNode placeholder = placeholders[i]; assert placeholder != null; @@ -540,13 +540,13 @@ if (usage instanceof LoadIndexedNode) { LoadIndexedNode loadIndexed = (LoadIndexedNode) usage; Debug.dump(snippetCopy, "Before replacing %s", loadIndexed); - LoadSnippetVarargParameterNode loadSnippetParameter = snippetCopy.add(new LoadSnippetVarargParameterNode(locals, loadIndexed.index(), loadIndexed.stamp())); + LoadSnippetVarargParameterNode loadSnippetParameter = snippetCopy.add(new LoadSnippetVarargParameterNode(params, loadIndexed.index(), loadIndexed.stamp())); snippetCopy.replaceFixedWithFixed(loadIndexed, loadSnippetParameter); Debug.dump(snippetCopy, "After replacing %s", loadIndexed); } } } else { - LocalNode local = snippetCopy.getLocal(i); + ParameterNode local = snippetCopy.getParameter(i); if (local == null) { // Parameter value was eliminated parameters[i] = UNUSED_PARAMETER; @@ -702,7 +702,7 @@ /** * The named parameters of this template that must be bound to values during instantiation. For * a parameter that is still live after specialization, the value in this map is either a - * {@link LocalNode} instance or a {@link LocalNode} array. For an eliminated parameter, the + * {@link ParameterNode} instance or a {@link ParameterNode} array. For an eliminated parameter, the * value is identical to the key. */ private final Object[] parameters; @@ -765,19 +765,19 @@ Object parameter = parameters[i]; assert parameter != null : this + " has no parameter named " + args.info.names[i]; Object argument = args.values[i]; - if (parameter instanceof LocalNode) { + if (parameter instanceof ParameterNode) { if (argument instanceof ValueNode) { - replacements.put((LocalNode) parameter, (ValueNode) argument); + replacements.put((ParameterNode) parameter, (ValueNode) argument); } else { - Kind kind = ((LocalNode) parameter).kind(); + Kind kind = ((ParameterNode) parameter).kind(); assert argument != null || kind == Kind.Object : this + " cannot accept null for non-object parameter named " + args.info.names[i]; Constant constant = forBoxed(argument, kind); - replacements.put((LocalNode) parameter, ConstantNode.forConstant(constant, metaAccess, replaceeGraph)); + replacements.put((ParameterNode) parameter, ConstantNode.forConstant(constant, metaAccess, replaceeGraph)); } - } else if (parameter instanceof LocalNode[]) { - LocalNode[] locals = (LocalNode[]) parameter; + } else if (parameter instanceof ParameterNode[]) { + ParameterNode[] params = (ParameterNode[]) parameter; Varargs varargs = (Varargs) argument; - int length = locals.length; + int length = params.length; List list = null; Object array = null; if (varargs.value instanceof List) { @@ -790,15 +790,15 @@ } for (int j = 0; j < length; j++) { - LocalNode local = locals[j]; - assert local != null; + ParameterNode param = params[j]; + assert param != null; Object value = list != null ? list.get(j) : Array.get(array, j); if (value instanceof ValueNode) { - replacements.put(local, (ValueNode) value); + replacements.put(param, (ValueNode) value); } else { - Constant constant = forBoxed(value, local.kind()); + Constant constant = forBoxed(value, param.kind()); ConstantNode element = ConstantNode.forConstant(constant, metaAccess, replaceeGraph); - replacements.put(local, element); + replacements.put(param, element); } } } else { @@ -1022,7 +1022,7 @@ // Replace all usages of the replacee with the value returned by the snippet ValueNode returnValue = null; if (returnNode != null && !(replacee instanceof ControlSinkNode)) { - if (returnNode.result() instanceof LocalNode) { + if (returnNode.result() instanceof ParameterNode) { returnValue = (ValueNode) replacements.get(returnNode.result()); } else if (returnNode.result() != null) { returnValue = (ValueNode) duplicates.get(returnNode.result()); @@ -1105,7 +1105,7 @@ // Replace all usages of the replacee with the value returned by the snippet assert returnNode != null : replaceeGraph; ValueNode returnValue = null; - if (returnNode.result() instanceof LocalNode) { + if (returnNode.result() instanceof ParameterNode) { returnValue = (ValueNode) replacements.get(returnNode.result()); } else { returnValue = (ValueNode) duplicates.get(returnNode.result()); @@ -1138,13 +1138,13 @@ buf.append("<unused> ").append(name); } else if (value == CONSTANT_PARAMETER) { buf.append("<constant> ").append(name); - } else if (value instanceof LocalNode) { - LocalNode local = (LocalNode) value; - buf.append(local.kind().getJavaName()).append(' ').append(name); + } else if (value instanceof ParameterNode) { + ParameterNode param = (ParameterNode) value; + buf.append(param.kind().getJavaName()).append(' ').append(name); } else { - LocalNode[] locals = (LocalNode[]) value; - String kind = locals.length == 0 ? "?" : locals[0].kind().getJavaName(); - buf.append(kind).append('[').append(locals.length).append("] ").append(name); + ParameterNode[] parameters = (ParameterNode[]) value; + String kind = parameters.length == 0 ? "?" : parameters[0].kind().getJavaName(); + buf.append(kind).append('[').append(parameters.length).append("] ").append(name); } } return buf.append(')').toString();
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/LoadSnippetVarargParameterNode.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/LoadSnippetVarargParameterNode.java Mon Jan 13 13:45:25 2014 +0100 @@ -35,18 +35,18 @@ @Input private ValueNode index; - private final LocalNode[] locals; + private final ParameterNode[] parameters; - public LoadSnippetVarargParameterNode(LocalNode[] locals, ValueNode index, Stamp stamp) { + public LoadSnippetVarargParameterNode(ParameterNode[] locals, ValueNode index, Stamp stamp) { super(stamp); this.index = index; - this.locals = locals; + this.parameters = locals; } @Override public Node canonical(CanonicalizerTool tool) { if (index.isConstant()) { - return locals[index.asConstant().asInt()]; + return parameters[index.asConstant().asInt()]; } return this; }
--- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java Mon Jan 13 13:45:25 2014 +0100 @@ -169,7 +169,7 @@ canonicalizer.apply(graph, context); // Additional inlining. - PhaseSuite<HighTierContext> graphBuilderSuite = getEagerGraphBuilderSuite(); + PhaseSuite<HighTierContext> graphBuilderSuite = getCustomGraphBuilderSuite(GraphBuilderConfiguration.getEagerInfopointDefault()); graphBuilderSuite.appendPhase(canonicalizer); graphBuilderSuite.appendPhase(new DeadCodeEliminationPhase());
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Mon Jan 13 13:45:25 2014 +0100 @@ -107,7 +107,7 @@ new GraphBuilderPhase.Instance(providers.getMetaAccess(), config, TruffleCompilerImpl.Optimizations).apply(graph); // Replace thisNode with constant. - LocalNode thisNode = graph.getLocal(0); + ParameterNode thisNode = graph.getParameter(0); thisNode.replaceAndDelete(ConstantNode.forObject(callTarget, providers.getMetaAccess(), graph)); // Canonicalize / constant propagate. @@ -247,16 +247,16 @@ assert graph.hasLoops(); final StructuredGraph graphCopy = graph.copy(); final List<Node> modifiedNodes = new ArrayList<>(); - for (LocalNode local : graphCopy.getNodes(LocalNode.class)) { - ValueNode arg = arguments.get(local.index()); + for (ParameterNode param : graphCopy.getNodes(ParameterNode.class)) { + ValueNode arg = arguments.get(param.index()); if (arg.isConstant()) { Constant constant = arg.asConstant(); - for (Node usage : local.usages()) { + for (Node usage : param.usages()) { if (usage instanceof Canonicalizable) { modifiedNodes.add(usage); } } - local.replaceAndDelete(ConstantNode.forConstant(constant, phaseContext.getMetaAccess(), graphCopy)); + param.replaceAndDelete(ConstantNode.forConstant(constant, phaseContext.getMetaAccess(), graphCopy)); } } try (Scope s = Debug.scope("TruffleUnrollLoop", targetMethod)) {
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java Mon Jan 13 12:21:25 2014 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java Mon Jan 13 13:45:25 2014 +0100 @@ -98,10 +98,10 @@ Mark mark = graph.getMark(); new GraphBuilderPhase.Instance(phaseContext.getMetaAccess(), config, optimisticOptimizations).apply(graph); - for (LocalNode l : graph.getNodes(LocalNode.class)) { - if (l.kind() == Kind.Object) { - ValueNode actualArgument = arguments.get(l.index()); - l.setStamp(l.stamp().join(actualArgument.stamp())); + for (ParameterNode param : graph.getNodes(ParameterNode.class)) { + if (param.kind() == Kind.Object) { + ValueNode actualArgument = arguments.get(param.index()); + param.setStamp(param.stamp().join(actualArgument.stamp())); } }