Skip to content
Snippets Groups Projects
Commit 03f7f432 authored by Lukas Stadler's avatar Lukas Stadler
Browse files

rename sourceSectionR to sourceSection where appropriate

parent 02753a4d
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,6 @@ import com.oracle.truffle.api.frame.FrameDescriptor; ...@@ -27,7 +27,6 @@ import com.oracle.truffle.api.frame.FrameDescriptor;
import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.RootNode; import com.oracle.truffle.api.nodes.RootNode;
import com.oracle.truffle.api.profiles.ConditionProfile; 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.RBuiltinFactory;
import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; import com.oracle.truffle.r.nodes.builtin.RBuiltinNode;
import com.oracle.truffle.r.nodes.function.FormalArguments; import com.oracle.truffle.r.nodes.function.FormalArguments;
...@@ -54,20 +53,12 @@ public abstract class RRootNode extends RootNode implements HasSignature { ...@@ -54,20 +53,12 @@ public abstract class RRootNode extends RootNode implements HasSignature {
private FastPathFactory fastPath; private FastPathFactory fastPath;
protected RRootNode(SourceSection src, FormalArguments formalArguments, FrameDescriptor frameDescriptor, FastPathFactory fastPath) { protected RRootNode(FormalArguments formalArguments, FrameDescriptor frameDescriptor, FastPathFactory fastPath) {
super(RContext.getRForeignAccessFactory().getTruffleLanguage(), checkSourceSection(src), frameDescriptor); super(RContext.getRForeignAccessFactory().getTruffleLanguage(), RSyntaxNode.SOURCE_UNAVAILABLE, frameDescriptor);
this.formalArguments = formalArguments; this.formalArguments = formalArguments;
this.fastPath = fastPath; this.fastPath = fastPath;
} }
private static SourceSection checkSourceSection(SourceSection src) {
if (src == null) {
return RSyntaxNode.SOURCE_UNAVAILABLE;
} else {
return src;
}
}
@Override @Override
public abstract RootCallTarget duplicateWithNewFrameDescriptor(); public abstract RootCallTarget duplicateWithNewFrameDescriptor();
......
...@@ -48,7 +48,7 @@ public final class RBuiltinRootNode extends RRootNode { ...@@ -48,7 +48,7 @@ public final class RBuiltinRootNode extends RRootNode {
private final RBuiltinFactory factory; private final RBuiltinFactory factory;
RBuiltinRootNode(RBuiltinFactory factory, RBuiltinNode builtin, FormalArguments formalArguments, FrameDescriptor frameDescriptor, FastPathFactory fastPath) { RBuiltinRootNode(RBuiltinFactory factory, RBuiltinNode builtin, FormalArguments formalArguments, FrameDescriptor frameDescriptor, FastPathFactory fastPath) {
super(null, formalArguments, frameDescriptor, fastPath); super(formalArguments, frameDescriptor, fastPath);
this.factory = factory; this.factory = factory;
this.builtin = builtin; this.builtin = builtin;
this.args = new AccessArgumentNode[factory.getSignature().getLength()]; this.args = new AccessArgumentNode[factory.getSignature().getLength()];
......
...@@ -135,7 +135,7 @@ public final class FunctionDefinitionNode extends RRootNode implements RSyntaxNo ...@@ -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, private FunctionDefinitionNode(SourceSection src, FrameDescriptor frameDesc, SourceSection[] argSourceSections, RNode saveArguments, RSyntaxNode body, FormalArguments formals,
String name, PostProcessArgumentsNode argPostProcess) { String name, PostProcessArgumentsNode argPostProcess) {
super(null, formals, frameDesc, RASTBuilder.createFunctionFastPath(body, formals.getSignature())); super(formals, frameDesc, RASTBuilder.createFunctionFastPath(body, formals.getSignature()));
this.argSourceSections = argSourceSections; this.argSourceSections = argSourceSections;
assert FrameSlotChangeMonitor.isValidFrameDescriptor(frameDesc); assert FrameSlotChangeMonitor.isValidFrameDescriptor(frameDesc);
assert src != null; assert src != null;
......
...@@ -112,23 +112,23 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS ...@@ -112,23 +112,23 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS
// currently cannot be RSourceSectionNode because of TruffleDSL restrictions // currently cannot be RSourceSectionNode because of TruffleDSL restrictions
@CompilationFinal private SourceSection sourceSectionR; @CompilationFinal private SourceSection sourceSection;
@Override @Override
public final void setSourceSection(SourceSection sourceSection) { public final void setSourceSection(SourceSection sourceSection) {
assert sourceSection != null; assert sourceSection != null;
this.sourceSectionR = sourceSection; this.sourceSection = sourceSection;
} }
@Override @Override
public final SourceSection getLazySourceSection() { public final SourceSection getLazySourceSection() {
return sourceSectionR; return sourceSection;
} }
@Override @Override
public final SourceSection getSourceSection() { public final SourceSection getSourceSection() {
RDeparse.ensureSourceSection(this); RDeparse.ensureSourceSection(this);
return sourceSectionR; return sourceSection;
} }
protected abstract ForcePromiseNode getFunction(); protected abstract ForcePromiseNode getFunction();
...@@ -164,7 +164,7 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS ...@@ -164,7 +164,7 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS
protected RCallNode(SourceSection sourceSection, RSyntaxNode[] arguments, ArgumentsSignature signature) { protected RCallNode(SourceSection sourceSection, RSyntaxNode[] arguments, ArgumentsSignature signature) {
assert sourceSection != null; assert sourceSection != null;
this.sourceSectionR = sourceSection; this.sourceSection = sourceSection;
this.arguments = arguments; this.arguments = arguments;
this.explicitArgs = null; this.explicitArgs = null;
this.varArgIndexes = getVarArgIndexes(arguments); this.varArgIndexes = getVarArgIndexes(arguments);
...@@ -184,7 +184,7 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS ...@@ -184,7 +184,7 @@ public abstract class RCallNode extends RCallBaseNode implements RSyntaxNode, RS
protected RCallNode(SourceSection sourceSection, Object explicitArgsIdentifier) { protected RCallNode(SourceSection sourceSection, Object explicitArgsIdentifier) {
assert sourceSection != null; assert sourceSection != null;
this.sourceSectionR = sourceSection; this.sourceSection = sourceSection;
this.arguments = null; this.arguments = null;
this.explicitArgs = LocalReadVariableNode.create(explicitArgsIdentifier, false); this.explicitArgs = LocalReadVariableNode.create(explicitArgsIdentifier, false);
this.varArgIndexes = null; this.varArgIndexes = null;
......
...@@ -98,23 +98,23 @@ public final class RCallSpecialNode extends RCallBaseNode implements RSyntaxNode ...@@ -98,23 +98,23 @@ public final class RCallSpecialNode extends RCallBaseNode implements RSyntaxNode
private static final boolean useSpecials = FastROptions.UseSpecials.getBooleanValue(); private static final boolean useSpecials = FastROptions.UseSpecials.getBooleanValue();
// currently cannot be RSourceSectionNode because of TruffleDSL restrictions // currently cannot be RSourceSectionNode because of TruffleDSL restrictions
@CompilationFinal private SourceSection sourceSectionR; @CompilationFinal private SourceSection sourceSection;
@Override @Override
public void setSourceSection(SourceSection sourceSection) { public void setSourceSection(SourceSection sourceSection) {
assert sourceSection != null; assert sourceSection != null;
this.sourceSectionR = sourceSection; this.sourceSection = sourceSection;
} }
@Override @Override
public SourceSection getLazySourceSection() { public SourceSection getLazySourceSection() {
return sourceSectionR; return sourceSection;
} }
@Override @Override
public SourceSection getSourceSection() { public SourceSection getSourceSection() {
RDeparse.ensureSourceSection(this); RDeparse.ensureSourceSection(this);
return sourceSectionR; return sourceSection;
} }
@Child private ForcePromiseNode functionNode; @Child private ForcePromiseNode functionNode;
...@@ -136,7 +136,7 @@ public final class RCallSpecialNode extends RCallBaseNode implements RSyntaxNode ...@@ -136,7 +136,7 @@ public final class RCallSpecialNode extends RCallBaseNode implements RSyntaxNode
private RCallSpecialNode callSpecialParent; private RCallSpecialNode callSpecialParent;
private RCallSpecialNode(SourceSection sourceSection, RNode functionNode, RFunction expectedFunction, RSyntaxNode[] arguments, ArgumentsSignature signature, RNode special) { private RCallSpecialNode(SourceSection sourceSection, RNode functionNode, RFunction expectedFunction, RSyntaxNode[] arguments, ArgumentsSignature signature, RNode special) {
this.sourceSectionR = sourceSection; this.sourceSection = sourceSection;
this.expectedFunction = expectedFunction; this.expectedFunction = expectedFunction;
this.special = special; this.special = special;
this.functionNode = new ForcePromiseNode(functionNode); this.functionNode = new ForcePromiseNode(functionNode);
...@@ -272,7 +272,7 @@ public final class RCallSpecialNode extends RCallBaseNode implements RSyntaxNode ...@@ -272,7 +272,7 @@ public final class RCallSpecialNode extends RCallBaseNode implements RSyntaxNode
} }
private RCallNode getRCallNode(RSyntaxNode[] newArguments) { 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() { private RCallNode getRCallNode() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment