Search in sources :

Example 1 with LIRGeneratorTool

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

the class LogicCompareAndSwapNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    assert getNewValue().stamp(NodeView.DEFAULT).isCompatible(getExpectedValue().stamp(NodeView.DEFAULT));
    assert !this.canDeoptimize();
    LIRGeneratorTool tool = gen.getLIRGeneratorTool();
    LIRKind resultKind = tool.getLIRKind(stamp(NodeView.DEFAULT));
    Value trueResult = tool.emitConstant(resultKind, JavaConstant.TRUE);
    Value falseResult = tool.emitConstant(resultKind, JavaConstant.FALSE);
    Value result = tool.emitLogicCompareAndSwap(gen.operand(getAddress()), gen.operand(getExpectedValue()), gen.operand(getNewValue()), trueResult, falseResult);
    gen.setResult(this, result);
}
Also used : Value(jdk.vm.ci.meta.Value) LIRKind(org.graalvm.compiler.core.common.LIRKind) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Example 2 with LIRGeneratorTool

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

the class WriteStackPointerNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    LIRGeneratorTool tool = gen.getLIRGeneratorTool();
    RegisterValue target = tool.getRegisterConfig().getFrameRegister().asValue(tool.getLIRKind(FrameAccess.getWordStamp()));
    gen.getLIRGeneratorTool().emitMove(target, gen.operand(value));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Example 3 with LIRGeneratorTool

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

the class FarReturnLoweredNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    LIRGeneratorTool lirGenTool = gen.getLIRGeneratorTool();
    AllocatableValue resultOperand = lirGenTool.resultOperandFor(result.getStackKind(), LIRKind.fromJavaKind(lirGenTool.target().arch, result.getStackKind()));
    lirGenTool.emitMove(resultOperand, gen.operand(result));
    ((SubstrateLIRGenerator) lirGenTool).emitFarReturn(resultOperand, gen.operand(sp), gen.operand(ip));
}
Also used : SubstrateLIRGenerator(com.oracle.svm.core.graal.code.SubstrateLIRGenerator) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 4 with LIRGeneratorTool

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

the class ReadRegisterFloatingNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    VMError.guarantee(usages().filter(FrameState.class).isEmpty(), "When used in a FrameState, need a ReadRegisterFixedNode and not a ReadRegisterFloatingNode");
    LIRGeneratorTool tool = gen.getLIRGeneratorTool();
    SubstrateRegisterConfig registerConfig = (SubstrateRegisterConfig) tool.getRegisterConfig();
    LIRKind lirKind = tool.getLIRKind(FrameAccess.getWordStamp());
    RegisterValue value = registerSupplier.apply(registerConfig).asValue(lirKind);
    gen.setResult(this, value);
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) LIRKind(org.graalvm.compiler.core.common.LIRKind) SubstrateRegisterConfig(com.oracle.svm.core.graal.meta.SubstrateRegisterConfig) LIRGeneratorTool(org.graalvm.compiler.lir.gen.LIRGeneratorTool)

Example 5 with LIRGeneratorTool

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

the class ReadStackPointerNode method generate.

@Override
public void generate(NodeLIRBuilderTool gen) {
    LIRGeneratorTool tool = gen.getLIRGeneratorTool();
    RegisterValue input = tool.getRegisterConfig().getFrameRegister().asValue(tool.getLIRKind(FrameAccess.getWordStamp()));
    gen.setResult(this, tool.emitMove(input));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) 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