Skip to content

Commit a799e24

Browse files
committed
CaptureStateBegin: adjust assertion
1 parent d3e5c56 commit a799e24

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/nodes/extended/CaptureStateBeginNode.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,6 +37,7 @@
3737
import jdk.graal.compiler.nodes.BeginStateSplitNode;
3838
import jdk.graal.compiler.nodes.LoopExitNode;
3939
import jdk.graal.compiler.nodes.MemoryProxyNode;
40+
import jdk.graal.compiler.nodes.SafepointNode;
4041
import jdk.graal.compiler.nodes.ValueProxyNode;
4142
import jdk.graal.compiler.nodes.spi.Canonicalizable;
4243
import jdk.graal.compiler.nodes.spi.CanonicalizerTool;
@@ -70,10 +71,11 @@ public Node canonical(CanonicalizerTool tool) {
7071
public boolean verifyNode() {
7172
if (predecessor() instanceof LoopExitNode loopExit) {
7273
/*
73-
* Must guarantee only value and memory proxies are attached to the loop exit. Anything
74-
* else should be attached to this node
74+
* Must guarantee that only value and memory proxies or safepoints are attached to the
75+
* loop exit. Anything else should be attached to this node.
7576
*/
76-
assert loopExit.usages().stream().allMatch(NodePredicates.isA(ValueProxyNode.class).or(MemoryProxyNode.class)) : String.format("LoopExit has disallowed usages %s", loopExit);
77+
assert loopExit.usages().stream().allMatch(NodePredicates.isA(ValueProxyNode.class).or(MemoryProxyNode.class).or(SafepointNode.class)) : String.format(
78+
"LoopExit %s has disallowed usages %s", loopExit, loopExit.usages().snapshot());
7779
}
7880

7981
return super.verifyNode();

0 commit comments

Comments
 (0)