Skip to content

Commit 87bfe1c

Browse files
committed
[GR-64774] EnsureClassInitializedNode.hub should try harder to resolve to a constant
PullRequest: graal/20802
2 parents 5ddfcb9 + cba4e59 commit 87bfe1c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/classinitialization/EnsureClassInitializedNode.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import jdk.graal.compiler.nodes.spi.CanonicalizerTool;
4545
import jdk.graal.compiler.nodes.spi.Lowerable;
4646
import jdk.graal.compiler.nodes.type.StampTool;
47+
import jdk.graal.compiler.nodes.util.GraphUtil;
4748
import jdk.vm.ci.meta.ConstantReflectionProvider;
4849
import jdk.vm.ci.meta.ResolvedJavaType;
4950

@@ -98,8 +99,9 @@ public boolean hasSideEffect() {
9899
}
99100

100101
public ResolvedJavaType constantTypeOrNull(ConstantReflectionProvider constantReflection) {
101-
if (hub.isConstant()) {
102-
return constantReflection.asJavaType(hub.asConstant());
102+
ValueNode value = GraphUtil.unproxify(hub);
103+
if (value.isConstant()) {
104+
return constantReflection.asJavaType(value.asConstant());
103105
} else {
104106
return null;
105107
}

0 commit comments

Comments
 (0)