Search in sources :

Example 56 with Value

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

the class SPARCHotSpotBackendFactory method createNativeABICallerSaveRegisters.

@SuppressWarnings("unused")
private static Value[] createNativeABICallerSaveRegisters(GraalHotSpotVMConfig config, RegisterConfig regConfig) {
    Set<Register> callerSavedRegisters = new HashSet<>();
    SPARC.fpusRegisters.addTo(callerSavedRegisters);
    SPARC.fpudRegisters.addTo(callerSavedRegisters);
    callerSavedRegisters.add(SPARC.g1);
    callerSavedRegisters.add(SPARC.g4);
    callerSavedRegisters.add(SPARC.g5);
    Value[] nativeABICallerSaveRegisters = new Value[callerSavedRegisters.size()];
    int i = 0;
    for (Register reg : callerSavedRegisters) {
        nativeABICallerSaveRegisters[i] = reg.asValue();
        i++;
    }
    return nativeABICallerSaveRegisters;
}
Also used : Register(jdk.vm.ci.code.Register) Value(jdk.vm.ci.meta.Value) HashSet(java.util.HashSet)

Example 57 with Value

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

the class SPARCHotSpotLIRGenerator method emitNullCheck.

@Override
public void emitNullCheck(Value address, LIRFrameState state) {
    PlatformKind kind = address.getPlatformKind();
    if (kind == WORD) {
        CompressEncoding encoding = config.getOopEncoding();
        Value uncompressed = emitUncompress(address, encoding, false);
        append(new NullCheckOp(asAddressValue(uncompressed), state));
    } else {
        super.emitNullCheck(address, state);
    }
}
Also used : NullCheckOp(org.graalvm.compiler.lir.sparc.SPARCMove.NullCheckOp) CompressEncoding(org.graalvm.compiler.core.common.CompressEncoding) LIRValueUtil.isConstantValue(org.graalvm.compiler.lir.LIRValueUtil.isConstantValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) SPARCImmediateAddressValue(org.graalvm.compiler.lir.sparc.SPARCImmediateAddressValue) RegisterValue(jdk.vm.ci.code.RegisterValue) SPARCAddressValue(org.graalvm.compiler.lir.sparc.SPARCAddressValue) PlatformKind(jdk.vm.ci.meta.PlatformKind)

Example 58 with Value

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

the class SPARCHotSpotLIRGenerator method emitDeoptimizeCaller.

@Override
public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) {
    Value actionAndReason = emitJavaConstant(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0));
    Value nullValue = emitJavaConstant(JavaConstant.NULL_POINTER);
    moveDeoptValuesToThread(actionAndReason, nullValue);
    append(new SPARCHotSpotDeoptimizeCallerOp());
}
Also used : LIRValueUtil.isConstantValue(org.graalvm.compiler.lir.LIRValueUtil.isConstantValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) SPARCImmediateAddressValue(org.graalvm.compiler.lir.sparc.SPARCImmediateAddressValue) RegisterValue(jdk.vm.ci.code.RegisterValue) SPARCAddressValue(org.graalvm.compiler.lir.sparc.SPARCAddressValue)

Example 59 with Value

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

the class SPARCHotSpotLIRGenerator 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) SPARCImmediateAddressValue(org.graalvm.compiler.lir.sparc.SPARCImmediateAddressValue) RegisterValue(jdk.vm.ci.code.RegisterValue) SPARCAddressValue(org.graalvm.compiler.lir.sparc.SPARCAddressValue) HotSpotObjectConstant(jdk.vm.ci.hotspot.HotSpotObjectConstant)

Example 60 with Value

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

the class SPARCHotSpotNodeLIRBuilder method visitBreakpointNode.

@Override
public void visitBreakpointNode(BreakpointNode node) {
    JavaType[] sig = new JavaType[node.arguments().size()];
    for (int i = 0; i < sig.length; i++) {
        sig[i] = node.arguments().get(i).stamp(NodeView.DEFAULT).javaType(gen.getMetaAccess());
    }
    Value[] parameters = visitInvokeArguments(gen.getRegisterConfig().getCallingConvention(HotSpotCallingConventionType.JavaCall, null, sig, gen), node.arguments());
    append(new SPARCBreakpointOp(parameters));
}
Also used : JavaType(jdk.vm.ci.meta.JavaType) RegisterValue(jdk.vm.ci.code.RegisterValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) SPARCBreakpointOp(org.graalvm.compiler.lir.sparc.SPARCBreakpointOp)

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