Search in sources :

Example 76 with Value

use of jdk.vm.ci.meta.Value 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 77 with Value

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

the class AArch64HotSpotLIRGenerator method emitDeoptimizeCaller.

@Override
public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) {
    Value actionAndReason = emitJavaConstant(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0));
    Value nullValue = emitConstant(LIRKind.reference(AArch64Kind.QWORD), JavaConstant.NULL_POINTER);
    moveDeoptValuesToThread(actionAndReason, nullValue);
    append(new AArch64HotSpotDeoptimizeCallerOp(config));
}
Also used : 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)

Example 78 with Value

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

the class AArch64HotSpotLIRGenerator method emitCompareBranch.

@Override
public void emitCompareBranch(PlatformKind cmpKind, Value x, Value y, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination, double trueDestinationProbability) {
    Value localX = x;
    Value localY = y;
    if (localX instanceof HotSpotObjectConstant) {
        localX = load(localX);
    }
    if (localY instanceof HotSpotObjectConstant) {
        localY = load(localY);
    }
    super.emitCompareBranch(cmpKind, localX, localY, cond, unorderedIsTrue, trueDestination, falseDestination, trueDestinationProbability);
}
Also used : 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) HotSpotObjectConstant(jdk.vm.ci.hotspot.HotSpotObjectConstant)

Example 79 with Value

use of jdk.vm.ci.meta.Value 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 80 with Value

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

Value (jdk.vm.ci.meta.Value)151 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)76 RegisterValue (jdk.vm.ci.code.RegisterValue)33 LIRKind (org.graalvm.compiler.core.common.LIRKind)18 LIRInstruction (org.graalvm.compiler.lir.LIRInstruction)14 LIRValueUtil.isConstantValue (org.graalvm.compiler.lir.LIRValueUtil.isConstantValue)14 LIRValueUtil.isStackSlotValue (org.graalvm.compiler.lir.LIRValueUtil.isStackSlotValue)14 OperandMode (org.graalvm.compiler.lir.LIRInstruction.OperandMode)12 Variable (org.graalvm.compiler.lir.Variable)12 ComplexMatchValue (org.graalvm.compiler.core.match.ComplexMatchValue)11 Indent (org.graalvm.compiler.debug.Indent)11 EnumSet (java.util.EnumSet)10 DebugContext (org.graalvm.compiler.debug.DebugContext)10 GraalError (org.graalvm.compiler.debug.GraalError)10 LIRFrameState (org.graalvm.compiler.lir.LIRFrameState)10 BitSet (java.util.BitSet)9 Register (jdk.vm.ci.code.Register)9 ConstantValue (org.graalvm.compiler.lir.ConstantValue)9 SPARCAddressValue (org.graalvm.compiler.lir.sparc.SPARCAddressValue)9 ValueNode (org.graalvm.compiler.nodes.ValueNode)9