[mips][codegen] Remove PrepareForTailCall

Port: ec7171608b

Bug: v8:11879
Change-Id: Ib1ef3d984d559e4d4cec4d4daa9e1fec856f3686
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3058062
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#75971}
This commit is contained in:
Liu Yu 2021-07-28 11:05:03 +08:00 committed by V8 LUCI CQ
parent 06ae01909d
commit 8c4188bf74
4 changed files with 0 additions and 110 deletions

View File

@ -4296,52 +4296,6 @@ void TurboAssembler::MovToFloatParameters(DoubleRegister src1,
// -----------------------------------------------------------------------------
// JavaScript invokes.
void TurboAssembler::PrepareForTailCall(Register callee_args_count,
Register caller_args_count,
Register scratch0, Register scratch1) {
// Calculate the end of destination area where we will put the arguments
// after we drop current frame. We add kPointerSize to count the receiver
// argument which is not included into formal parameters count.
Register dst_reg = scratch0;
Lsa(dst_reg, fp, caller_args_count, kPointerSizeLog2);
Addu(dst_reg, dst_reg,
Operand(StandardFrameConstants::kCallerSPOffset + kPointerSize));
Register src_reg = caller_args_count;
// Calculate the end of source area. +kPointerSize is for the receiver.
Lsa(src_reg, sp, callee_args_count, kPointerSizeLog2);
Addu(src_reg, src_reg, Operand(kPointerSize));
if (FLAG_debug_code) {
Check(lo, AbortReason::kStackAccessBelowStackPointer, src_reg,
Operand(dst_reg));
}
// Restore caller's frame pointer and return address now as they will be
// overwritten by the copying loop.
lw(ra, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
lw(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
// 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, entry;
Branch(&entry);
bind(&loop);
Subu(src_reg, src_reg, Operand(kPointerSize));
Subu(dst_reg, dst_reg, Operand(kPointerSize));
lw(tmp_reg, MemOperand(src_reg));
sw(tmp_reg, MemOperand(dst_reg));
bind(&entry);
Branch(&loop, ne, sp, Operand(src_reg));
// Leave current frame.
mov(sp, dst_reg);
}
void MacroAssembler::LoadStackLimit(Register destination, StackLimitKind kind) {
DCHECK(root_array_available());
Isolate* isolate = this->isolate();

View File

@ -460,15 +460,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void SmiUntag(Register dst, Register src) { sra(dst, src, kSmiTagSize); }
// Removes current frame and its arguments from the stack preserving
// the arguments and a return address pushed to the stack for the next call.
// Both |callee_args_count| and |caller_args_count| do not include
// receiver. |callee_args_count| is not modified. |caller_args_count|
// is trashed.
void PrepareForTailCall(Register callee_args_count,
Register caller_args_count, Register scratch0,
Register scratch1);
int CalculateStackPassedWords(int num_reg_arguments,
int num_double_arguments);

View File

@ -4818,52 +4818,6 @@ void TurboAssembler::MovToFloatParameters(DoubleRegister src1,
// -----------------------------------------------------------------------------
// JavaScript invokes.
void TurboAssembler::PrepareForTailCall(Register callee_args_count,
Register caller_args_count,
Register scratch0, Register scratch1) {
// Calculate the end of destination area where we will put the arguments
// after we drop current frame. We add kPointerSize to count the receiver
// argument which is not included into formal parameters count.
Register dst_reg = scratch0;
Dlsa(dst_reg, fp, caller_args_count, kPointerSizeLog2);
Daddu(dst_reg, dst_reg,
Operand(StandardFrameConstants::kCallerSPOffset + kPointerSize));
Register src_reg = caller_args_count;
// Calculate the end of source area. +kPointerSize is for the receiver.
Dlsa(src_reg, sp, callee_args_count, kPointerSizeLog2);
Daddu(src_reg, src_reg, Operand(kPointerSize));
if (FLAG_debug_code) {
Check(lo, AbortReason::kStackAccessBelowStackPointer, src_reg,
Operand(dst_reg));
}
// Restore caller's frame pointer and return address now as they will be
// overwritten by the copying loop.
Ld(ra, MemOperand(fp, StandardFrameConstants::kCallerPCOffset));
Ld(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
// 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, entry;
Branch(&entry);
bind(&loop);
Dsubu(src_reg, src_reg, Operand(kPointerSize));
Dsubu(dst_reg, dst_reg, Operand(kPointerSize));
Ld(tmp_reg, MemOperand(src_reg));
Sd(tmp_reg, MemOperand(dst_reg));
bind(&entry);
Branch(&loop, ne, sp, Operand(src_reg));
// Leave current frame.
mov(sp, dst_reg);
}
void MacroAssembler::LoadStackLimit(Register destination, StackLimitKind kind) {
DCHECK(root_array_available());
Isolate* isolate = this->isolate();

View File

@ -485,15 +485,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void SmiUntag(Register reg) { SmiUntag(reg, reg); }
// Removes current frame and its arguments from the stack preserving
// the arguments and a return address pushed to the stack for the next call.
// Both |callee_args_count| and |caller_args_count| do not include
// receiver. |callee_args_count| is not modified. |caller_args_count|
// is trashed.
void PrepareForTailCall(Register callee_args_count,
Register caller_args_count, Register scratch0,
Register scratch1);
int CalculateStackPassedWords(int num_reg_arguments,
int num_double_arguments);