Search in sources :

Example 1 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.

the class AArch64HotSpotNodeLIRBuilder method visitSafepointNode.

@Override
public void visitSafepointNode(SafepointNode i) {
    LIRFrameState info = state(i);
    Register thread = getGen().getProviders().getRegisters().getThreadRegister();
    Variable scratch = gen.newVariable(LIRKind.value(getGen().target().arch.getWordKind()));
    append(new AArch64HotSpotSafepointOp(info, getGen().config, thread, scratch));
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) Variable(org.graalvm.compiler.lir.Variable) AArch64HotSpotRegisterConfig.inlineCacheRegister(jdk.vm.ci.hotspot.aarch64.AArch64HotSpotRegisterConfig.inlineCacheRegister) Register(jdk.vm.ci.code.Register) AArch64HotSpotRegisterConfig.metaspaceMethodRegister(jdk.vm.ci.hotspot.aarch64.AArch64HotSpotRegisterConfig.metaspaceMethodRegister)

Example 2 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState 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 3 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.

the class ResolveDynamicStubCall method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    assert constant != null : "Expected the value to fold: " + value;
    Value result;
    LIRFrameState fs = gen.state(this);
    assert fs != null : "The stateAfter is null";
    result = ((HotSpotLIRGenerator) gen.getLIRGeneratorTool()).emitResolveDynamicInvoke(constant, fs);
    gen.setResult(this, result);
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) Value(jdk.vm.ci.meta.Value)

Example 4 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.

the class HotSpotZapRegistersPhase method processBlock.

@SuppressWarnings("try")
private static void processBlock(DiagnosticLIRGeneratorTool diagnosticLirGenTool, HotSpotLIRGenerationResult res, LIR lir, LIRInsertionBuffer buffer, AbstractBlockBase<?> block, boolean zapRegisters, boolean zapStack) {
    DebugContext debug = lir.getDebug();
    try (Indent indent = debug.logAndIndent("Process block %s", block)) {
        ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(block);
        buffer.init(instructions);
        for (int index = 0; index < instructions.size(); index++) {
            LIRInstruction inst = instructions.get(index);
            if (zapStack && inst instanceof ZapStackArgumentSpaceBeforeInstruction) {
                LIRInstruction zap = diagnosticLirGenTool.zapArgumentSpace();
                if (zap != null) {
                    buffer.append(index, zap);
                }
            }
            if (zapRegisters && inst instanceof ZapRegistersAfterInstruction) {
                LIRFrameState state = getLIRState(inst);
                if (state != null) {
                    SaveRegistersOp zap = diagnosticLirGenTool.createZapRegisters();
                    SaveRegistersOp old = res.getCalleeSaveInfo().put(state, zap);
                    assert old == null : "Already another SaveRegisterOp registered! " + old;
                    buffer.append(index + 1, (LIRInstruction) zap);
                    debug.log("Insert ZapRegister after %s", inst);
                }
            }
        }
        buffer.finish();
    }
}
Also used : LIRFrameState(org.graalvm.compiler.lir.LIRFrameState) Indent(org.graalvm.compiler.debug.Indent) ZapRegistersAfterInstruction(org.graalvm.compiler.lir.gen.DiagnosticLIRGeneratorTool.ZapRegistersAfterInstruction) ZapStackArgumentSpaceBeforeInstruction(org.graalvm.compiler.lir.gen.DiagnosticLIRGeneratorTool.ZapStackArgumentSpaceBeforeInstruction) LIRInstruction(org.graalvm.compiler.lir.LIRInstruction) DebugContext(org.graalvm.compiler.debug.DebugContext) SaveRegistersOp(org.graalvm.compiler.lir.StandardOp.SaveRegistersOp)

Example 5 with LIRFrameState

use of org.graalvm.compiler.lir.LIRFrameState in project graal by oracle.

the class AMD64NodeMatchRules method emitReinterpretMemory.

private Value emitReinterpretMemory(LIRKind to, Access access) {
    AMD64AddressValue address = (AMD64AddressValue) operand(access.getAddress());
    LIRFrameState state = getState(access);
    return getArithmeticLIRGenerator().emitLoad(to, address, state);
}
Also used : AMD64AddressValue(org.graalvm.compiler.lir.amd64.AMD64AddressValue) LIRFrameState(org.graalvm.compiler.lir.LIRFrameState)

Aggregations

LIRFrameState (org.graalvm.compiler.lir.LIRFrameState)33 GraalCompilerTest (org.graalvm.compiler.core.test.GraalCompilerTest)15 Test (org.junit.Test)15 Register (jdk.vm.ci.code.Register)7 Value (jdk.vm.ci.meta.Value)7 VirtualObject (jdk.vm.ci.code.VirtualObject)5 Variable (org.graalvm.compiler.lir.Variable)5 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)4 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)3 DebugContext (org.graalvm.compiler.debug.DebugContext)3 HotSpotForeignCallLinkage (org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage)3 HotSpotLIRGenerator (org.graalvm.compiler.hotspot.HotSpotLIRGenerator)3 SaveRegistersOp (org.graalvm.compiler.lir.StandardOp.SaveRegistersOp)3 BytecodeFrame (jdk.vm.ci.code.BytecodeFrame)2 CallingConvention (jdk.vm.ci.code.CallingConvention)2 HotSpotMetaspaceConstant (jdk.vm.ci.hotspot.HotSpotMetaspaceConstant)2 JavaValue (jdk.vm.ci.meta.JavaValue)2 HotSpotLIRGenerationResult (org.graalvm.compiler.hotspot.HotSpotLIRGenerationResult)2 HotSpotRegistersProvider (org.graalvm.compiler.hotspot.meta.HotSpotRegistersProvider)2 Stub (org.graalvm.compiler.hotspot.stubs.Stub)2