|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2022, 2024, 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
|
|
66 | 66 | import jdk.graal.compiler.nodes.debug.BlackholeNode;
|
67 | 67 | import jdk.graal.compiler.nodes.extended.BoxNode;
|
68 | 68 | import jdk.graal.compiler.nodes.extended.BytecodeExceptionNode;
|
| 69 | +import jdk.graal.compiler.nodes.extended.FixedValueAnchorNode; |
69 | 70 | import jdk.graal.compiler.nodes.extended.ForeignCall;
|
70 | 71 | import jdk.graal.compiler.nodes.extended.GetClassNode;
|
71 | 72 | import jdk.graal.compiler.nodes.extended.JavaReadNode;
|
|
98 | 99 | import jdk.graal.compiler.nodes.java.StoreFieldNode;
|
99 | 100 | import jdk.graal.compiler.nodes.java.StoreIndexedNode;
|
100 | 101 | import jdk.graal.compiler.nodes.memory.ReadNode;
|
101 |
| -import jdk.graal.compiler.nodes.virtual.AllocatedObjectNode; |
102 |
| -import jdk.graal.compiler.nodes.virtual.CommitAllocationNode; |
103 |
| -import jdk.graal.compiler.nodes.virtual.VirtualObjectNode; |
104 | 102 | import jdk.graal.compiler.replacements.nodes.ArrayEqualsNode;
|
105 | 103 | import jdk.graal.compiler.replacements.nodes.BasicArrayCopyNode;
|
106 | 104 | import jdk.graal.compiler.replacements.nodes.BinaryMathIntrinsicNode;
|
@@ -172,21 +170,18 @@ protected void lower(ResolvedVar resolvedVar) {
|
172 | 170 |
|
173 | 171 | /**
|
174 | 172 | * Materialize the operation represented by the node without caring about inlining and reuse.
|
175 |
| - * |
| 173 | + * <p> |
176 | 174 | * The logic for handling inlining and reuse is located in the method
|
177 | 175 | * {@link #lowerValue(ValueNode)}.
|
178 |
| - * |
| 176 | + * <p> |
179 | 177 | * Lowering of the inputs of the node should call {@link #lowerValue(ValueNode)} instead of this
|
180 | 178 | * method.
|
| 179 | + * <p> |
| 180 | + * Not all possible node types are handled here. Subclasses are supposed to override this method |
| 181 | + * and handle any other node types they encounter. |
181 | 182 | */
|
182 | 183 | protected void dispatch(Node node) {
|
183 |
| - if (node instanceof CommitAllocationNode) { |
184 |
| - lower((CommitAllocationNode) node); |
185 |
| - } else if (node instanceof VirtualObjectNode) { |
186 |
| - lower((VirtualObjectNode) node); |
187 |
| - } else if (node instanceof AllocatedObjectNode) { |
188 |
| - lower((AllocatedObjectNode) node); |
189 |
| - } else if (node instanceof NegateNode) { |
| 184 | + if (node instanceof NegateNode) { |
190 | 185 | lower((NegateNode) node);
|
191 | 186 | } else if (node instanceof UnwindNode) {
|
192 | 187 | lower((UnwindNode) node);
|
@@ -335,6 +330,8 @@ protected void dispatch(Node node) {
|
335 | 330 | lower((ClassIsAssignableFromNode) node);
|
336 | 331 | } else if (node instanceof DynamicNewInstanceNode n) {
|
337 | 332 | lower(n);
|
| 333 | + } else if (node instanceof FixedValueAnchorNode n) { |
| 334 | + lowerValue(n.getOriginalNode()); |
338 | 335 | } else {
|
339 | 336 | if (!isIgnored(node)) {
|
340 | 337 | handleUnknownNodeType(node);
|
@@ -493,12 +490,6 @@ protected void handleUnknownNodeType(Node node) {
|
493 | 490 |
|
494 | 491 | protected abstract void lower(NegateNode node);
|
495 | 492 |
|
496 |
| - protected abstract void lower(VirtualObjectNode node); |
497 |
| - |
498 |
| - protected abstract void lower(CommitAllocationNode node); |
499 |
| - |
500 |
| - protected abstract void lower(AllocatedObjectNode node); |
501 |
| - |
502 | 493 | protected abstract void lower(IdentityHashCodeNode node);
|
503 | 494 |
|
504 | 495 | protected abstract void lower(ClassIsAssignableFromNode node);
|
|
0 commit comments