Search in sources :

Example 21 with StackSlot

use of jdk.vm.ci.code.StackSlot in project graal by oracle.

the class NodeLIRBuilder method emitPrologue.

protected void emitPrologue(StructuredGraph graph) {
    CallingConvention incomingArguments = gen.getResult().getCallingConvention();
    Value[] params = new Value[incomingArguments.getArgumentCount()];
    for (int i = 0; i < params.length; i++) {
        params[i] = incomingArguments.getArgument(i);
        if (ValueUtil.isStackSlot(params[i])) {
            StackSlot slot = ValueUtil.asStackSlot(params[i]);
            if (slot.isInCallerFrame() && !gen.getResult().getLIR().hasArgInCallerFrame()) {
                gen.getResult().getLIR().setHasArgInCallerFrame();
            }
        }
    }
    gen.emitIncomingValues(params);
    for (ParameterNode param : graph.getNodes(ParameterNode.TYPE)) {
        Value paramValue = params[param.index()];
        assert paramValue.getValueKind().equals(getLIRGeneratorTool().getLIRKind(param.stamp(NodeView.DEFAULT))) : paramValue + " " + getLIRGeneratorTool().getLIRKind(param.stamp(NodeView.DEFAULT));
        setResult(param, gen.emitMove(paramValue));
    }
}
Also used : CallingConvention(jdk.vm.ci.code.CallingConvention) ParameterNode(org.graalvm.compiler.nodes.ParameterNode) ComplexMatchValue(org.graalvm.compiler.core.match.ComplexMatchValue) Value(jdk.vm.ci.meta.Value) AllocatableValue(jdk.vm.ci.meta.AllocatableValue) StackSlot(jdk.vm.ci.code.StackSlot)

Aggregations

StackSlot (jdk.vm.ci.code.StackSlot)21 ValueUtil.isStackSlot (jdk.vm.ci.code.ValueUtil.isStackSlot)8 Register (jdk.vm.ci.code.Register)6 ValueUtil.asStackSlot (jdk.vm.ci.code.ValueUtil.asStackSlot)6 AllocatableValue (jdk.vm.ci.meta.AllocatableValue)5 Value (jdk.vm.ci.meta.Value)4 DebugContext (org.graalvm.compiler.debug.DebugContext)4 CallingConvention (jdk.vm.ci.code.CallingConvention)3 RegisterValue (jdk.vm.ci.code.RegisterValue)3 ValueUtil.asRegister (jdk.vm.ci.code.ValueUtil.asRegister)3 JavaConstant (jdk.vm.ci.meta.JavaConstant)3 Assembler (org.graalvm.compiler.asm.Assembler)3 LIRValueUtil.isVirtualStackSlot (org.graalvm.compiler.lir.LIRValueUtil.isVirtualStackSlot)3 VirtualStackSlot (org.graalvm.compiler.lir.VirtualStackSlot)3 ParameterNode (org.graalvm.compiler.nodes.ParameterNode)3 RegisterSaveLayout (jdk.vm.ci.code.RegisterSaveLayout)2 ValueUtil.asAllocatableValue (jdk.vm.ci.code.ValueUtil.asAllocatableValue)2 Infopoint (jdk.vm.ci.code.site.Infopoint)2 ScratchRegister (org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister)2 HotSpotDataBuilder (org.graalvm.compiler.hotspot.HotSpotDataBuilder)2