Search in sources :

Example 31 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class AMD64HotSpotLIRGenerator method emitLoadMetaspaceAddress.

@Override
public Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
    HotSpotMetaspaceConstant metaspaceConstant = (HotSpotMetaspaceConstant) constant;
    LIRKind kind = metaspaceConstant.isCompressed() ? getLIRKindTool().getNarrowPointerKind() : getLIRKindTool().getWordKind();
    Variable result = newVariable(kind);
    append(new AMD64HotSpotLoadAddressOp(result, constant, action));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) LIRKind(org.graalvm.compiler.core.common.LIRKind) HotSpotMetaspaceConstant(jdk.vm.ci.hotspot.HotSpotMetaspaceConstant)

Example 32 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class AMD64HotSpotLIRGenerator method emitLoadObjectAddress.

@Override
public Value emitLoadObjectAddress(Constant constant) {
    HotSpotObjectConstant objectConstant = (HotSpotObjectConstant) constant;
    LIRKind kind = objectConstant.isCompressed() ? getLIRKindTool().getNarrowOopKind() : getLIRKindTool().getObjectKind();
    Variable result = newVariable(kind);
    append(new AMD64HotSpotLoadAddressOp(result, constant, HotSpotConstantLoadAction.RESOLVE));
    return result;
}
Also used : Variable(org.graalvm.compiler.lir.Variable) LIRKind(org.graalvm.compiler.core.common.LIRKind) HotSpotObjectConstant(jdk.vm.ci.hotspot.HotSpotObjectConstant)

Example 33 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class AMD64HotSpotLIRGenerator method emitNullCheck.

@Override
public void emitNullCheck(Value address, LIRFrameState state) {
    if (address.getValueKind().getPlatformKind() == getLIRKindTool().getNarrowOopKind().getPlatformKind()) {
        CompressEncoding encoding = config.getOopEncoding();
        Value uncompressed;
        if (encoding.getShift() <= 3) {
            LIRKind wordKind = LIRKind.unknownReference(target().arch.getWordKind());
            uncompressed = new AMD64AddressValue(wordKind, getProviders().getRegisters().getHeapBaseRegister().asValue(wordKind), asAllocatable(address), Scale.fromInt(1 << encoding.getShift()), 0);
        } else {
            uncompressed = emitUncompress(address, encoding, false);
        }
        append(new AMD64Move.NullCheckOp(asAddressValue(uncompressed), state));
        return;
    }
    super.emitNullCheck(address, state);
}
Also used : AMD64AddressValue(org.graalvm.compiler.lir.amd64.AMD64AddressValue) CompressEncoding(org.graalvm.compiler.core.common.CompressEncoding) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) RegisterValue(jdk.vm.ci.code.RegisterValue) AMD64AddressValue(org.graalvm.compiler.lir.amd64.AMD64AddressValue) LIRKind(org.graalvm.compiler.core.common.LIRKind) AMD64Move(org.graalvm.compiler.lir.amd64.AMD64Move)

Example 34 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class AArch64HotSpotLIRGenerator method moveValueToThread.

private void moveValueToThread(Value value, int offset) {
    LIRKind wordKind = LIRKind.value(target().arch.getWordKind());
    RegisterValue thread = getProviders().getRegisters().getThreadRegister().asValue(wordKind);
    final int transferSize = value.getValueKind().getPlatformKind().getSizeInBytes();
    AArch64AddressValue address = new AArch64AddressValue(value.getValueKind(), thread, Value.ILLEGAL, offset, transferSize, AddressingMode.IMMEDIATE_SCALED);
    append(new StoreOp((AArch64Kind) value.getPlatformKind(), address, loadReg(value), null));
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) StoreOp(org.graalvm.compiler.lir.aarch64.AArch64Move.StoreOp) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) LIRKind(org.graalvm.compiler.core.common.LIRKind)

Example 35 with LIRKind

use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.

the class AArch64HotSpotLIRGenerator method emitUncompress.

@Override
public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) {
    LIRKind inputKind = pointer.getValueKind(LIRKind.class);
    assert inputKind.getPlatformKind() == AArch64Kind.DWORD;
    if (inputKind.isReference(0)) {
        // oop
        Variable result = newVariable(LIRKind.reference(AArch64Kind.QWORD));
        append(new AArch64HotSpotMove.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull));
        return result;
    } else {
        // metaspace pointer
        Variable result = newVariable(LIRKind.value(AArch64Kind.QWORD));
        AllocatableValue base = Value.ILLEGAL;
        if (encoding.hasBase()) {
            base = emitLoadConstant(LIRKind.value(AArch64Kind.QWORD), JavaConstant.forLong(encoding.getBase()));
        }
        append(new AArch64HotSpotMove.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)

Aggregations

LIRKind (org.graalvm.compiler.core.common.LIRKind)60 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)20 Variable (org.graalvm.compiler.lir.Variable)19 Value (jdk.vm.ci.meta.Value)15 RegisterValue (jdk.vm.ci.code.RegisterValue)11 TargetDescription (jdk.vm.ci.code.TargetDescription)7 PlatformKind (jdk.vm.ci.meta.PlatformKind)7 LIRGeneratorTool (org.graalvm.compiler.lir.gen.LIRGeneratorTool)7 AMD64Kind (jdk.vm.ci.amd64.AMD64Kind)6 JavaConstant (jdk.vm.ci.meta.JavaConstant)4 SPARCKind (jdk.vm.ci.sparc.SPARCKind)4 ComplexMatchValue (org.graalvm.compiler.core.match.ComplexMatchValue)4 AArch64AddressValue (org.graalvm.compiler.lir.aarch64.AArch64AddressValue)4 AMD64AddressValue (org.graalvm.compiler.lir.amd64.AMD64AddressValue)4 ComplexMatchResult (org.graalvm.compiler.core.match.ComplexMatchResult)3 MatchRule (org.graalvm.compiler.core.match.MatchRule)3 ConstantValue (org.graalvm.compiler.lir.ConstantValue)3 AMD64MulDivOp (org.graalvm.compiler.lir.amd64.AMD64MulDivOp)3 SubstrateRegisterConfig (com.oracle.svm.core.graal.meta.SubstrateRegisterConfig)2 Op3s (org.graalvm.compiler.asm.sparc.SPARCAssembler.Op3s)2