diff --git a/.gitignore b/.gitignore index 1fea1c3c63353c8593fd8e3fb97d1299c6267c09..a1b4ad8c171c249f4b64de267405318c95a4df97 100644 --- a/.gitignore +++ b/.gitignore @@ -64,8 +64,6 @@ .hprof.txt /compilations-*.cfg /graal/.*/build.xml -/.*/build.xml -/.*/nbproject/ dist foo1 /doc/.*/dot_temp_ @@ -74,7 +72,8 @@ foo1 output.txt output.cfg .cfg -/nbproject/private/ +**/nbproject/** +**/build.xml /scratch/ /test/ /test_gnur/ diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java index fba0cfe5d520a9a3f7de24e494ce8a9a7515bd65..ecc624818389529eaa862e283a78e01f1dcca214 100644 --- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java +++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java @@ -37,7 +37,6 @@ import com.oracle.truffle.r.nodes.builtin.RBuiltinNode; import com.oracle.truffle.r.nodes.builtin.base.EvalFunctions.Eval; import com.oracle.truffle.r.nodes.function.PromiseHelperNode; import com.oracle.truffle.r.nodes.function.RCallNode; -import com.oracle.truffle.r.nodes.function.RCallerHelper; import com.oracle.truffle.r.nodes.function.SubstituteVirtualFrame; import com.oracle.truffle.r.nodes.unary.CastIntegerNode; import com.oracle.truffle.r.nodes.unary.CastIntegerNodeGen; @@ -178,8 +177,6 @@ public class HiddenInternalFunctions { @Child private CallInlineCacheNode callCache = CallInlineCacheNodeGen.create(); @Child private CastIntegerNode castIntNode; - private final RCaller caller = RCallerHelper.InvalidRepresentation.instance; - private void initCast() { if (castIntNode == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); @@ -260,7 +257,8 @@ public class HiddenInternalFunctions { RSerialize.CallHook callHook = new RSerialize.CallHook() { @Override public Object eval(Object arg) { - Object[] callArgs = RArguments.create(envhook, caller, null, RArguments.getDepth(frame) + 1, RArguments.getPromiseFrame(frame), new Object[]{arg}, SIGNATURE, null); + Object[] callArgs = RArguments.create(envhook, (RCaller) getOriginalCall(), null, RArguments.getDepth(frame) + 1, RArguments.getPromiseFrame(frame), new Object[]{arg}, + SIGNATURE, null); return callCache.execute(SubstituteVirtualFrame.create(frame), envhook.getTarget(), callArgs); } }; @@ -365,8 +363,6 @@ public class HiddenInternalFunctions { private static final ArgumentsSignature SIGNATURE = ArgumentsSignature.get("e"); @Child private CallInlineCacheNode callCache = CallInlineCacheNodeGen.create(); - private final RCaller caller = RCallerHelper.InvalidRepresentation.instance; - @Override protected void createCasts(CastBuilder casts) { casts.toInteger(2).toInteger(3); @@ -386,7 +382,8 @@ public class HiddenInternalFunctions { RSerialize.CallHook callHook = new RSerialize.CallHook() { @Override public Object eval(Object arg) { - Object[] callArgs = RArguments.create(hook, caller, null, RArguments.getDepth(frame) + 1, RArguments.getPromiseFrame(frame), new Object[]{arg}, SIGNATURE, null); + Object[] callArgs = RArguments.create(hook, (RCaller) getOriginalCall(), null, RArguments.getDepth(frame) + 1, RArguments.getPromiseFrame(frame), new Object[]{arg}, SIGNATURE, + null); return callCache.execute(SubstituteVirtualFrame.create(frame), hook.getTarget(), callArgs); } }; diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java index 17fbe3f13c5742daf0efece284c86588ddcb4070..32a0691ab32301cb9080aa06334cb48aa799492c 100644 --- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java +++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/RCallNode.java @@ -689,8 +689,8 @@ public abstract class RCallNode extends RNode implements RSyntaxNode, RSyntaxCal /** * Creates a modified call in which the first N arguments are replaced by - * {@code replacementArgs}. This is, for example, to support - * {@code HiddenInternalFunctions.MakeLazy}, and condition handling. + * {@code replacementArgs}. This is only used to support + * {@code HiddenInternalFunctions.MakeLazy}. */ @TruffleBoundary public static RCallNode createCloneReplacingArgs(RCallNode call, RSyntaxNode... replacementArgs) { @@ -698,7 +698,7 @@ public abstract class RCallNode extends RNode implements RSyntaxNode, RSyntaxCal for (int i = 0; i < args.length; i++) { args[i] = i < replacementArgs.length ? replacementArgs[i] : call.arguments[i]; } - return RCallNodeGen.create(call.getSourceSection(), args, call.signature, new ForcePromiseNode(RASTUtils.cloneNode(call.getFunction()))); + return RCallNodeGen.create(call.getSourceSection(), args, call.signature, RASTUtils.cloneNode(call.getFunction())); } /** @@ -1009,7 +1009,8 @@ public abstract class RCallNode extends RNode implements RSyntaxNode, RSyntaxCal @Override public RSyntaxElement getSyntaxLHS() { - return getFunction() == null ? RSyntaxLookup.createDummyLookup(RSyntaxNode.LAZY_DEPARSE, "FUN", true) : getFunctionNode().asRSyntaxNode(); + ForcePromiseNode func = getFunction(); + return func == null || func.getValueNode() == null ? RSyntaxLookup.createDummyLookup(RSyntaxNode.LAZY_DEPARSE, "FUN", true) : getFunctionNode().asRSyntaxNode(); } @Override