# HG changeset patch # User Christian Humer # Date 1386606650 -3600 # Node ID 06afa0db90b3ee6d6319e41a32f7f7e937ab88e5 # Parent bd5c996b5d25eb3b09dabfd8825c5a8c124ccddd SL: removed unneccessary field in InlinableCallNode (reported by Stefan Marr) diff -r bd5c996b5d25 -r 06afa0db90b3 graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLNodeFactory.java --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLNodeFactory.java Thu Dec 05 13:39:08 2013 +0100 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLNodeFactory.java Mon Dec 09 17:30:50 2013 +0100 @@ -59,10 +59,6 @@ this.parser = parser; } - public CallTarget findFunction(String name) { - return context.getFunctionRegistry().lookup(name); - } - public void startFunction() { frameDescriptor = new FrameDescriptor(); } diff -r bd5c996b5d25 -r 06afa0db90b3 graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/CallNode.java --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/CallNode.java Thu Dec 05 13:39:08 2013 +0100 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/CallNode.java Mon Dec 09 17:30:50 2013 +0100 @@ -140,22 +140,21 @@ } return new InlinableCallNode((DefaultCallTarget) function, clonedArgs); } + // got a call target that is not inlinable (should not occur for SL) + return new DispatchedCallNode(defaultFunction, clonedArgs); + } else { + throw new AssertionError(); } - // got a call target that is not inlinable (should not occur for SL) - return new DispatchedCallNode(function, clonedArgs); } } private static final class InlinableCallNode extends DispatchedCallNode implements InlinableCallSite { - private final DefaultCallTarget inlinableTarget; - @CompilationFinal private int callCount; InlinableCallNode(DefaultCallTarget function, ArgumentsNode arguments) { super(function, arguments); - this.inlinableTarget = function; } @Override @@ -170,7 +169,7 @@ @Override public Node getInlineTree() { - RootNode root = inlinableTarget.getRootNode(); + RootNode root = function.getRootNode(); if (root instanceof FunctionRootNode) { return ((FunctionRootNode) root).getUninitializedBody(); } @@ -182,7 +181,7 @@ CompilerAsserts.neverPartOfCompilation(); TypedNode functionCall = null; - RootNode root = inlinableTarget.getRootNode(); + RootNode root = function.getRootNode(); if (root instanceof FunctionRootNode) { functionCall = ((FunctionRootNode) root).inline(NodeUtil.cloneNode(args)); } @@ -204,7 +203,7 @@ @Override public CallTarget getCallTarget() { - return inlinableTarget; + return function; } } @@ -212,9 +211,9 @@ private static class DispatchedCallNode extends TypedNode { @Child protected ArgumentsNode args; - protected final CallTarget function; + protected final DefaultCallTarget function; - DispatchedCallNode(CallTarget function, ArgumentsNode arguments) { + DispatchedCallNode(DefaultCallTarget function, ArgumentsNode arguments) { this.args = adoptChild(arguments); this.function = function; }