Search in sources :

Example 31 with Value

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

the class SPARCMove method stack2stack.

public static void stack2stack(CompilationResultBuilder crb, SPARCMacroAssembler masm, PlatformKind resultKind, PlatformKind inputKind, Value result, Value input, SPARCDelayedControlTransfer delaySlotLir) {
    try (ScratchRegister sc = masm.getScratchRegister()) {
        SPARCAddress inputAddress = (SPARCAddress) crb.asAddress(input);
        Value scratchRegisterValue = sc.getRegister().asValue(LIRKind.combine(input));
        emitLoad(crb, masm, inputAddress, scratchRegisterValue, false, inputKind, SPARCDelayedControlTransfer.DUMMY, null);
        SPARCAddress resultAddress = (SPARCAddress) crb.asAddress(result);
        emitStore(scratchRegisterValue, resultAddress, resultKind, delaySlotLir, null, crb, masm);
    }
}
Also used : ScratchRegister(org.graalvm.compiler.asm.sparc.SPARCMacroAssembler.ScratchRegister) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) SPARCAddress(org.graalvm.compiler.asm.sparc.SPARCAddress)

Example 32 with Value

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

the class AMD64VZeroUpper method initRegisterValues.

private static RegisterValue[] initRegisterValues(Value[] exclude) {
    BitSet skippedRegs = new BitSet();
    int numSkipped = 0;
    if (exclude != null) {
        for (Value value : exclude) {
            if (isRegister(value) && asRegister(value).getRegisterCategory().equals(AMD64.XMM)) {
                skippedRegs.set(asRegister(value).number);
                numSkipped++;
            }
        }
    }
    RegisterValue[] regs = new RegisterValue[AMD64.xmmRegistersAVX512.length - numSkipped];
    for (int i = 0, j = 0; i < AMD64.xmmRegistersAVX512.length; i++) {
        Register reg = AMD64.xmmRegistersAVX512[i];
        if (!skippedRegs.get(reg.number)) {
            regs[j++] = reg.asValue();
        }
    }
    return regs;
}
Also used : RegisterValue(jdk.vm.ci.code.RegisterValue) ValueUtil.isRegister(jdk.vm.ci.code.ValueUtil.isRegister) ValueUtil.asRegister(jdk.vm.ci.code.ValueUtil.asRegister) Register(jdk.vm.ci.code.Register) BitSet(java.util.BitSet) Value(jdk.vm.ci.meta.Value) RegisterValue(jdk.vm.ci.code.RegisterValue)

Example 33 with Value

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

the class LIRFrameState method processValues.

protected void processValues(LIRInstruction inst, JavaValue[] values, InstructionValueProcedure proc) {
    for (int i = 0; i < values.length; i++) {
        JavaValue value = values[i];
        if (isIllegalJavaValue(value)) {
            continue;
        }
        if (value instanceof AllocatableValue) {
            AllocatableValue allocatable = (AllocatableValue) value;
            Value result = proc.doValue(inst, allocatable, OperandMode.ALIVE, STATE_FLAGS);
            if (!allocatable.identityEquals(result)) {
                values[i] = (JavaValue) result;
            }
        } else if (value instanceof StackLockValue) {
            StackLockValue monitor = (StackLockValue) value;
            JavaValue owner = monitor.getOwner();
            if (owner instanceof AllocatableValue) {
                monitor.setOwner((JavaValue) proc.doValue(inst, (AllocatableValue) owner, OperandMode.ALIVE, STATE_FLAGS));
            }
            Value slot = monitor.getSlot();
            if (isVirtualStackSlot(slot)) {
                monitor.setSlot(asAllocatableValue(proc.doValue(inst, slot, OperandMode.ALIVE, STATE_FLAGS)));
            }
        } else {
            assert unprocessed(value);
        }
    }
}
Also used : JavaValue(jdk.vm.ci.meta.JavaValue) ValueUtil.isIllegalJavaValue(jdk.vm.ci.code.ValueUtil.isIllegalJavaValue) ValueUtil.isConstantJavaValue(jdk.vm.ci.code.ValueUtil.isConstantJavaValue) JavaValue(jdk.vm.ci.meta.JavaValue) StackLockValue(jdk.vm.ci.code.StackLockValue) ValueUtil.asAllocatableValue(jdk.vm.ci.code.ValueUtil.asAllocatableValue) ValueUtil.isIllegalJavaValue(jdk.vm.ci.code.ValueUtil.isIllegalJavaValue) Value(jdk.vm.ci.meta.Value) ValueUtil.isConstantJavaValue(jdk.vm.ci.code.ValueUtil.isConstantJavaValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) StackLockValue(jdk.vm.ci.code.StackLockValue) ValueUtil.asAllocatableValue(jdk.vm.ci.code.ValueUtil.asAllocatableValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 34 with Value

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

the class TraceLinearScanPhase method printFixedInterval.

private static void printFixedInterval(FixedInterval interval, IntervalVisitor visitor) {
    Value hint = null;
    AllocatableValue operand = interval.operand;
    String type = "fixed";
    visitor.visitIntervalStart(operand, operand, operand, hint, type);
    // print ranges
    for (FixedRange range = interval.first(); range != FixedRange.EndMarker; range = range.next) {
        visitor.visitRange(range.from, range.to);
    }
    // no use positions
    visitor.visitIntervalEnd("NOT_SUPPORTED");
}
Also used : Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) RegisterValue(jdk.vm.ci.code.RegisterValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 35 with Value

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

the class TraceLocalMoveResolver method blockRegisters.

// mark assignedReg and assignedRegHi of the interval as blocked
private void blockRegisters(TraceInterval interval) {
    Value location = interval.location();
    if (mightBeBlocked(location)) {
        assert areMultipleReadsAllowed() || valueBlocked(location) == 0 : "location already marked as used: " + location;
        int direction = 1;
        setValueBlocked(location, direction);
        debug.log("block %s", location);
    }
}
Also used : LIRValueUtil.isStackSlotValue(org.graalvm.compiler.lir.LIRValueUtil.isStackSlotValue) Value(jdk.vm.ci.meta.Value) 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