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

add node costs to uninitialized and unresolved nodes

parent 8490a119
No related branches found
No related tags found
No related merge requests found
Showing
with 22 additions and 8 deletions
......@@ -15,6 +15,7 @@ import static com.oracle.truffle.r.runtime.RBuiltinKind.*;
import com.oracle.truffle.api.*;
import com.oracle.truffle.api.dsl.*;
import com.oracle.truffle.api.frame.*;
import com.oracle.truffle.api.nodes.*;
import com.oracle.truffle.r.nodes.*;
import com.oracle.truffle.r.nodes.access.*;
import com.oracle.truffle.r.nodes.builtin.*;
......@@ -87,6 +88,7 @@ public abstract class UseMethod extends RBuiltinNode {
}
}
@NodeInfo(cost = NodeCost.UNINITIALIZED)
private static final class UninitializedUseMethodNode extends UseMethodNode {
protected final int depth;
......
......@@ -45,6 +45,7 @@ public abstract class CallInlineCacheNode extends Node {
return new UninitializedCallInlineCacheNode(maxPicDepth);
}
@NodeInfo(cost = NodeCost.UNINITIALIZED)
private static final class UninitializedCallInlineCacheNode extends CallInlineCacheNode {
private final int maxPicDepth;
......
......@@ -74,6 +74,7 @@ public abstract class InlineCacheNode<F extends Frame, T> extends Node {
return create(maxPicDepth, closure -> (RNode) closure.getExpr(), (frame, closure) -> RContext.getEngine().evalPromise(closure, frame.materialize()));
}
@NodeInfo(cost = NodeCost.UNINITIALIZED)
private static final class UninitializedInlineCacheNode<F extends Frame, T> extends InlineCacheNode<F, T> {
private final int maxPicDepth;
......
......@@ -67,6 +67,7 @@ public abstract class FrameSlotNode extends Node {
return new PresentFrameSlotNode(slot);
}
@NodeInfo(cost = NodeCost.UNINITIALIZED)
private static final class UnresolvedFrameSlotNode extends FrameSlotNode {
private final Object identifier;
......
......@@ -278,6 +278,7 @@ public abstract class ReadVariableNode extends RNode implements VisibilityContro
RType getMode();
}
@NodeInfo(cost = NodeCost.UNINITIALIZED)
public static final class UnresolvedReadVariableNode extends ReadVariableNode implements HasMode {
// TODO It seems a refactoring would be appropriate to encapsulate all fields (symbol, mode,
......@@ -460,6 +461,7 @@ public abstract class ReadVariableNode extends RNode implements VisibilityContro
}
}
@NodeInfo(cost = NodeCost.UNINITIALIZED)
public static final class UnResolvedReadLocalVariableNode extends ReadVariableNode implements HasMode {
private final Symbol symbol;
private final RType mode;
......
......@@ -25,6 +25,7 @@ package com.oracle.truffle.r.nodes.access;
import com.oracle.truffle.api.*;
import com.oracle.truffle.api.dsl.*;
import com.oracle.truffle.api.frame.*;
import com.oracle.truffle.api.nodes.*;
import com.oracle.truffle.api.source.*;
import com.oracle.truffle.api.utilities.*;
import com.oracle.truffle.r.nodes.*;
......@@ -152,6 +153,7 @@ public abstract class WriteVariableNode extends RNode implements VisibilityContr
public abstract void execute(VirtualFrame frame, Object value);
@NodeInfo(cost = NodeCost.UNINITIALIZED)
@NodeFields({@NodeField(name = "name", type = String.class), @NodeField(name = "mode", type = Mode.class)})
public abstract static class UnresolvedWriteLocalVariableNode extends WriteVariableNode {
......
......@@ -13,6 +13,7 @@ package com.oracle.truffle.r.nodes.function;
import com.oracle.truffle.api.*;
import com.oracle.truffle.api.frame.*;
import com.oracle.truffle.api.nodes.*;
import com.oracle.truffle.api.source.*;
import com.oracle.truffle.r.nodes.*;
import com.oracle.truffle.r.runtime.*;
......@@ -49,6 +50,7 @@ public abstract class DispatchedCallNode extends RNode {
public abstract Object executeInternal(VirtualFrame frame, RStringVector type, Object[] args);
@NodeInfo(cost = NodeCost.UNINITIALIZED)
private static final class UninitializedDispatchedCallNode extends DispatchedCallNode {
private final int depth;
private final String genericName;
......
......@@ -24,6 +24,7 @@ package com.oracle.truffle.r.nodes.function;
import com.oracle.truffle.api.*;
import com.oracle.truffle.api.frame.*;
import com.oracle.truffle.api.nodes.*;
import com.oracle.truffle.r.nodes.*;
import com.oracle.truffle.r.nodes.access.*;
......@@ -37,6 +38,7 @@ public abstract class GetMissingValueNode extends RNode {
return new UninitializedGetMissingValueNode(sym);
}
@NodeInfo(cost = NodeCost.UNINITIALIZED)
private static final class UninitializedGetMissingValueNode extends GetMissingValueNode {
private final Symbol sym;
......@@ -49,8 +51,7 @@ public abstract class GetMissingValueNode extends RNode {
public Object execute(VirtualFrame frame) {
CompilerDirectives.transferToInterpreterAndInvalidate();
FrameSlot slot = frame.getFrameDescriptor().findFrameSlot(sym.getName());
GetMissingValueNode gmvn = new ResolvedGetMissingValueNode(slot);
return replace(gmvn).execute(frame);
return replace(new ResolvedGetMissingValueNode(slot)).execute(frame);
}
}
......
......@@ -74,13 +74,13 @@ import com.oracle.truffle.r.runtime.data.*;
* U = {@link UninitializedCallNode}: Forms the uninitialized end of the function PIC
* D = {@link DispatchedCallNode}: Function fixed, no varargs
* G = {@link GenericCallNode}: Function arbitrary, no varargs (generic case)
*
*
* UV = {@link UninitializedCallNode} with varargs,
* UVC = {@link UninitializedVarArgsCacheCallNode} with varargs, for varargs cache
* DV = {@link DispatchedVarArgsCallNode}: Function fixed, with cached varargs
* DGV = {@link DispatchedGenericVarArgsCallNode}: Function fixed, with arbitrary varargs (generic case)
* GV = {@link GenericVarArgsCallNode}: Function arbitrary, with arbitrary varargs (generic case)
*
*
* (RB = {@link RBuiltinNode}: individual functions that are builtins are represented by this node
* which is not aware of caching). Due to {@link CachedCallNode} (see below) this is transparent to
* the cache and just behaves like a D/DGV)
......@@ -93,11 +93,11 @@ import com.oracle.truffle.r.runtime.data.*;
* non varargs, max depth:
* |
* D-D-D-U
*
*
* no varargs, generic (if max depth is exceeded):
* |
* D-D-D-D-G
*
*
* varargs:
* |
* DV-DV-UV <- function call target identity level cache
......@@ -105,7 +105,7 @@ import com.oracle.truffle.r.runtime.data.*;
* DV
* |
* UVC <- varargs signature level cache
*
*
* varargs, max varargs depth exceeded:
* |
* DV-DV-UV
......@@ -117,7 +117,7 @@ import com.oracle.truffle.r.runtime.data.*;
* DV
* |
* DGV
*
*
* varargs, max function depth exceeded:
* |
* DV-DV-DV-DV-GV
......@@ -374,6 +374,7 @@ public abstract class RCallNode extends RNode {
*
* @see RCallNode
*/
@NodeInfo(cost = NodeCost.UNINITIALIZED)
public static final class UninitializedCallNode extends RootCallNode {
private final int depth;
......@@ -544,6 +545,7 @@ public abstract class RCallNode extends RNode {
*
* @see RCallNode
*/
@NodeInfo(cost = NodeCost.UNINITIALIZED)
public static final class UninitializedVarArgsCacheCallNode extends VarArgsCacheCallNode {
@Child private CallArgumentsNode args;
private int depth = 1; // varargs cached is started with a [DV] DispatchedVarArgsCallNode
......
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