Skip to content

Commit 1fa877e

Browse files
committed
Also verify stateAfter on MonitorEnterNode
1 parent a16189f commit 1fa877e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/phases/VerifyLockDepthPhase.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ protected void node(FixedNode node) {
183183
state.verifyState(during.asFixedNode(), during.stateDuring());
184184
}
185185
if (node instanceof MonitorEnterNode) {
186-
state.push((MonitorEnterNode) node);
186+
MonitorEnterNode enter = (MonitorEnterNode) node;
187+
state.push(enter);
188+
state.verifyState(node, enter.stateAfter());
187189
} else if (node instanceof MonitorExitNode) {
188190
state.pop((MonitorExitNode) node);
189191
} else if (node instanceof AccessMonitorNode) {

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/phases/common/LockEliminationPhase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import java.util.Optional;
2828

29-
import jdk.graal.compiler.debug.Assertions;
3029
import jdk.graal.compiler.debug.GraalError;
3130
import jdk.graal.compiler.graph.Node;
3231
import jdk.graal.compiler.nodes.FixedNode;
@@ -69,7 +68,7 @@ protected void run(StructuredGraph graph) {
6968
if ((next instanceof MonitorEnterNode)) {
7069
// should never happen, osr monitor enters are always direct successors of the graph
7170
// start
72-
assert !(next instanceof OSRMonitorEnterNode) : Assertions.errorMessageContext("next", next);
71+
GraalError.guarantee(!(next instanceof OSRMonitorEnterNode), "OSRMonitorEnterNode can't be seen here: %s", next);
7372
AccessMonitorNode monitorEnterNode = (AccessMonitorNode) next;
7473
if (isCompatibleLock(monitorEnterNode, monitorExitNode, true, cfg)) {
7574
/*

0 commit comments

Comments
 (0)