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

add a few @SlowPath in RMissingHelper, RPromise and UseMethodDispatchNode

parent 3f3584b9
Branches
No related tags found
No related merge requests found
......@@ -98,8 +98,15 @@ public class UseMethodDispatchNode extends S3DispatchNode {
return funCallNode.call(newFrame, targetFunction.getTarget(), argObject);
}
@SlowPath
private void findTargetFunction(VirtualFrame frame, Frame callerFrame) {
findTargetFunctionLookup(callerFrame);
if (targetFunction == null) {
throw RError.error(frame, getEncapsulatingSourceSection(), RError.Message.UNKNOWN_FUNCTION_USE_METHOD, this.genericName, RRuntime.toString(this.type));
}
}
@SlowPath
private void findTargetFunctionLookup(Frame callerFrame) {
for (int i = 0; i < this.type.getLength(); ++i) {
findFunction(this.genericName, this.type.getDataAt(i), callerFrame);
if (targetFunction != null) {
......@@ -116,11 +123,9 @@ public class UseMethodDispatchNode extends S3DispatchNode {
break;
}
}
if (targetFunction == null) {
findFunction(this.genericName, RRuntime.DEFAULT, callerFrame);
if (targetFunction == null) {
throw RError.error(frame, getEncapsulatingSourceSection(), RError.Message.UNKNOWN_FUNCTION_USE_METHOD, this.genericName, RRuntime.toString(this.type));
}
if (targetFunction != null) {
return;
}
findFunction(this.genericName, RRuntime.DEFAULT, callerFrame);
}
}
......@@ -22,6 +22,7 @@
*/
package com.oracle.truffle.r.nodes.function;
import com.oracle.truffle.api.CompilerDirectives.SlowPath;
import com.oracle.truffle.api.frame.*;
import com.oracle.truffle.r.nodes.access.*;
import com.oracle.truffle.r.runtime.data.*;
......@@ -78,6 +79,7 @@ public class RMissingHelper {
* @param symbol The {@link Symbol} which to check
* @return See {@link #isMissingSymbol(RPromise)}
*/
@SlowPath
public static boolean isMissingArgument(Frame frame, Symbol symbol) {
// TODO IsDotDotSymbol: Anything special to do here?
......@@ -113,6 +115,7 @@ public class RMissingHelper {
* {@link #isMissingArgument(Frame, Symbol)}.
* @return Whether the given {@link RPromise} represents a symbol that is 'missing' in its frame
*/
@SlowPath
public static boolean isMissingSymbol(RPromise promise) {
boolean result = false;
// Missing RPromises throw an error on evaluation, so this might only be checked if it has
......
......@@ -177,6 +177,7 @@ public class RPromise {
return value;
}
@SlowPath
protected Object doEvalArgument() {
Object result = null;
assert env != null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment