Skip to content

Commit a478488

Browse files
committed
WrapperNode needs to be unwrapped before instanceof check.
1 parent 4b14a93 commit a478488

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/nodes/JSNodeUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,8 @@ public static JavaScriptNode getWrappedNode(JavaScriptNode node) {
176176
public static boolean isTaggedNode(Node node) {
177177
return node instanceof JSTaggedExecutionNode || (node instanceof WrapperNode && ((WrapperNode) node).getDelegateNode() instanceof JSTaggedExecutionNode);
178178
}
179+
180+
public static boolean isInputGeneratingNode(Node node) {
181+
return node instanceof JSInputGeneratingNodeWrapper || (node instanceof WrapperNode && ((WrapperNode) node).getDelegateNode() instanceof JSInputGeneratingNodeWrapper);
182+
}
179183
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import com.oracle.truffle.api.library.CachedLibrary;
6262
import com.oracle.truffle.api.object.DynamicObject;
6363
import com.oracle.truffle.api.profiles.ConditionProfile;
64+
import com.oracle.truffle.js.nodes.JSNodeUtil;
6465
import com.oracle.truffle.js.nodes.JavaScriptNode;
6566
import com.oracle.truffle.js.nodes.instrumentation.JSInputGeneratingNodeWrapper;
6667
import com.oracle.truffle.js.nodes.instrumentation.JSTags;
@@ -134,7 +135,7 @@ public InstrumentableNode materializeInstrumentableNodes(Set<Class<? extends Tag
134135

135136
private boolean materializationNeeded(Set<Class<? extends Tag>> materializedTags) {
136137
if (materializedTags.contains(ObjectAllocationTag.class)) {
137-
return (!getTarget().hasSourceSection() && !(getTarget() instanceof JSInputGeneratingNodeWrapper));
138+
return (!getTarget().hasSourceSection() && !JSNodeUtil.isInputGeneratingNode(getTarget()));
138139
}
139140
return false;
140141
}

0 commit comments

Comments
 (0)