Search in sources :

Example 71 with AllocatableValue

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

the class SPARCIndexedAddressValue method forEachComponent.

@Override
public CompositeValue forEachComponent(LIRInstruction inst, OperandMode mode, InstructionValueProcedure proc) {
    AllocatableValue newBase = (AllocatableValue) proc.doValue(inst, base, mode, flags);
    AllocatableValue newIndex = (AllocatableValue) proc.doValue(inst, index, mode, flags);
    if (!base.identityEquals(newBase) || !index.identityEquals(newIndex)) {
        return new SPARCIndexedAddressValue(getValueKind(), newBase, newIndex);
    }
    return this;
}
Also used : AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 72 with AllocatableValue

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

the class LIRFrameState method visitValues.

protected void visitValues(LIRInstruction inst, JavaValue[] values, InstructionValueConsumer proc) {
    for (int i = 0; i < values.length; i++) {
        JavaValue value = values[i];
        if (isIllegalJavaValue(value)) {
            continue;
        } else if (value instanceof AllocatableValue) {
            proc.visitValue(inst, (AllocatableValue) value, OperandMode.ALIVE, STATE_FLAGS);
        } else if (value instanceof StackLockValue) {
            StackLockValue monitor = (StackLockValue) value;
            JavaValue owner = monitor.getOwner();
            if (owner instanceof AllocatableValue) {
                proc.visitValue(inst, (AllocatableValue) owner, OperandMode.ALIVE, STATE_FLAGS);
            }
            Value slot = monitor.getSlot();
            if (isVirtualStackSlot(slot)) {
                proc.visitValue(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) StackLockValue(jdk.vm.ci.code.StackLockValue) 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) ValueUtil.asAllocatableValue(jdk.vm.ci.code.ValueUtil.asAllocatableValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 73 with AllocatableValue

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

the class AArch64Move method stack2reg.

private static void stack2reg(CompilationResultBuilder crb, AArch64MacroAssembler masm, AllocatableValue result, AllocatableValue input) {
    AArch64Kind kind = (AArch64Kind) input.getPlatformKind();
    // use the slot kind to define the operand size
    final int size = kind.getSizeInBytes() * Byte.SIZE;
    if (kind.isInteger()) {
        AArch64Address src = loadStackSlotAddress(crb, masm, asStackSlot(input), result);
        masm.ldr(size, asRegister(result), src);
    } else {
        try (ScratchRegister sc = masm.getScratchRegister()) {
            AllocatableValue scratchRegisterValue = sc.getRegister().asValue(LIRKind.combine(input));
            AArch64Address src = loadStackSlotAddress(crb, masm, asStackSlot(input), scratchRegisterValue);
            masm.fldr(size, asRegister(result), src);
        }
    }
}
Also used : ScratchRegister(org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister) AArch64Kind(jdk.vm.ci.aarch64.AArch64Kind) AArch64Address(org.graalvm.compiler.asm.aarch64.AArch64Address) ValueUtil.asAllocatableValue(jdk.vm.ci.code.ValueUtil.asAllocatableValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 74 with AllocatableValue

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

the class AArch64AddressValue method forEachComponent.

@Override
public CompositeValue forEachComponent(LIRInstruction inst, LIRInstruction.OperandMode mode, InstructionValueProcedure proc) {
    AllocatableValue newBase = (AllocatableValue) proc.doValue(inst, base, mode, flags);
    AllocatableValue newOffset = (AllocatableValue) proc.doValue(inst, offset, mode, flags);
    if (!base.identityEquals(newBase) || !offset.identityEquals(newOffset)) {
        return new AArch64AddressValue(getValueKind(), newBase, newOffset, displacement, scaleFactor, addressingMode);
    }
    return this;
}
Also used : AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 75 with AllocatableValue

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

the class FloatingWordCastNode 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 (kind.equals(value.getValueKind())) {
        generator.setResult(this, value);
    } else {
        AllocatableValue result = generator.getLIRGeneratorTool().newVariable(kind);
        generator.getLIRGeneratorTool().emitMove(result, value);
        generator.setResult(this, result);
    }
}
Also used : 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