Search in sources :

Example 46 with AllocatableValue

use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.

the class SPARCHotSpotLIRGenerator method emitReturn.

@Override
public void emitReturn(JavaKind javaKind, Value input) {
    AllocatableValue operand = Value.ILLEGAL;
    if (input != null) {
        operand = resultOperandFor(javaKind, input.getValueKind());
        emitMove(operand, input);
    }
    Register thread = getProviders().getRegisters().getThreadRegister();
    append(new SPARCHotSpotReturnOp(operand, getStub() != null, config, thread, getSafepointAddressValue()));
}
Also used : Register(jdk.vm.ci.code.Register) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 47 with AllocatableValue

use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.

the class SPARCHotSpotLIRGenerator method emitUncompress.

@Override
public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
    LIRKind inputKind = pointer.getValueKind(LIRKind.class);
    assert inputKind.getPlatformKind() == WORD;
    if (inputKind.isReference(0)) {
        // oop
        Variable result = newVariable(LIRKind.reference(XWORD));
        append(new SPARCHotSpotMove.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
        return result;
    } else {
        // metaspace pointer
        Variable result = newVariable(LIRKind.value(XWORD));
        AllocatableValue base = Value.ILLEGAL;
        if (encoding.hasBase()) {
            base = emitLoadConstant(LIRKind.value(XWORD), JavaConstant.forLong(encoding.getBase()));
        }
        append(new SPARCHotSpotMove.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull));
        return result;
    }
}
Also used : Variable(org.graalvm.compiler.lir.Variable) LIRKind(org.graalvm.compiler.core.common.LIRKind) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 48 with AllocatableValue

use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.

the class SPARCHotSpotNodeLIRBuilder method emitIndirectCall.

@Override
protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) {
    Value metaspaceMethodSrc = operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod());
    AllocatableValue metaspaceMethod = g5.asValue(metaspaceMethodSrc.getValueKind());
    gen.emitMove(metaspaceMethod, metaspaceMethodSrc);
    Value targetAddressSrc = operand(callTarget.computedAddress());
    AllocatableValue targetAddress = o7.asValue(targetAddressSrc.getValueKind());
    gen.emitMove(targetAddress, targetAddressSrc);
    append(new SPARCIndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethod, targetAddress, callState, getGen().config));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 49 with AllocatableValue

use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.

the class AMD64HotSpotLIRGenerator method beforeRegisterAllocation.

@Override
public void beforeRegisterAllocation() {
    super.beforeRegisterAllocation();
    boolean hasDebugInfo = getResult().getLIR().hasDebugInfo();
    AllocatableValue savedRbp = saveRbp.finalize(hasDebugInfo);
    if (hasDebugInfo) {
        getResult().setDeoptimizationRescueSlot(((AMD64FrameMapBuilder) getResult().getFrameMapBuilder()).allocateDeoptimizationRescueSlot());
    }
    getResult().setMaxInterpreterFrameSize(debugInfoBuilder.maxInterpreterFrameSize());
    for (AMD64HotSpotRestoreRbpOp op : epilogueOps) {
        op.setSavedRbp(savedRbp);
    }
    if (BenchmarkCounters.enabled) {
        // ensure that the rescue slot is available
        LIRInstruction op = getOrInitRescueSlotOp();
        // insert dummy instruction into the start block
        LIR lir = getResult().getLIR();
        ArrayList<LIRInstruction> instructions = lir.getLIRforBlock(lir.getControlFlowGraph().getStartBlock());
        instructions.add(1, op);
        lir.getDebug().dump(DebugContext.INFO_LEVEL, lir, "created rescue dummy op");
    }
}
Also used : LIR(org.graalvm.compiler.lir.LIR) LIRInstruction(org.graalvm.compiler.lir.LIRInstruction) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 50 with AllocatableValue

use of jdk.vm.ci.meta.AllocatableValue in project graal by oracle.

the class AMD64HotSpotLIRGenerator method emitReturn.

@Override
public void emitReturn(JavaKind kind, Value input) {
    AllocatableValue operand = Value.ILLEGAL;
    if (input != null) {
        operand = resultOperandFor(kind, input.getValueKind());
        emitMove(operand, input);
    }
    if (pollOnReturnScratchRegister == null) {
        pollOnReturnScratchRegister = findPollOnReturnScratchRegister();
    }
    Register thread = getProviders().getRegisters().getThreadRegister();
    append(new AMD64HotSpotReturnOp(operand, getStub() != null, thread, pollOnReturnScratchRegister, config));
}
Also used : Register(jdk.vm.ci.code.Register) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Aggregations

AllocatableValue (jdk.vm.ci.meta.AllocatableValue)87 Value (jdk.vm.ci.meta.Value)22 Variable (org.graalvm.compiler.lir.Variable)20 LIRKind (org.graalvm.compiler.core.common.LIRKind)13 LIRInstruction (org.graalvm.compiler.lir.LIRInstruction)11 Indent (org.graalvm.compiler.debug.Indent)10 RegisterValue (jdk.vm.ci.code.RegisterValue)9 ValueUtil.asAllocatableValue (jdk.vm.ci.code.ValueUtil.asAllocatableValue)8 DebugContext (org.graalvm.compiler.debug.DebugContext)8 Register (jdk.vm.ci.code.Register)6 JavaConstant (jdk.vm.ci.meta.JavaConstant)6 AMD64MathIntrinsicUnaryOp (org.graalvm.compiler.lir.amd64.AMD64MathIntrinsicUnaryOp)5 LIRValueUtil.asJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant)4 LIRValueUtil.isJavaConstant (org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant)4 ValueMoveOp (org.graalvm.compiler.lir.StandardOp.ValueMoveOp)4 ArithmeticLIRGenerator (org.graalvm.compiler.lir.gen.ArithmeticLIRGenerator)4 LIRGenerator (org.graalvm.compiler.lir.gen.LIRGenerator)4 SPARCAddressValue (org.graalvm.compiler.lir.sparc.SPARCAddressValue)4 AMD64Kind (jdk.vm.ci.amd64.AMD64Kind)3 ValueUtil.isAllocatableValue (jdk.vm.ci.code.ValueUtil.isAllocatableValue)3