Commit 5dcd0808 authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

s390x: [liftoff] Implement PrepareTailCall

Change-Id: I440b3bdabddce862a45127df4c72846c1f5c7fdd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2808555Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/master@{#73828}
parent 9d33c4e6
......@@ -99,7 +99,25 @@ int LiftoffAssembler::PrepareStackFrame() {
void LiftoffAssembler::PrepareTailCall(int num_callee_stack_params,
int stack_param_delta) {
bailout(kUnsupportedArchitecture, "PrepareTailCall");
Register scratch = r1;
// Push the return address and frame pointer to complete the stack frame.
lay(sp, MemOperand(sp, -2 * kSystemPointerSize));
LoadU64(scratch, MemOperand(fp, kSystemPointerSize));
StoreU64(scratch, MemOperand(sp, kSystemPointerSize));
LoadU64(scratch, MemOperand(fp));
StoreU64(scratch, MemOperand(sp));
// Shift the whole frame upwards.
int slot_count = num_callee_stack_params + 2;
for (int i = slot_count - 1; i >= 0; --i) {
LoadU64(scratch, MemOperand(sp, i * kSystemPointerSize));
StoreU64(scratch,
MemOperand(fp, (i - stack_param_delta) * kSystemPointerSize));
}
// Set the new stack and frame pointer.
lay(sp, MemOperand(fp, -stack_param_delta * kSystemPointerSize));
Pop(r14, fp);
}
void LiftoffAssembler::AlignFrameSize() {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment