diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/RRootNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/RRootNode.java index eb785b3c7cc1cda98117c71df3e407934d3390c2..78ecc50564b951552f85f89a4cb7e80022676f93 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/RRootNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/RRootNode.java @@ -27,7 +27,6 @@ import com.oracle.truffle.api.frame.FrameDescriptor; import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.nodes.RootNode; import com.oracle.truffle.api.profiles.ConditionProfile; -import com.oracle.truffle.api.source.SourceSection; import com.oracle.truffle.r.nodes.builtin.RBuiltinFactory; import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; import com.oracle.truffle.r.nodes.function.FormalArguments; @@ -54,20 +53,12 @@ public abstract class RRootNode extends RootNode implements HasSignature { private FastPathFactory fastPath; - protected RRootNode(SourceSection src, FormalArguments formalArguments, FrameDescriptor frameDescriptor, FastPathFactory fastPath) { - super(RContext.getRForeignAccessFactory().getTruffleLanguage(), checkSourceSection(src), frameDescriptor); + protected RRootNode(FormalArguments formalArguments, FrameDescriptor frameDescriptor, FastPathFactory fastPath) { + super(RContext.getRForeignAccessFactory().getTruffleLanguage(), RSyntaxNode.SOURCE_UNAVAILABLE, frameDescriptor); this.formalArguments = formalArguments; this.fastPath = fastPath; } - private static SourceSection checkSourceSection(SourceSection src) { - if (src == null) { - return RSyntaxNode.SOURCE_UNAVAILABLE; - } else { - return src; - } - } - @Override public abstract RootCallTarget duplicateWithNewFrameDescriptor(); diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/RBuiltinRootNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/RBuiltinRootNode.java index ea86da6f090ada1bea4c02162a1939ddb0e4f6df..1754b1a1f97c8ad86f5a963c4738aad8ad3e1b88 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/RBuiltinRootNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/builtin/RBuiltinRootNode.java @@ -48,7 +48,7 @@ public final class RBuiltinRootNode extends RRootNode { private final RBuiltinFactory factory; RBuiltinRootNode(RBuiltinFactory factory, RBuiltinNode builtin, FormalArguments formalArguments, FrameDescriptor frameDescriptor, FastPathFactory fastPath) { - super(null, formalArguments, frameDescriptor, fastPath); + super(formalArguments, frameDescriptor, fastPath); this.factory = factory; this.builtin = builtin; this.args = new AccessArgumentNode[factory.getSignature().getLength()]; diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java index 4a2c89ad48a62fc5debd7c6be8f4bb3ca2864f8e..8247417f035608529a03993e5656facfa4de863c 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionDefinitionNode.java @@ -135,7 +135,7 @@ public final class FunctionDefinitionNode extends RRootNode implements RSyntaxNo private FunctionDefinitionNode(SourceSection src, FrameDescriptor frameDesc, SourceSection[] argSourceSections, RNode saveArguments, RSyntaxNode body, FormalArguments formals, String name, PostProcessArgumentsNode argPostProcess) { - super(null, formals, frameDesc, RASTBuilder.createFunctionFastPath(body, formals.getSignature())); + super(formals, frameDesc, RASTBuilder.createFunctionFastPath(body, formals.getSignature())); this.argSourceSections = argSourceSections; assert FrameSlotChangeMonitor.isValidFrameDescriptor(frameDesc); assert src != null; diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java index d202fe1015cfe2a332ff77da078972284f3fecf1..f8222d3cc3dc0ea5cc1d140ec3cf8273a68ba5a0 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java @@ -112,23 +112,23 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS // currently cannot be RSourceSectionNode because of TruffleDSL restrictions - @CompilationFinal private SourceSection sourceSectionR; + @CompilationFinal private SourceSection sourceSection; @Override public final void setSourceSection(SourceSection sourceSection) { assert sourceSection != null; - this.sourceSectionR = sourceSection; + this.sourceSection = sourceSection; } @Override public final SourceSection getLazySourceSection() { - return sourceSectionR; + return sourceSection; } @Override public final SourceSection getSourceSection() { RDeparse.ensureSourceSection(this); - return sourceSectionR; + return sourceSection; } protected abstract ForcePromiseNode getFunction(); @@ -164,7 +164,7 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS protected RCallNode(SourceSection sourceSection, RSyntaxNode[] arguments, ArgumentsSignature signature) { assert sourceSection != null; - this.sourceSectionR = sourceSection; + this.sourceSection = sourceSection; this.arguments = arguments; this.explicitArgs = null; this.varArgIndexes = getVarArgIndexes(arguments); @@ -184,7 +184,7 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS protected RCallNode(SourceSection sourceSection, Object explicitArgsIdentifier) { assert sourceSection != null; - this.sourceSectionR = sourceSection; + this.sourceSection = sourceSection; this.arguments = null; this.explicitArgs = LocalReadVariableNode.create(explicitArgsIdentifier, false); this.varArgIndexes = null; diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallSpecialNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallSpecialNode.java index 9834af4dee1da8e4bd95dc84352c836dfcb0d40e..1a81c60bc464b40869f22733cefd740ec0181f9b 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallSpecialNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallSpecialNode.java @@ -98,23 +98,23 @@ public final class RCallSpecialNode extends RCallBaseNode implements RSyntaxNode private static final boolean useSpecials = FastROptions.UseSpecials.getBooleanValue(); // currently cannot be RSourceSectionNode because of TruffleDSL restrictions - @CompilationFinal private SourceSection sourceSectionR; + @CompilationFinal private SourceSection sourceSection; @Override public void setSourceSection(SourceSection sourceSection) { assert sourceSection != null; - this.sourceSectionR = sourceSection; + this.sourceSection = sourceSection; } @Override public SourceSection getLazySourceSection() { - return sourceSectionR; + return sourceSection; } @Override public SourceSection getSourceSection() { RDeparse.ensureSourceSection(this); - return sourceSectionR; + return sourceSection; } @Child private ForcePromiseNode functionNode; @@ -136,7 +136,7 @@ public final class RCallSpecialNode extends RCallBaseNode implements RSyntaxNode private RCallSpecialNode callSpecialParent; private RCallSpecialNode(SourceSection sourceSection, RNode functionNode, RFunction expectedFunction, RSyntaxNode[] arguments, ArgumentsSignature signature, RNode special) { - this.sourceSectionR = sourceSection; + this.sourceSection = sourceSection; this.expectedFunction = expectedFunction; this.special = special; this.functionNode = new ForcePromiseNode(functionNode); @@ -272,7 +272,7 @@ public final class RCallSpecialNode extends RCallBaseNode implements RSyntaxNode } private RCallNode getRCallNode(RSyntaxNode[] newArguments) { - return RCallNode.createCall(sourceSectionR, functionNode == null ? null : functionNode.getValueNode(), signature, newArguments); + return RCallNode.createCall(sourceSection, functionNode == null ? null : functionNode.getValueNode(), signature, newArguments); } private RCallNode getRCallNode() {