Skip to content

Commit 01ae40f

Browse files
committed
Ensure builtins have exactly one RootBodyTag.
1 parent c603b50 commit 01ae40f

File tree

1 file changed

+4
-4
lines changed
  • graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/nodes/function

1 file changed

+4
-4
lines changed

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/nodes/function/JSBuiltinNode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,8 @@ public abstract class JSBuiltinNode extends AbstractBodyNode {
6868

6969
@Override
7070
public boolean hasTag(Class<? extends Tag> tag) {
71-
if (tag == StandardTags.RootBodyTag.class) {
72-
return true;
73-
} else if (tag == JSTags.BuiltinRootTag.class) {
74-
return true;
71+
if (tag == JSTags.BuiltinRootTag.class) {
72+
return super.hasTag(StandardTags.RootBodyTag.class);
7573
}
7674
return super.hasTag(tag);
7775
}
@@ -132,6 +130,8 @@ public boolean countsTowardsStackTraceLimit() {
132130

133131
public static JSBuiltinNode createBuiltin(JSContext ctx, JSBuiltin builtin, boolean construct, boolean newTarget) {
134132
JSBuiltinNode builtinNode = builtin.createNode(ctx, construct, newTarget);
133+
// If builtinNode has any JSBuiltinNode child, only this node should have the RootBodyTag.
134+
builtinNode.addRootBodyTag();
135135
if (VERIFY_ARGUMENT_COUNT) {
136136
verifyArgumentCount(builtinNode);
137137
}

0 commit comments

Comments
 (0)