Skip to content

Commit 26a51ef

Browse files
committed
[GR-38163] Implement getParentFrameDescriptor()
1 parent 36020ad commit 26a51ef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/org/truffleruby/language/RubyRootNode.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.oracle.truffle.api.frame.VirtualFrame;
2222
import com.oracle.truffle.api.source.SourceSection;
2323
import org.truffleruby.language.methods.Split;
24+
import org.truffleruby.parser.ParentFrameDescriptor;
2425

2526
public class RubyRootNode extends RubyBaseRootNode {
2627

@@ -65,6 +66,16 @@ public Object execute(VirtualFrame frame) {
6566
return body.execute(frame);
6667
}
6768

69+
@Override
70+
public FrameDescriptor getParentFrameDescriptor() {
71+
var info = getFrameDescriptor().getInfo();
72+
if (info instanceof ParentFrameDescriptor) {
73+
return ((ParentFrameDescriptor) info).getDescriptor();
74+
} else {
75+
return null;
76+
}
77+
}
78+
6879
@Override
6980
public boolean isCloningAllowed() {
7081
return split != Split.NEVER;

0 commit comments

Comments
 (0)