Search in sources :

Example 11 with LIRGeneratorTool

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

the class DeoptimizeNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    LIRGeneratorTool tool = gen.getLIRGeneratorTool();
    Value actionAndReason = tool.emitJavaConstant(tool.getMetaAccess().encodeDeoptActionAndReason(action, reason, getDebugId()));
    Value speculationValue = tool.emitJavaConstant(speculation);
    gen.getLIRGeneratorTool().emitDeoptimize(actionAndReason, speculationValue, gen.state(this));
}
Also used : Value(jdk.vm.ci.meta.Value) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Example 12 with LIRGeneratorTool

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

the class CompressionNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    boolean nonNull;
    if (value.stamp(NodeView.DEFAULT) instanceof AbstractObjectStamp) {
        nonNull = StampTool.isPointerNonNull(value.stamp(NodeView.DEFAULT));
    } else {
        // metaspace pointers are never null
        nonNull = true;
    }
    LIRGeneratorTool tool = gen.getLIRGeneratorTool();
    Value result;
    switch(op) {
        case Compress:
            result = tool.emitCompress(gen.operand(value), encoding, nonNull);
            break;
        case Uncompress:
            result = tool.emitUncompress(gen.operand(value), encoding, nonNull);
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    gen.setResult(this, result);
}
Also used : Value(jdk.vm.ci.meta.Value) AbstractObjectStamp(org.graalvm.compiler.core.common.type.AbstractObjectStamp) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Example 13 with LIRGeneratorTool

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

the class DynamicCounterNode method generate.

@Override
public void generate(NodeLIRBuilderTool generator) {
    LIRGeneratorTool lirGen = generator.getLIRGeneratorTool();
    String nameWithContext;
    if (isWithContext()) {
        nameWithContext = getName() + " @ ";
        if (graph().method() != null) {
            StackTraceElement stackTraceElement = graph().method().asStackTraceElement(0);
            if (stackTraceElement != null) {
                nameWithContext += " " + stackTraceElement.toString();
            } else {
                nameWithContext += graph().method().format("%h.%n");
            }
        }
        if (graph().name != null) {
            nameWithContext += " (" + graph().name + ")";
        }
    } else {
        nameWithContext = getName();
    }
    LIRInstruction counterOp = lirGen.createBenchmarkCounter(nameWithContext, getGroup(), generator.operand(increment));
    if (counterOp != null) {
        lirGen.append(counterOp);
    } else {
        throw GraalError.unimplemented("Benchmark counters not enabled or not implemented by the back end.");
    }
}
Also used : LIRInstruction(org.graalvm.compiler.lir.LIRInstruction) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Example 14 with LIRGeneratorTool

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

the class ExceptionStateNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    LIRGeneratorTool lirGenTool = gen.getLIRGeneratorTool();
    Value returnRegister = lirGenTool.getRegisterConfig().getReturnRegister(getStackKind()).asValue(LIRKind.fromJavaKind(lirGenTool.target().arch, getStackKind()));
    lirGenTool.emitIncomingValues(new Value[] { returnRegister });
    gen.setResult(this, lirGenTool.emitMove(returnRegister));
}
Also used : Value(jdk.vm.ci.meta.Value) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Example 15 with LIRGeneratorTool

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

the class WriteCurrentVMThreadNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    LIRGeneratorTool tool = gen.getLIRGeneratorTool();
    SubstrateRegisterConfig registerConfig = (SubstrateRegisterConfig) tool.getRegisterConfig();
    gen.getLIRGeneratorTool().emitMove(registerConfig.getThreadRegister().asValue(tool.getLIRKind(FrameAccess.getWordStamp())), gen.operand(value));
}
Also used : SubstrateRegisterConfig(com.oracle.svm.core.graal.meta.SubstrateRegisterConfig) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Aggregations

LIRGeneratorTool (org.graalvm.compiler.lir.gen.LIRGeneratorTool)18 Value (jdk.vm.ci.meta.Value)5 LIRKind (org.graalvm.compiler.core.common.LIRKind)5 SubstrateRegisterConfig (com.oracle.svm.core.graal.meta.SubstrateRegisterConfig)4 RegisterValue (jdk.vm.ci.code.RegisterValue)4 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)3 SubstrateLIRGenerator (com.oracle.svm.core.graal.code.SubstrateLIRGenerator)1 BitSet (java.util.BitSet)1 LIRGenerationContext (org.graalvm.compiler.core.LIRGenerationPhase.LIRGenerationContext)1 AbstractBlockBase (org.graalvm.compiler.core.common.cfg.AbstractBlockBase)1 AbstractObjectStamp (org.graalvm.compiler.core.common.type.AbstractObjectStamp)1 DebugCloseable (org.graalvm.compiler.debug.DebugCloseable)1 DebugContext (org.graalvm.compiler.debug.DebugContext)1 LIR (org.graalvm.compiler.lir.LIR)1 LIRInstruction (org.graalvm.compiler.lir.LIRInstruction)1 VirtualStackSlot (org.graalvm.compiler.lir.VirtualStackSlot)1 AArch64AddressValue (org.graalvm.compiler.lir.aarch64.AArch64AddressValue)1 AMD64AddressValue (org.graalvm.compiler.lir.amd64.AMD64AddressValue)1 FrameMapBuilder (org.graalvm.compiler.lir.framemap.FrameMapBuilder)1 LIRGenerationResult (org.graalvm.compiler.lir.gen.LIRGenerationResult)1