src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java
equal
deleted
inserted
replaced
41 import org.graalvm.compiler.nodes.calc.FloatingNode; |
41 import org.graalvm.compiler.nodes.calc.FloatingNode; |
42 import org.graalvm.compiler.nodes.spi.LIRLowerable; |
42 import org.graalvm.compiler.nodes.spi.LIRLowerable; |
43 import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; |
43 import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; |
44 import org.graalvm.compiler.nodes.util.GraphUtil; |
44 import org.graalvm.compiler.nodes.util.GraphUtil; |
45 |
45 |
|
46 import jdk.vm.ci.hotspot.HotSpotConstantPoolObject; |
46 import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant; |
47 import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant; |
47 import jdk.vm.ci.hotspot.HotSpotObjectConstant; |
48 import jdk.vm.ci.hotspot.HotSpotObjectConstant; |
48 import jdk.vm.ci.meta.Constant; |
49 import jdk.vm.ci.meta.Constant; |
49 import jdk.vm.ci.meta.Value; |
50 import jdk.vm.ci.meta.Value; |
50 |
51 |
81 |
82 |
82 @Override |
83 @Override |
83 public void generate(NodeLIRBuilderTool gen) { |
84 public void generate(NodeLIRBuilderTool gen) { |
84 assert constant != null : "Expected the value to fold: " + value; |
85 assert constant != null : "Expected the value to fold: " + value; |
85 Value result; |
86 Value result; |
86 if (constant instanceof HotSpotObjectConstant) { |
87 if (constant instanceof HotSpotObjectConstant || constant instanceof HotSpotConstantPoolObject) { |
87 result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadObjectAddress(constant); |
88 result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadObjectAddress(constant); |
88 } else if (constant instanceof HotSpotMetaspaceConstant) { |
89 } else if (constant instanceof HotSpotMetaspaceConstant) { |
89 result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadMetaspaceAddress(constant, action); |
90 result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadMetaspaceAddress(constant, action); |
90 } else { |
91 } else { |
91 throw new PermanentBailoutException("Unsupported constant type: " + constant); |
92 throw new PermanentBailoutException("Unsupported constant type: " + constant); |