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

error profile in RCallNode

parent 06e61786
No related branches found
No related tags found
No related merge requests found
......@@ -79,13 +79,13 @@ import com.oracle.truffle.r.runtime.env.*;
* 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)
......@@ -98,11 +98,11 @@ import com.oracle.truffle.r.runtime.env.*;
* 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
......@@ -110,7 +110,7 @@ import com.oracle.truffle.r.runtime.env.*;
* DV
* |
* UVC <- varargs signature level cache
*
*
* varargs, max varargs depth exceeded:
* |
* DV-DV-UV
......@@ -122,7 +122,7 @@ import com.oracle.truffle.r.runtime.env.*;
* DV
* |
* DGV
*
*
* varargs, max function depth exceeded:
* |
* DV-DV-DV-DV-GV
......@@ -303,6 +303,7 @@ public abstract class RCallNode extends RNode {
@Child protected CallArgumentsNode args;
@Child private PromiseHelperNode promiseHelper;
private final ConditionProfile isPromiseProfile = ConditionProfile.createBinaryProfile();
private final BranchProfile errorProfile = BranchProfile.create();
public RootCallNode(RNode function, CallArgumentsNode args) {
this.functionNode = function;
......@@ -325,6 +326,7 @@ public abstract class RCallNode extends RNode {
if (value instanceof RFunction) {
return (RFunction) value;
} else {
errorProfile.enter();
throw RError.error(getEncapsulatingSourceSection(), RError.Message.APPLY_NON_FUNCTION);
}
}
......
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