From 03f7f432b15df9b5d12ef115ca717e2c2615a99a Mon Sep 17 00:00:00 2001 From: Lukas Stadler <lukas.stadler@oracle.com> Date: Wed, 21 Dec 2016 15:44:06 +0100 Subject: [PATCH] rename sourceSectionR to sourceSection where appropriate --- .../src/com/oracle/truffle/r/nodes/RRootNode.java | 13 ++----------- .../truffle/r/nodes/builtin/RBuiltinRootNode.java | 2 +- .../r/nodes/function/FunctionDefinitionNode.java | 2 +- .../oracle/truffle/r/nodes/function/RCallNode.java | 12 ++++++------ .../truffle/r/nodes/function/RCallSpecialNode.java | 12 ++++++------ 5 files changed, 16 insertions(+), 25 deletions(-) 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 eb785b3c7c..78ecc50564 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 ea86da6f09..1754b1a1f9 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 4a2c89ad48..8247417f03 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 d202fe1015..f8222d3cc3 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 9834af4dee..1a81c60bc4 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() { -- GitLab