From 0be6983593c4ee3bcac0545262450c236adaf94e Mon Sep 17 00:00:00 2001 From: Liu Yu Date: Wed, 30 Mar 2022 11:42:50 +0800 Subject: [PATCH] [loong64][mips][deoptimizer] Remove non-fixed-size deopts Port commit 0a110021d21a43a376f29a5ff1672ac6293c71cc Change-Id: I065d5e79c3432ef9f306e70635a86de89eb531dc Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3559771 Reviewed-by: Zhao Jiazhong Auto-Submit: Yu Liu Commit-Queue: Yu Liu Cr-Commit-Position: refs/heads/main@{#79670} --- src/builtins/loong64/builtins-loong64.cc | 22 ++++++++++------------ src/builtins/mips/builtins-mips.cc | 24 +++++++++++------------- src/builtins/mips64/builtins-mips64.cc | 22 ++++++++++------------ 3 files changed, 31 insertions(+), 37 deletions(-) diff --git a/src/builtins/loong64/builtins-loong64.cc b/src/builtins/loong64/builtins-loong64.cc index d4a9c72761..b7b677d225 100644 --- a/src/builtins/loong64/builtins-loong64.cc +++ b/src/builtins/loong64/builtins-loong64.cc @@ -3399,17 +3399,16 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, const int kSavedRegistersAreaSize = (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; - __ li(a2, Operand(Deoptimizer::kFixedExitSizeMarker)); - // Get the address of the location in the code object (a3) (return + // Get the address of the location in the code object (a2) (return // address for lazy deoptimization) and compute the fp-to-sp delta in - // register a4. - __ mov(a3, ra); - __ Add_d(a4, sp, Operand(kSavedRegistersAreaSize)); + // register a3. + __ mov(a2, ra); + __ Add_d(a3, sp, Operand(kSavedRegistersAreaSize)); - __ sub_d(a4, fp, a4); + __ sub_d(a3, fp, a3); // Allocate a new deoptimizer object. - __ PrepareCallCFunction(6, a5); + __ PrepareCallCFunction(5, a4); // Pass six arguments, according to n64 ABI. __ mov(a0, zero_reg); Label context_check; @@ -3418,15 +3417,14 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, __ Ld_d(a0, MemOperand(fp, StandardFrameConstants::kFunctionOffset)); __ bind(&context_check); __ li(a1, Operand(static_cast(deopt_kind))); - // a2: bailout id already loaded. - // a3: code address or 0 already loaded. - // a4: already has fp-to-sp delta. - __ li(a5, ExternalReference::isolate_address(isolate)); + // a2: code address or 0 already loaded. + // a3: already has fp-to-sp delta. + __ li(a4, ExternalReference::isolate_address(isolate)); // Call Deoptimizer::New(). { 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 diff --git a/src/builtins/mips/builtins-mips.cc b/src/builtins/mips/builtins-mips.cc index ed6d8d9922..675139d1ec 100644 --- a/src/builtins/mips/builtins-mips.cc +++ b/src/builtins/mips/builtins-mips.cc @@ -3846,16 +3846,15 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, static constexpr int kSavedRegistersAreaSize = (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; - __ li(a2, Operand(Deoptimizer::kFixedExitSizeMarker)); - // Get the address of the location in the code object (a3) (return + // Get the address of the location in the code object (a2) (return // address for lazy deoptimization) and compute the fp-to-sp delta in - // register t0. - __ mov(a3, ra); - __ Addu(t0, sp, Operand(kSavedRegistersAreaSize)); - __ Subu(t0, fp, t0); + // register a3. + __ mov(a2, ra); + __ Addu(a3, sp, Operand(kSavedRegistersAreaSize)); + __ Subu(a3, fp, a3); // Allocate a new deoptimizer object. - __ PrepareCallCFunction(6, t1); + __ PrepareCallCFunction(5, t0); // Pass four arguments in a0 to a3 and fifth & sixth arguments on stack. __ mov(a0, zero_reg); Label context_check; @@ -3864,15 +3863,14 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, __ lw(a0, MemOperand(fp, StandardFrameConstants::kFunctionOffset)); __ bind(&context_check); __ li(a1, Operand(static_cast(deopt_kind))); - // a2: bailout id already loaded. - // a3: code address or 0 already loaded. - __ sw(t0, CFunctionArgumentOperand(5)); // Fp-to-sp delta. - __ li(t1, ExternalReference::isolate_address(isolate)); - __ sw(t1, CFunctionArgumentOperand(6)); // Isolate. + // a2: code address or 0 already loaded. + // a3: Fp-to-sp delta already loaded. + __ li(t0, ExternalReference::isolate_address(isolate)); + __ sw(t0, CFunctionArgumentOperand(5)); // Isolate. // Call Deoptimizer::New(). { 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 diff --git a/src/builtins/mips64/builtins-mips64.cc b/src/builtins/mips64/builtins-mips64.cc index f4a2eaee56..0e0d26a62a 100644 --- a/src/builtins/mips64/builtins-mips64.cc +++ b/src/builtins/mips64/builtins-mips64.cc @@ -3425,17 +3425,16 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, const int kSavedRegistersAreaSize = (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; - __ li(a2, Operand(Deoptimizer::kFixedExitSizeMarker)); - // Get the address of the location in the code object (a3) (return + // Get the address of the location in the code object (a2) (return // address for lazy deoptimization) and compute the fp-to-sp delta in - // register a4. - __ mov(a3, ra); - __ Daddu(a4, sp, Operand(kSavedRegistersAreaSize)); + // register a3. + __ mov(a2, ra); + __ Daddu(a3, sp, Operand(kSavedRegistersAreaSize)); - __ Dsubu(a4, fp, a4); + __ Dsubu(a3, fp, a3); // Allocate a new deoptimizer object. - __ PrepareCallCFunction(6, a5); + __ PrepareCallCFunction(5, a4); // Pass six arguments, according to n64 ABI. __ mov(a0, zero_reg); Label context_check; @@ -3444,15 +3443,14 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, __ Ld(a0, MemOperand(fp, StandardFrameConstants::kFunctionOffset)); __ bind(&context_check); __ li(a1, Operand(static_cast(deopt_kind))); - // a2: bailout id already loaded. - // a3: code address or 0 already loaded. - // a4: already has fp-to-sp delta. - __ li(a5, ExternalReference::isolate_address(isolate)); + // a2: code address or 0 already loaded. + // a3: already has fp-to-sp delta. + __ li(a4, ExternalReference::isolate_address(isolate)); // Call Deoptimizer::New(). { 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