Skip to content

Commit 0987619

Browse files
committed
Add missing file after class rename.
1 parent 2b62838 commit 0987619

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2021 Oracle and/or its affiliates. All rights reserved. This
3+
* code is released under a tri EPL/GPL/LGPL license. You can use it,
4+
* redistribute it and/or modify it under the terms of the:
5+
*
6+
* Eclipse Public License version 2.0, or
7+
* GNU General Public License version 2, or
8+
* GNU Lesser General Public License version 2.1.
9+
*/
10+
package org.truffleruby.language.arguments;
11+
12+
import com.oracle.truffle.api.nodes.DirectCallNode;
13+
import com.oracle.truffle.api.nodes.IndirectCallNode;
14+
import com.oracle.truffle.api.nodes.Node;
15+
16+
import org.truffleruby.RubyContext;
17+
import org.truffleruby.language.FrameAndVariablesSendingNode;
18+
import org.truffleruby.language.RubyNode;
19+
20+
public interface CallerDataReadingNode {
21+
public void startSending(FrameAndVariablesSendingNode node);
22+
23+
public static boolean notifyCallerToSendData(RubyContext context, Node callerNode, CallerDataReadingNode reader) {
24+
if (callerNode instanceof DirectCallNode || callerNode instanceof IndirectCallNode) {
25+
Node parent = callerNode.getParent();
26+
while (parent != null) {
27+
if (parent instanceof FrameAndVariablesSendingNode) {
28+
reader.startSending((FrameAndVariablesSendingNode) parent);
29+
return true;
30+
}
31+
if (parent instanceof RubyNode) {
32+
// A node with source info representing Ruby code, we could not find the FrameAndVariablesSendingNode
33+
return false;
34+
}
35+
parent = parent.getParent();
36+
}
37+
}
38+
39+
return false;
40+
}
41+
}

0 commit comments

Comments
 (0)