File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 3333import com .oracle .truffle .api .frame .Frame ;
3434import com .oracle .truffle .api .frame .FrameInstance .FrameAccess ;
3535import com .oracle .truffle .api .instrumentation .StandardTags .CallTag ;
36+ import com .oracle .truffle .api .instrumentation .StandardTags .RootBodyTag ;
3637import com .oracle .truffle .api .instrumentation .StandardTags .RootTag ;
3738import com .oracle .truffle .api .instrumentation .StandardTags .StatementTag ;
3839import 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 }
You can’t perform that action at this time.
0 commit comments