Search in sources :

Example 51 with AllocatableValue

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

the class AMD64HotSpotNodeLIRBuilder method emitIndirectCall.

@Override
protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) {
    if (callTarget instanceof HotSpotIndirectCallTargetNode) {
        Value metaspaceMethodSrc = operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod());
        Value targetAddressSrc = operand(callTarget.computedAddress());
        AllocatableValue metaspaceMethodDst = AMD64.rbx.asValue(metaspaceMethodSrc.getValueKind());
        AllocatableValue targetAddressDst = AMD64.rax.asValue(targetAddressSrc.getValueKind());
        gen.emitMove(metaspaceMethodDst, metaspaceMethodSrc);
        gen.emitMove(targetAddressDst, targetAddressSrc);
        append(new AMD64IndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethodDst, targetAddressDst, callState, getGen().config));
    } else {
        super.emitIndirectCall(callTarget, result, parameters, temps, callState);
    }
}
Also used : HotSpotIndirectCallTargetNode(org.graalvm.compiler.hotspot.nodes.HotSpotIndirectCallTargetNode) 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 52 with AllocatableValue

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

the class WordCastNode method generate.

@Override
public void generate(NodeLIRBuilderTool generator) {
    Value value = generator.operand(input);
    ValueKind<?> kind = generator.getLIRGeneratorTool().getLIRKind(stamp(NodeView.DEFAULT));
    assert kind.getPlatformKind().getSizeInBytes() == value.getPlatformKind().getSizeInBytes();
    if (trackedPointer && LIRKind.isValue(kind) && !LIRKind.isValue(value)) {
        // just change the PlatformKind, but don't drop reference information
        kind = value.getValueKind().changeType(kind.getPlatformKind());
    }
    if (kind.equals(value.getValueKind()) && !(value instanceof ConstantValue)) {
        generator.setResult(this, value);
    } else {
        AllocatableValue result = generator.getLIRGeneratorTool().newVariable(kind);
        generator.getLIRGeneratorTool().emitMove(result, value);
        generator.setResult(this, result);
    }
}
Also used : ConstantValue(org.graalvm.compiler.lir.ConstantValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) ConstantValue(org.graalvm.compiler.lir.ConstantValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 53 with AllocatableValue

use of jdk.vm.ci.meta.AllocatableValue 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)

Example 54 with AllocatableValue

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

the class AArch64HotSpotLIRGenerator method emitCCall.

@Override
public void emitCCall(long address, CallingConvention nativeCallingConvention, Value[] args) {
    Value[] argLocations = new Value[args.length];
    getResult().getFrameMapBuilder().callsMethod(nativeCallingConvention);
    for (int i = 0; i < args.length; i++) {
        Value arg = args[i];
        AllocatableValue loc = nativeCallingConvention.getArgument(i);
        emitMove(loc, arg);
        argLocations[i] = loc;
    }
    Value ptr = emitLoadConstant(LIRKind.value(AArch64Kind.QWORD), JavaConstant.forLong(address));
    append(new AArch64CCall(nativeCallingConvention.getReturn(), ptr, argLocations));
}
Also used : AArch64CCall(org.graalvm.compiler.lir.aarch64.AArch64CCall) LIRValueUtil.isConstantValue(org.graalvm.compiler.lir.LIRValueUtil.isConstantValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) AArch64AddressValue(org.graalvm.compiler.lir.aarch64.AArch64AddressValue) RegisterValue(jdk.vm.ci.code.RegisterValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 55 with AllocatableValue

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

the class AArch64HotSpotNodeLIRBuilder method emitIndirectCall.

@Override
protected void emitIndirectCall(IndirectCallTargetNode callTarget, Value result, Value[] parameters, Value[] temps, LIRFrameState callState) {
    Value metaspaceMethodSrc = operand(((HotSpotIndirectCallTargetNode) callTarget).metaspaceMethod());
    Value targetAddressSrc = operand(callTarget.computedAddress());
    AllocatableValue metaspaceMethodDst = metaspaceMethodRegister.asValue(metaspaceMethodSrc.getValueKind());
    AllocatableValue targetAddressDst = inlineCacheRegister.asValue(targetAddressSrc.getValueKind());
    gen.emitMove(metaspaceMethodDst, metaspaceMethodSrc);
    gen.emitMove(targetAddressDst, targetAddressSrc);
    append(new AArch64IndirectCallOp(callTarget.targetMethod(), result, parameters, temps, metaspaceMethodDst, targetAddressDst, 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)

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