Search in sources :

Example 1 with HotSpotLIRGenerator

use of org.graalvm.compiler.hotspot.HotSpotLIRGenerator in project graal by oracle.

the class ResolveConstantStubCall method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    assert constant != null : "Expected the value to fold: " + value;
    Value stringValue = gen.operand(string);
    Value result;
    LIRFrameState fs = gen.state(this);
    assert fs != null : "The stateAfter is null";
    if (constant instanceof HotSpotObjectConstant) {
        result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitObjectConstantRetrieval(constant, stringValue, fs);
    } else if (constant instanceof HotSpotMetaspaceConstant) {
        if (action == HotSpotConstantLoadAction.RESOLVE) {
            result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitMetaspaceConstantRetrieval(constant, stringValue, fs);
        } else {
            assert action == HotSpotConstantLoadAction.INITIALIZE;
            result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitKlassInitializationAndRetrieval(constant, stringValue, fs);
        }
    } else {
        throw new PermanentBailoutException("Unsupported constant type: " + constant);
    }
    gen.setResult(this, result);
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) 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 2 with HotSpotLIRGenerator

use of org.graalvm.compiler.hotspot.HotSpotLIRGenerator in project graal by oracle.

the class CurrentJavaThreadNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    Register rawThread = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).getProviders().getRegisters().getThreadRegister();
    PlatformKind wordKind = gen.getLIRGeneratorTool().target().arch.getWordKind();
    gen.setResult(this, rawThread.asValue(LIRKind.value(wordKind)));
}
Also used : HotSpotLIRGenerator(org.graalvm.compiler.hotspot.HotSpotLIRGenerator) Register(jdk.vm.ci.code.Register) PlatformKind(jdk.vm.ci.meta.PlatformKind)

Example 3 with HotSpotLIRGenerator

use of org.graalvm.compiler.hotspot.HotSpotLIRGenerator in project graal by oracle.

the class BeginLockScopeNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    assert lockDepth != -1;
    HotSpotLIRGenerator hsGen = (HotSpotLIRGenerator) gen.getLIRGeneratorTool();
    VirtualStackSlot slot = hsGen.getLockSlot(lockDepth);
    Value result = gen.getLIRGeneratorTool().emitAddress(slot);
    gen.setResult(this, result);
}
Also used : HotSpotLIRGenerator(org.graalvm.compiler.hotspot.HotSpotLIRGenerator) Value(jdk.vm.ci.meta.Value) VirtualStackSlot(org.graalvm.compiler.lir.VirtualStackSlot)

Example 4 with HotSpotLIRGenerator

use of org.graalvm.compiler.hotspot.HotSpotLIRGenerator in project graal by oracle.

the class InitializeKlassStubCall method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    assert constant != null : "Expected the value to fold: " + value;
    Value stringValue = gen.operand(string);
    LIRFrameState fs = gen.state(this);
    assert fs != null : "Frame state should be set";
    assert constant instanceof HotSpotMetaspaceConstant;
    Value result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitKlassInitializationAndRetrieval(constant, stringValue, fs);
    gen.setResult(this, result);
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) HotSpotLIRGenerator(org.graalvm.compiler.hotspot.HotSpotLIRGenerator) Value(jdk.vm.ci.meta.Value) HotSpotMetaspaceConstant(jdk.vm.ci.hotspot.HotSpotMetaspaceConstant)

Example 5 with HotSpotLIRGenerator

use of org.graalvm.compiler.hotspot.HotSpotLIRGenerator 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)

Aggregations

HotSpotLIRGenerator (org.graalvm.compiler.hotspot.HotSpotLIRGenerator)10 Value (jdk.vm.ci.meta.Value)9 HotSpotMetaspaceConstant (jdk.vm.ci.hotspot.HotSpotMetaspaceConstant)4 HotSpotObjectConstant (jdk.vm.ci.hotspot.HotSpotObjectConstant)3 PermanentBailoutException (org.graalvm.compiler.core.common.PermanentBailoutException)3 LIRFrameState (org.graalvm.compiler.lir.LIRFrameState)3 VirtualStackSlot (org.graalvm.compiler.lir.VirtualStackSlot)2 Register (jdk.vm.ci.code.Register)1 PlatformKind (jdk.vm.ci.meta.PlatformKind)1