Skip to content

Commit 55573d7

Browse files
committed
[GR-17034] Use the new RootBodyTag.
PullRequest: fastr/2310
2 parents f9b86ca + bad0a31 commit 55573d7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RRuntimeASTAccessImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.oracle.truffle.api.frame.Frame;
3434
import com.oracle.truffle.api.frame.FrameInstance.FrameAccess;
3535
import com.oracle.truffle.api.instrumentation.StandardTags.CallTag;
36+
import com.oracle.truffle.api.instrumentation.StandardTags.RootBodyTag;
3637
import com.oracle.truffle.api.instrumentation.StandardTags.RootTag;
3738
import com.oracle.truffle.api.instrumentation.StandardTags.StatementTag;
3839
import com.oracle.truffle.api.nodes.BlockNode;
@@ -293,6 +294,13 @@ public RSyntaxNode unwrapPromiseRep(RPromise promise) {
293294

294295
@Override
295296
public boolean isTaggedWith(Node node, Class<?> tag) {
297+
if (tag == RootBodyTag.class) {
298+
// RootBodyNode marks the Root body including prolog/epilog.
299+
// The only child of the RootBodyNode that is instrumentable should be the body.
300+
// Any other child of RootBodyNode should not be instrumentable, e.g. SaveArgumentsNode,
301+
// etc.
302+
return node.getParent() instanceof RootBodyNode;
303+
}
296304
if (node instanceof RootBodyNode) {
297305
return (tag == RootTag.class);
298306
}

0 commit comments

Comments
 (0)