Commit 0be69835 authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[loong64][mips][deoptimizer] Remove non-fixed-size deopts

Port commit 0a110021

Change-Id: I065d5e79c3432ef9f306e70635a86de89eb531dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3559771Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Yu Liu <liuyu@loongson.cn>
Commit-Queue: Yu Liu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#79670}
parent 57d985a5
...@@ -3399,17 +3399,16 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, ...@@ -3399,17 +3399,16 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
const int kSavedRegistersAreaSize = const int kSavedRegistersAreaSize =
(kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize;
__ li(a2, Operand(Deoptimizer::kFixedExitSizeMarker)); // Get the address of the location in the code object (a2) (return
// Get the address of the location in the code object (a3) (return
// address for lazy deoptimization) and compute the fp-to-sp delta in // address for lazy deoptimization) and compute the fp-to-sp delta in
// register a4. // register a3.
__ mov(a3, ra); __ mov(a2, ra);
__ Add_d(a4, sp, Operand(kSavedRegistersAreaSize)); __ Add_d(a3, sp, Operand(kSavedRegistersAreaSize));
__ sub_d(a4, fp, a4); __ sub_d(a3, fp, a3);
// Allocate a new deoptimizer object. // Allocate a new deoptimizer object.
__ PrepareCallCFunction(6, a5); __ PrepareCallCFunction(5, a4);
// Pass six arguments, according to n64 ABI. // Pass six arguments, according to n64 ABI.
__ mov(a0, zero_reg); __ mov(a0, zero_reg);
Label context_check; Label context_check;
...@@ -3418,15 +3417,14 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, ...@@ -3418,15 +3417,14 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
__ Ld_d(a0, MemOperand(fp, StandardFrameConstants::kFunctionOffset)); __ Ld_d(a0, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
__ bind(&context_check); __ bind(&context_check);
__ li(a1, Operand(static_cast<int>(deopt_kind))); __ li(a1, Operand(static_cast<int>(deopt_kind)));
// a2: bailout id already loaded. // a2: code address or 0 already loaded.
// a3: code address or 0 already loaded. // a3: already has fp-to-sp delta.
// a4: already has fp-to-sp delta. __ li(a4, ExternalReference::isolate_address(isolate));
__ li(a5, ExternalReference::isolate_address(isolate));
// Call Deoptimizer::New(). // Call Deoptimizer::New().
{ {
AllowExternalCallThatCantCauseGC scope(masm); AllowExternalCallThatCantCauseGC scope(masm);
__ CallCFunction(ExternalReference::new_deoptimizer_function(), 6); __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5);
} }
// Preserve "deoptimizer" object in register a0 and get the input // Preserve "deoptimizer" object in register a0 and get the input
......
...@@ -3846,16 +3846,15 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, ...@@ -3846,16 +3846,15 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
static constexpr int kSavedRegistersAreaSize = static constexpr int kSavedRegistersAreaSize =
(kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize;
__ li(a2, Operand(Deoptimizer::kFixedExitSizeMarker)); // Get the address of the location in the code object (a2) (return
// Get the address of the location in the code object (a3) (return
// address for lazy deoptimization) and compute the fp-to-sp delta in // address for lazy deoptimization) and compute the fp-to-sp delta in
// register t0. // register a3.
__ mov(a3, ra); __ mov(a2, ra);
__ Addu(t0, sp, Operand(kSavedRegistersAreaSize)); __ Addu(a3, sp, Operand(kSavedRegistersAreaSize));
__ Subu(t0, fp, t0); __ Subu(a3, fp, a3);
// Allocate a new deoptimizer object. // Allocate a new deoptimizer object.
__ PrepareCallCFunction(6, t1); __ PrepareCallCFunction(5, t0);
// Pass four arguments in a0 to a3 and fifth & sixth arguments on stack. // Pass four arguments in a0 to a3 and fifth & sixth arguments on stack.
__ mov(a0, zero_reg); __ mov(a0, zero_reg);
Label context_check; Label context_check;
...@@ -3864,15 +3863,14 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, ...@@ -3864,15 +3863,14 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
__ lw(a0, MemOperand(fp, StandardFrameConstants::kFunctionOffset)); __ lw(a0, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
__ bind(&context_check); __ bind(&context_check);
__ li(a1, Operand(static_cast<int>(deopt_kind))); __ li(a1, Operand(static_cast<int>(deopt_kind)));
// a2: bailout id already loaded. // a2: code address or 0 already loaded.
// a3: code address or 0 already loaded. // a3: Fp-to-sp delta already loaded.
__ sw(t0, CFunctionArgumentOperand(5)); // Fp-to-sp delta. __ li(t0, ExternalReference::isolate_address(isolate));
__ li(t1, ExternalReference::isolate_address(isolate)); __ sw(t0, CFunctionArgumentOperand(5)); // Isolate.
__ sw(t1, CFunctionArgumentOperand(6)); // Isolate.
// Call Deoptimizer::New(). // Call Deoptimizer::New().
{ {
AllowExternalCallThatCantCauseGC scope(masm); AllowExternalCallThatCantCauseGC scope(masm);
__ CallCFunction(ExternalReference::new_deoptimizer_function(), 6); __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5);
} }
// Preserve "deoptimizer" object in register v0 and get the input // Preserve "deoptimizer" object in register v0 and get the input
......
...@@ -3425,17 +3425,16 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, ...@@ -3425,17 +3425,16 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
const int kSavedRegistersAreaSize = const int kSavedRegistersAreaSize =
(kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize;
__ li(a2, Operand(Deoptimizer::kFixedExitSizeMarker)); // Get the address of the location in the code object (a2) (return
// Get the address of the location in the code object (a3) (return
// address for lazy deoptimization) and compute the fp-to-sp delta in // address for lazy deoptimization) and compute the fp-to-sp delta in
// register a4. // register a3.
__ mov(a3, ra); __ mov(a2, ra);
__ Daddu(a4, sp, Operand(kSavedRegistersAreaSize)); __ Daddu(a3, sp, Operand(kSavedRegistersAreaSize));
__ Dsubu(a4, fp, a4); __ Dsubu(a3, fp, a3);
// Allocate a new deoptimizer object. // Allocate a new deoptimizer object.
__ PrepareCallCFunction(6, a5); __ PrepareCallCFunction(5, a4);
// Pass six arguments, according to n64 ABI. // Pass six arguments, according to n64 ABI.
__ mov(a0, zero_reg); __ mov(a0, zero_reg);
Label context_check; Label context_check;
...@@ -3444,15 +3443,14 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, ...@@ -3444,15 +3443,14 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
__ Ld(a0, MemOperand(fp, StandardFrameConstants::kFunctionOffset)); __ Ld(a0, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
__ bind(&context_check); __ bind(&context_check);
__ li(a1, Operand(static_cast<int>(deopt_kind))); __ li(a1, Operand(static_cast<int>(deopt_kind)));
// a2: bailout id already loaded. // a2: code address or 0 already loaded.
// a3: code address or 0 already loaded. // a3: already has fp-to-sp delta.
// a4: already has fp-to-sp delta. __ li(a4, ExternalReference::isolate_address(isolate));
__ li(a5, ExternalReference::isolate_address(isolate));
// Call Deoptimizer::New(). // Call Deoptimizer::New().
{ {
AllowExternalCallThatCantCauseGC scope(masm); AllowExternalCallThatCantCauseGC scope(masm);
__ CallCFunction(ExternalReference::new_deoptimizer_function(), 6); __ CallCFunction(ExternalReference::new_deoptimizer_function(), 5);
} }
// Preserve "deoptimizer" object in register v0 and get the input // Preserve "deoptimizer" object in register v0 and get the input
......
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