Search in sources :

Example 11 with HotSpotObjectConstant

use of jdk.vm.ci.hotspot.HotSpotObjectConstant in project graal by oracle.

the class LoadConstantIndirectlyFixedNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    assert constant != null : "Expected the value to fold: " + value;
    Value result;
    if (constant instanceof HotSpotObjectConstant) {
        result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadObjectAddress(constant);
    } else if (constant instanceof HotSpotMetaspaceConstant) {
        result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadMetaspaceAddress(constant, action);
    } else {
        throw new PermanentBailoutException("Unsupported constant type: " + constant);
    }
    gen.setResult(this, result);
}
Also used : HotSpotLIRGenerator(org.graalvm.compiler.hotspot.HotSpotLIRGenerator) Value(jdk.vm.ci.meta.Value) HotSpotObjectConstant(jdk.vm.ci.hotspot.HotSpotObjectConstant) HotSpotMetaspaceConstant(jdk.vm.ci.hotspot.HotSpotMetaspaceConstant) PermanentBailoutException(org.graalvm.compiler.core.common.PermanentBailoutException)

Example 12 with HotSpotObjectConstant

use of jdk.vm.ci.hotspot.HotSpotObjectConstant in project graal by oracle.

the class LoadConstantIndirectlyNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    assert constant != null : "Expected the value to fold: " + value;
    Value result;
    if (constant instanceof HotSpotObjectConstant) {
        result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadObjectAddress(constant);
    } else if (constant instanceof HotSpotMetaspaceConstant) {
        result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitLoadMetaspaceAddress(constant, action);
    } else {
        throw new PermanentBailoutException("Unsupported constant type: " + constant);
    }
    gen.setResult(this, result);
}
Also used : HotSpotLIRGenerator(org.graalvm.compiler.hotspot.HotSpotLIRGenerator) Value(jdk.vm.ci.meta.Value) HotSpotObjectConstant(jdk.vm.ci.hotspot.HotSpotObjectConstant) HotSpotMetaspaceConstant(jdk.vm.ci.hotspot.HotSpotMetaspaceConstant) PermanentBailoutException(org.graalvm.compiler.core.common.PermanentBailoutException)

Aggregations

HotSpotObjectConstant (jdk.vm.ci.hotspot.HotSpotObjectConstant)12 Value (jdk.vm.ci.meta.Value)7 RegisterValue (jdk.vm.ci.code.RegisterValue)4 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)4 JavaConstant (jdk.vm.ci.meta.JavaConstant)4 LIRValueUtil.isConstantValue (org.graalvm.compiler.lir.LIRValueUtil.isConstantValue)4 HotSpotMetaspaceConstant (jdk.vm.ci.hotspot.HotSpotMetaspaceConstant)3 PermanentBailoutException (org.graalvm.compiler.core.common.PermanentBailoutException)3 HotSpotLIRGenerator (org.graalvm.compiler.hotspot.HotSpotLIRGenerator)3 HotSpotCompressedNullConstant (jdk.vm.ci.hotspot.HotSpotCompressedNullConstant)2 Constant (jdk.vm.ci.meta.Constant)2 AbstractObjectStamp (org.graalvm.compiler.core.common.type.AbstractObjectStamp)2 GraalError (org.graalvm.compiler.debug.GraalError)2 LIRValueUtil.asConstant (org.graalvm.compiler.lir.LIRValueUtil.asConstant)2 AArch64AddressValue (org.graalvm.compiler.lir.aarch64.AArch64AddressValue)2 SPARCAddressValue (org.graalvm.compiler.lir.sparc.SPARCAddressValue)2 SPARCImmediateAddressValue (org.graalvm.compiler.lir.sparc.SPARCImmediateAddressValue)2 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)2 HotSpotResolvedJavaField (jdk.vm.ci.hotspot.HotSpotResolvedJavaField)1 HotSpotResolvedJavaType (jdk.vm.ci.hotspot.HotSpotResolvedJavaType)1