Commit 1608bf79 authored by Junliang Yan's avatar Junliang Yan Committed by V8 LUCI CQ

ppc: [liftoff] implement PrepareTailCall

Change-Id: If7a6bd6a39f24d016d8596bd107a912bdf9bd751
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3124811Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#76541}
parent 070acd2b
......@@ -106,7 +106,26 @@ int LiftoffAssembler::PrepareStackFrame() {
void LiftoffAssembler::PrepareTailCall(int num_callee_stack_params,
int stack_param_delta) {
bailout(kUnsupportedArchitecture, "PrepareTailCall");
Register scratch = ip;
// Push the return address and frame pointer to complete the stack frame.
AddS64(sp, sp, Operand(-2 * kSystemPointerSize), r0);
LoadU64(scratch, MemOperand(fp, kSystemPointerSize), r0);
StoreU64(scratch, MemOperand(sp, kSystemPointerSize), r0);
LoadU64(scratch, MemOperand(fp), r0);
StoreU64(scratch, MemOperand(sp), r0);
// 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), r0);
StoreU64(scratch,
MemOperand(fp, (i - stack_param_delta) * kSystemPointerSize), r0);
}
// Set the new stack and frame pointer.
AddS64(sp, fp, Operand(-stack_param_delta * kSystemPointerSize), r0);
Pop(r0, fp);
mtlr(r0);
}
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