From 2cda4bafcce8e411a986486ba0f13778297edc61 Mon Sep 17 00:00:00 2001
From: Lukas Stadler <lukas.stadler@oracle.com>
Date: Thu, 22 Dec 2016 18:37:03 +0100
Subject: [PATCH] set visibility in FunctionExpressionNode

---
 .../truffle/r/nodes/function/FunctionExpressionNode.java      | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionExpressionNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionExpressionNode.java
index e0c9f9eb52..cc6676d89f 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionExpressionNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/function/FunctionExpressionNode.java
@@ -32,6 +32,7 @@ import com.oracle.truffle.r.nodes.RASTUtils;
 import com.oracle.truffle.r.nodes.RRootNode;
 import com.oracle.truffle.r.nodes.function.PromiseHelperNode.PromiseDeoptimizeFrameNode;
 import com.oracle.truffle.r.nodes.function.opt.EagerEvalHelper;
+import com.oracle.truffle.r.nodes.function.visibility.SetVisibilityNode;
 import com.oracle.truffle.r.nodes.instrumentation.RInstrumentation;
 import com.oracle.truffle.r.runtime.ArgumentsSignature;
 import com.oracle.truffle.r.runtime.builtins.FastPathFactory;
@@ -49,6 +50,8 @@ public final class FunctionExpressionNode extends RSourceSectionNode implements
         return new FunctionExpressionNode(src, callTarget);
     }
 
+    @Child private SetVisibilityNode visibility = SetVisibilityNode.create();
+
     @CompilationFinal private RootCallTarget callTarget;
     private final PromiseDeoptimizeFrameNode deoptFrameNode;
     @CompilationFinal private FastPathFactory fastPath;
@@ -68,6 +71,7 @@ public final class FunctionExpressionNode extends RSourceSectionNode implements
 
     @Override
     public RFunction executeFunction(VirtualFrame frame) {
+        visibility.execute(frame, true);
         MaterializedFrame matFrame = frame.materialize();
         if (deoptFrameNode != null) {
             // Deoptimize every promise which is now in this frame, as it might leave it's stack
-- 
GitLab