Search in sources :

Example 86 with AllocatableValue

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

the class LIRGenerator method zapArgumentSpace.

@Override
public LIRInstruction zapArgumentSpace() {
    List<StackSlot> slots = null;
    for (AllocatableValue arg : res.getCallingConvention().getArguments()) {
        if (isStackSlot(arg)) {
            if (slots == null) {
                slots = new ArrayList<>();
            }
            slots.add((StackSlot) arg);
        } else {
            assert !isVirtualStackSlot(arg);
        }
    }
    if (slots == null) {
        return null;
    }
    StackSlot[] zappedStack = slots.toArray(new StackSlot[slots.size()]);
    JavaConstant[] zapValues = new JavaConstant[zappedStack.length];
    for (int i = 0; i < zappedStack.length; i++) {
        PlatformKind kind = zappedStack[i].getPlatformKind();
        zapValues[i] = zapValueForKind(kind);
    }
    return createZapArgumentSpace(zappedStack, zapValues);
}
Also used : LIRValueUtil.isVirtualStackSlot(org.graalvm.compiler.lir.LIRValueUtil.isVirtualStackSlot) StackSlot(jdk.vm.ci.code.StackSlot) ValueUtil.isStackSlot(jdk.vm.ci.code.ValueUtil.isStackSlot) JavaConstant(jdk.vm.ci.meta.JavaConstant) PlatformKind(jdk.vm.ci.meta.PlatformKind) ValueUtil.asAllocatableValue(jdk.vm.ci.code.ValueUtil.asAllocatableValue) ValueUtil.isAllocatableValue(jdk.vm.ci.code.ValueUtil.isAllocatableValue) AllocatableValue(jdk.vm.ci.meta.AllocatableValue)

Example 87 with AllocatableValue

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

the class NodeLIRBuilder method visitInvokeArguments.

@Override
public Value[] visitInvokeArguments(CallingConvention invokeCc, Collection<ValueNode> arguments) {
    // for each argument, load it into the correct location
    Value[] result = new Value[arguments.size()];
    int j = 0;
    for (ValueNode arg : arguments) {
        if (arg != null) {
            AllocatableValue operand = invokeCc.getArgument(j);
            gen.emitMove(operand, operand(arg));
            result[j] = operand;
            j++;
        } else {
            throw GraalError.shouldNotReachHere("I thought we no longer have null entries for two-slot types...");
        }
    }
    return result;
}
Also used : ComplexMatchValue(org.graalvm.compiler.core.match.ComplexMatchValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) ValueNode(org.graalvm.compiler.nodes.ValueNode) 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