|
1 | 1 | /* |
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. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
38 | 38 | import jdk.graal.compiler.nodes.LogicNode; |
39 | 39 | import jdk.graal.compiler.nodes.ValueNode; |
40 | 40 | import jdk.graal.compiler.nodes.debug.ControlFlowAnchored; |
| 41 | +import jdk.graal.compiler.nodes.extended.OpaqueValueNode; |
41 | 42 | import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver; |
42 | 43 | import jdk.graal.compiler.nodes.spi.VirtualizerTool; |
43 | 44 | import jdk.vm.ci.meta.DeoptimizationAction; |
@@ -122,10 +123,11 @@ protected final void insertDeoptimization(VirtualizerTool tool) { |
122 | 123 | tool.delete(); |
123 | 124 | } else { |
124 | 125 | /* |
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. |
127 | 129 | */ |
128 | | - ConstantNode unusedValue = ConstantNode.forConstant(JavaConstant.defaultForKind(getStackKind()), tool.getMetaAccess()); |
| 130 | + ValueNode unusedValue = new OpaqueValueNode(ConstantNode.forConstant(JavaConstant.defaultForKind(getStackKind()), tool.getMetaAccess())); |
129 | 131 | tool.addNode(unusedValue); |
130 | 132 | tool.replaceWith(unusedValue); |
131 | 133 | } |
|
0 commit comments