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

backout fb199ab0ee66 (pass along caller frame while interpreting)

parent a539ba2a
Branches
No related tags found
No related merge requests found
......@@ -165,7 +165,7 @@ public abstract class DoCall extends RBuiltinNode {
CompilerDirectives.transferToInterpreterAndInvalidate();
needsCallerFrame = true;
}
callerFrame = (CompilerDirectives.inInterpreter() || needsCallerFrame) ? getCallerFrame(frame, callerFrame) : null;
callerFrame = needsCallerFrame ? getCallerFrame(frame, callerFrame) : null;
Object[] callArgs = argsNode.execute(func, caller, callerFrame, RArguments.getDepth(frame) + 1, reorderedArgs.getArguments(), reorderedArgs.getSignature(), null);
RArguments.setIsIrregular(callArgs, true);
return callCache.execute(frame, func.getTarget(), callArgs);
......
......@@ -488,13 +488,6 @@ public class FrameFunctions {
throw RError.error(this, RError.Message.INVALID_ARGUMENT, RRuntime.intToString(n));
}
int p = RArguments.getDepth(frame) - n - 1;
Frame current = frame;
while (current != null) {
if (RArguments.getDepth(current) == p) {
return REnvironment.frameToEnvironment(current.materialize());
}
current = RArguments.getCallerFrame(current);
}
Frame callerFrame = Utils.getStackFrame(FrameAccess.MATERIALIZE, p);
if (nullProfile.profile(callerFrame == null)) {
return REnvironment.globalEnv();
......
......@@ -256,7 +256,7 @@ public class GetFunctions {
CompilerDirectives.transferToInterpreterAndInvalidate();
argsNode = insert(RArgumentsNode.create());
}
MaterializedFrame callerFrame = (CompilerDirectives.inInterpreter() || needsCallerFrame) ? frame.materialize() : null;
MaterializedFrame callerFrame = needsCallerFrame ? frame.materialize() : null;
Object[] callArgs = argsNode.execute(ifnFunc, caller, callerFrame, RArguments.getDepth(frame) + 1, new Object[]{x}, ArgumentsSignature.empty(1), null);
return callCache.execute(frame, ifnFunc.getTarget(), callArgs);
}
......
......@@ -86,12 +86,12 @@ import com.oracle.truffle.r.runtime.nodes.*;
* U = {@link UninitializedCallNode}: Forms the uninitialized end of the function PIC
* D = {@link DispatchedCallNode}: Function fixed, no varargs
* G = {@link GenericCallNode}: Function arbitrary
*
*
* 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)
*
*
* (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)
......@@ -104,11 +104,11 @@ import com.oracle.truffle.r.runtime.nodes.*;
* 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
......@@ -116,7 +116,7 @@ import com.oracle.truffle.r.runtime.nodes.*;
* DV
* |
* UVC <- varargs signature level cache
*
*
* varargs, max varargs depth exceeded:
* |
* DV-DV-UV
......@@ -128,7 +128,7 @@ import com.oracle.truffle.r.runtime.nodes.*;
* DV
* |
* DGV
*
*
* varargs, max function depth exceeded:
* |
* DV-DV-DV-DV-GV
......@@ -913,7 +913,7 @@ public final class RCallNode extends RNode implements RSyntaxNode {
needsSplitting = false;
call.cloneCallTarget();
}
MaterializedFrame callerFrame = (CompilerDirectives.inInterpreter() || needsCallerFrame) ? frame.materialize() : null;
MaterializedFrame callerFrame = needsCallerFrame ? frame.materialize() : null;
Object[] argsObject = argsNode.execute(currentFunction, caller, callerFrame, RArguments.getDepth(frame) + 1, matchedArgs.executeArray(frame), matchedArgs.getSignature(), s3Args);
return call.call(frame, argsObject);
......@@ -1040,7 +1040,7 @@ public final class RCallNode extends RNode implements RSyntaxNode {
needsSplitting = false;
call.cloneCallTarget();
}
MaterializedFrame callerFrame = (CompilerDirectives.inInterpreter() || needsCallerFrame) ? frame.materialize() : null;
MaterializedFrame callerFrame = needsCallerFrame ? frame.materialize() : null;
Object[] argsObject = argsNode.execute(currentFunction, caller, callerFrame, RArguments.getDepth(frame) + 1, matchedArgs.executeArray(frame), matchedArgs.getSignature(), s3Args);
return call.call(frame, argsObject);
}
......@@ -1077,7 +1077,7 @@ public final class RCallNode extends RNode implements RSyntaxNode {
CompilerDirectives.transferToInterpreterAndInvalidate();
needsCallerFrame = true;
}
MaterializedFrame callerFrame = (CompilerDirectives.inInterpreter() || needsCallerFrame) ? frame.materialize() : null;
MaterializedFrame callerFrame = needsCallerFrame ? frame.materialize() : null;
Object[] argsObject = RArguments.create(currentFunction, caller, callerFrame, RArguments.getDepth(frame) + 1, matchedArgs.doExecuteArray(frame), matchedArgs.getSignature(), s3Args);
return call.call(frame, argsObject);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment