Skip to content

Commit fc3dc54

Browse files
committed
[GR-69605] Use opaque placeholder value when deleting a VirtualFrameAccessorNode
PullRequest: graal/22169
2 parents 610ba85 + 9f99092 commit fc3dc54

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/truffle/nodes/frame/VirtualFrameAccessorNode.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 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
@@ -38,6 +38,7 @@
3838
import jdk.graal.compiler.nodes.LogicNode;
3939
import jdk.graal.compiler.nodes.ValueNode;
4040
import jdk.graal.compiler.nodes.debug.ControlFlowAnchored;
41+
import jdk.graal.compiler.nodes.extended.OpaqueValueNode;
4142
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver;
4243
import jdk.graal.compiler.nodes.spi.VirtualizerTool;
4344
import jdk.vm.ci.meta.DeoptimizationAction;
@@ -122,10 +123,11 @@ protected final void insertDeoptimization(VirtualizerTool tool) {
122123
tool.delete();
123124
} else {
124125
/*
125-
* Even though all usages will be eventually dead, we need to provide a valid
126-
* replacement value for now.
126+
* Even though all usages will be eventually dead, we need to provide a placeholder
127+
* replacement value for now. This must be opaque to prevent transformations based on
128+
* this value before the deletion takes effect.
127129
*/
128-
ConstantNode unusedValue = ConstantNode.forConstant(JavaConstant.defaultForKind(getStackKind()), tool.getMetaAccess());
130+
ValueNode unusedValue = new OpaqueValueNode(ConstantNode.forConstant(JavaConstant.defaultForKind(getStackKind()), tool.getMetaAccess()));
129131
tool.addNode(unusedValue);
130132
tool.replaceWith(unusedValue);
131133
}

0 commit comments

Comments
 (0)