Commit 8c4188bf authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[mips][codegen] Remove PrepareForTailCall

Port: ec717160

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: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#75971}
parent 06ae0190
...@@ -4296,52 +4296,6 @@ void TurboAssembler::MovToFloatParameters(DoubleRegister src1, ...@@ -4296,52 +4296,6 @@ void TurboAssembler::MovToFloatParameters(DoubleRegister src1,
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// JavaScript invokes. // 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) { void MacroAssembler::LoadStackLimit(Register destination, StackLimitKind kind) {
DCHECK(root_array_available()); DCHECK(root_array_available());
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
......
...@@ -460,15 +460,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { ...@@ -460,15 +460,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void SmiUntag(Register dst, Register src) { sra(dst, src, kSmiTagSize); } 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 CalculateStackPassedWords(int num_reg_arguments,
int num_double_arguments); int num_double_arguments);
......
...@@ -4818,52 +4818,6 @@ void TurboAssembler::MovToFloatParameters(DoubleRegister src1, ...@@ -4818,52 +4818,6 @@ void TurboAssembler::MovToFloatParameters(DoubleRegister src1,
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// JavaScript invokes. // 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) { void MacroAssembler::LoadStackLimit(Register destination, StackLimitKind kind) {
DCHECK(root_array_available()); DCHECK(root_array_available());
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
......
...@@ -485,15 +485,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { ...@@ -485,15 +485,6 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void SmiUntag(Register reg) { SmiUntag(reg, reg); } 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 CalculateStackPassedWords(int num_reg_arguments,
int num_double_arguments); int num_double_arguments);
......
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