Commit d5212940 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

PPC/s390: [codegen] Remove PrepareForTailCall

Port ec717160

Original Commit Message:

    This is no longer used, tail calls are dealt with inside of
    VisiTailCall.

R=zhin@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I44cac6f77ce79d47806b3f504c3bad1d88475a25
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3055307Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#75945}
parent 98ddfe77
...@@ -1385,54 +1385,6 @@ void TurboAssembler::MovFromFloatParameter(const DoubleRegister dst) { ...@@ -1385,54 +1385,6 @@ void TurboAssembler::MovFromFloatParameter(const DoubleRegister dst) {
Move(dst, d1); Move(dst, d1);
} }
void TurboAssembler::PrepareForTailCall(Register callee_args_count,
Register caller_args_count,
Register scratch0, Register scratch1) {
DCHECK(!AreAliased(callee_args_count, caller_args_count, scratch0, scratch1));
// Calculate the end of destination area where we will put the arguments
// after we drop current frame. We add kSystemPointerSize to count the
// receiver argument which is not included into formal parameters count.
Register dst_reg = scratch0;
ShiftLeftU64(dst_reg, caller_args_count, Operand(kSystemPointerSizeLog2));
add(dst_reg, fp, dst_reg);
AddS64(dst_reg, dst_reg,
Operand(StandardFrameConstants::kCallerSPOffset + kSystemPointerSize),
scratch0);
Register src_reg = caller_args_count;
// Calculate the end of source area. +kSystemPointerSize is for the receiver.
ShiftLeftU64(src_reg, callee_args_count, Operand(kSystemPointerSizeLog2));
add(src_reg, sp, src_reg);
AddS64(src_reg, src_reg, Operand(kSystemPointerSize), scratch0);
if (FLAG_debug_code) {
CmpU64(src_reg, dst_reg);
Check(lt, AbortReason::kStackAccessBelowStackPointer);
}
// Restore caller's frame pointer and return address now as they will be
// overwritten by the copying loop.
RestoreFrameStateForTailCall();
// Now copy callee arguments to the caller frame going backwards to avoid
// callee arguments corruption (source and destination areas could overlap).
// Both src_reg and dst_reg are pointing to the word after the one to copy,
// so they must be pre-decremented in the loop.
Register tmp_reg = scratch1;
Label loop;
addi(tmp_reg, callee_args_count, Operand(1)); // +1 for receiver
mtctr(tmp_reg);
bind(&loop);
LoadU64WithUpdate(tmp_reg, MemOperand(src_reg, -kSystemPointerSize));
StoreU64WithUpdate(tmp_reg, MemOperand(dst_reg, -kSystemPointerSize));
bdnz(&loop);
// Leave current frame.
mr(sp, dst_reg);
}
void MacroAssembler::LoadStackLimit(Register destination, StackLimitKind kind) { void MacroAssembler::LoadStackLimit(Register destination, StackLimitKind kind) {
DCHECK(root_array_available()); DCHECK(root_array_available());
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
......
...@@ -419,10 +419,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { ...@@ -419,10 +419,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
Register scratch); Register scratch);
void PrepareCallCFunction(int num_reg_arguments, Register scratch); void PrepareCallCFunction(int num_reg_arguments, Register scratch);
void PrepareForTailCall(Register callee_args_count,
Register caller_args_count, Register scratch0,
Register scratch1);
// There are two ways of passing double arguments on ARM, depending on // There are two ways of passing double arguments on ARM, depending on
// whether soft or hard floating point ABI is used. These functions // whether soft or hard floating point ABI is used. These functions
// abstract parameter passing for the three different ways we call // abstract parameter passing for the three different ways we call
......
...@@ -1578,55 +1578,6 @@ void TurboAssembler::MovFromFloatParameter(const DoubleRegister dst) { ...@@ -1578,55 +1578,6 @@ void TurboAssembler::MovFromFloatParameter(const DoubleRegister dst) {
Move(dst, d0); Move(dst, d0);
} }
void TurboAssembler::PrepareForTailCall(Register callee_args_count,
Register caller_args_count,
Register scratch0, Register scratch1) {
DCHECK(!AreAliased(callee_args_count, caller_args_count, scratch0, scratch1));
// Calculate the end of destination area where we will put the arguments
// after we drop current frame. We AddS64 kSystemPointerSize to count the
// receiver argument which is not included into formal parameters count.
Register dst_reg = scratch0;
ShiftLeftU64(dst_reg, caller_args_count, Operand(kSystemPointerSizeLog2));
AddS64(dst_reg, fp, dst_reg);
AddS64(dst_reg, dst_reg,
Operand(StandardFrameConstants::kCallerSPOffset + kSystemPointerSize));
Register src_reg = caller_args_count;
// Calculate the end of source area. +kSystemPointerSize is for the receiver.
ShiftLeftU64(src_reg, callee_args_count, Operand(kSystemPointerSizeLog2));
AddS64(src_reg, sp, src_reg);
AddS64(src_reg, src_reg, Operand(kSystemPointerSize));
if (FLAG_debug_code) {
CmpU64(src_reg, dst_reg);
Check(lt, AbortReason::kStackAccessBelowStackPointer);
}
// Restore caller's frame pointer and return address now as they will be
// overwritten by the copying loop.
RestoreFrameStateForTailCall();
// Now copy callee arguments to the caller frame going backwards to avoid
// callee arguments corruption (source and destination areas could overlap).
// Both src_reg and dst_reg are pointing to the word after the one to copy,
// so they must be pre-decremented in the loop.
Register tmp_reg = scratch1;
Label loop;
AddS64(tmp_reg, callee_args_count, Operand(1)); // +1 for receiver
mov(r1, tmp_reg);
bind(&loop);
LoadU64(tmp_reg, MemOperand(src_reg, -kSystemPointerSize));
StoreU64(tmp_reg, MemOperand(dst_reg, -kSystemPointerSize));
lay(src_reg, MemOperand(src_reg, -kSystemPointerSize));
lay(dst_reg, MemOperand(dst_reg, -kSystemPointerSize));
BranchOnCount(r1, &loop);
// Leave current frame.
mov(sp, dst_reg);
}
MemOperand MacroAssembler::StackLimitAsMemOperand(StackLimitKind kind) { MemOperand MacroAssembler::StackLimitAsMemOperand(StackLimitKind kind) {
DCHECK(root_array_available()); DCHECK(root_array_available());
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
......
...@@ -812,10 +812,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { ...@@ -812,10 +812,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
#endif #endif
} }
void PrepareForTailCall(Register callee_args_count,
Register caller_args_count, Register scratch0,
Register scratch1);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Runtime calls // Runtime calls
......
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