зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1661256 part 10 - Convert Bailout.h functions called with callWithABI. r=djvj
Differential Revision: https://phabricator.services.mozilla.com/D91790
This commit is contained in:
Родитель
8f5c579336
Коммит
947fd357bc
|
@ -20,6 +20,9 @@
|
|||
// js::irregexp::GrowBacktrackStack
|
||||
|
||||
#include "jit/ABIFunctions.h"
|
||||
#include "jit/Bailouts.h" // js::jit::FinishBailoutToBaseline, js::jit::Bailout,
|
||||
// js::jit::InvalidationBailout
|
||||
|
||||
#include "js/Conversions.h" // JS::ToInt32
|
||||
#include "vm/ArgumentsObject.h" // js::ArgumentsObject::finishForIonPure
|
||||
|
||||
|
@ -53,6 +56,9 @@ namespace jit {
|
|||
_(js::irregexp::CaseInsensitiveCompareNonUnicode) \
|
||||
_(js::irregexp::CaseInsensitiveCompareUnicode) \
|
||||
_(js::irregexp::GrowBacktrackStack) \
|
||||
_(js::jit::Bailout) \
|
||||
_(js::jit::FinishBailoutToBaseline) \
|
||||
_(js::jit::InvalidationBailout) \
|
||||
_(js::NumberMod) \
|
||||
_(js::powi) \
|
||||
_(js::RegExpInstanceOptimizableRaw) \
|
||||
|
|
|
@ -2037,10 +2037,11 @@ void MacroAssembler::generateBailoutTail(Register scratch,
|
|||
push(Address(bailoutInfo, offsetof(BaselineBailoutInfo, resumeAddr)));
|
||||
|
||||
// Call a stub to free allocated memory and create arguments objects.
|
||||
using Fn = bool (*)(BaselineBailoutInfo * bailoutInfoArg);
|
||||
setupUnalignedABICall(temp);
|
||||
passABIArg(bailoutInfo);
|
||||
callWithABI(JS_FUNC_TO_DATA_PTR(void*, FinishBailoutToBaseline),
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
callWithABI<Fn, FinishBailoutToBaseline>(
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckHasExitFrame);
|
||||
branchIfFalseBool(ReturnReg, exceptionLabel());
|
||||
|
||||
// Restore values where they need to be and resume execution.
|
||||
|
|
|
@ -406,12 +406,14 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
const int sizeOfBailoutInfo = sizeof(void*) * 2;
|
||||
masm.reserveStack(sizeOfBailoutInfo);
|
||||
masm.mov(sp, r2);
|
||||
using Fn = bool (*)(InvalidationBailoutStack * sp, size_t * frameSizeOut,
|
||||
BaselineBailoutInfo * *info);
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(r0);
|
||||
masm.passABIArg(r1);
|
||||
masm.passABIArg(r2);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, InvalidationBailout),
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.ma_ldr(DTRAddr(sp, DtrOffImm(0)), r2);
|
||||
{
|
||||
|
@ -652,6 +654,7 @@ static void GenerateBailoutThunk(MacroAssembler& masm, uint32_t frameClass,
|
|||
const int sizeOfBailoutInfo = sizeof(void*) * 2;
|
||||
masm.reserveStack(sizeOfBailoutInfo);
|
||||
masm.mov(sp, r1);
|
||||
using Fn = bool (*)(BailoutStack * sp, BaselineBailoutInfo * *info);
|
||||
masm.setupAlignedABICall();
|
||||
|
||||
// Decrement sp by another 4, so we keep alignment. Not Anymore! Pushing
|
||||
|
@ -662,8 +665,8 @@ static void GenerateBailoutThunk(MacroAssembler& masm, uint32_t frameClass,
|
|||
masm.passABIArg(r1);
|
||||
|
||||
// Sp % 8 == 0
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, Bailout), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.ma_ldr(DTRAddr(sp, DtrOffImm(0)), r2);
|
||||
{
|
||||
ScratchRegisterScope scratch(masm);
|
||||
|
|
|
@ -342,13 +342,15 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
Operand(sizeof(size_t) + sizeof(void*)));
|
||||
masm.moveToStackPtr(r2);
|
||||
|
||||
using Fn = bool (*)(InvalidationBailoutStack * sp, size_t * frameSizeOut,
|
||||
BaselineBailoutInfo * *info);
|
||||
masm.setupUnalignedABICall(r10);
|
||||
masm.passABIArg(r0);
|
||||
masm.passABIArg(r1);
|
||||
masm.passABIArg(r2);
|
||||
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, InvalidationBailout),
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(r2, r1);
|
||||
|
||||
|
@ -513,11 +515,12 @@ static void GenerateBailoutThunk(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.reserveStack(sizeof(void*));
|
||||
masm.moveStackPtrTo(r1);
|
||||
|
||||
using Fn = bool (*)(BailoutStack * sp, BaselineBailoutInfo * *info);
|
||||
masm.setupUnalignedABICall(r2);
|
||||
masm.passABIArg(r0);
|
||||
masm.passABIArg(r1);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, Bailout), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
// Get the bailoutInfo outparam.
|
||||
masm.pop(r2);
|
||||
|
|
|
@ -381,12 +381,14 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
// Pass pointer to BailoutInfo
|
||||
masm.movePtr(StackPointer, a2);
|
||||
|
||||
using Fn = bool (*)(InvalidationBailoutStack * sp, size_t * frameSizeOut,
|
||||
BaselineBailoutInfo * *info);
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.passABIArg(a2);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, InvalidationBailout),
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.loadPtr(Address(StackPointer, 0), a2);
|
||||
masm.loadPtr(Address(StackPointer, sizeof(uintptr_t)), a1);
|
||||
|
@ -640,11 +642,12 @@ static void GenerateBailoutThunk(MacroAssembler& masm, uint32_t frameClass,
|
|||
masm.storePtr(ImmPtr(nullptr), Address(StackPointer, 0));
|
||||
masm.movePtr(StackPointer, a1);
|
||||
|
||||
using Fn = bool (*)(BailoutStack * sp, BaselineBailoutInfo * *info);
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, Bailout), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
// Get BailoutInfo pointer
|
||||
masm.loadPtr(Address(StackPointer, 0), a2);
|
||||
|
|
|
@ -387,12 +387,14 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
// Pass pointer to BailoutInfo
|
||||
masm.movePtr(StackPointer, a2);
|
||||
|
||||
using Fn = bool (*)(InvalidationBailoutStack * sp, size_t * frameSizeOut,
|
||||
BaselineBailoutInfo * *info);
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.passABIArg(a2);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, InvalidationBailout),
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.loadPtr(Address(StackPointer, 0), a2);
|
||||
masm.loadPtr(Address(StackPointer, sizeof(uintptr_t)), a1);
|
||||
|
@ -636,11 +638,12 @@ static void GenerateBailoutThunk(MacroAssembler& masm, uint32_t frameClass,
|
|||
masm.subPtr(Imm32(sizeOfBailoutInfo), StackPointer);
|
||||
masm.movePtr(StackPointer, a1);
|
||||
|
||||
using Fn = bool (*)(BailoutStack * sp, BaselineBailoutInfo * *info);
|
||||
masm.setupAlignedABICall();
|
||||
masm.passABIArg(a0);
|
||||
masm.passABIArg(a1);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, Bailout), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
// Get BailoutInfo pointer
|
||||
masm.loadPtr(Address(StackPointer, 0), a2);
|
||||
|
|
|
@ -373,12 +373,14 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.reserveStack(sizeof(void*));
|
||||
masm.movq(rsp, r9);
|
||||
|
||||
using Fn = bool (*)(InvalidationBailoutStack * sp, size_t * frameSizeOut,
|
||||
BaselineBailoutInfo * *info);
|
||||
masm.setupUnalignedABICall(rdx);
|
||||
masm.passABIArg(rax);
|
||||
masm.passABIArg(rbx);
|
||||
masm.passABIArg(r9);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, InvalidationBailout),
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(r9); // Get the bailoutInfo outparam.
|
||||
masm.pop(rbx); // Get the frameSize outparam.
|
||||
|
@ -583,11 +585,12 @@ static void GenerateBailoutThunk(MacroAssembler& masm, uint32_t frameClass,
|
|||
masm.movq(rsp, r9);
|
||||
|
||||
// Call the bailout function.
|
||||
using Fn = bool (*)(BailoutStack * sp, BaselineBailoutInfo * *info);
|
||||
masm.setupUnalignedABICall(rax);
|
||||
masm.passABIArg(r8);
|
||||
masm.passABIArg(r9);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, Bailout), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(r9); // Get the bailoutInfo outparam.
|
||||
|
||||
|
|
|
@ -362,12 +362,14 @@ void JitRuntime::generateInvalidator(MacroAssembler& masm, Label* bailoutTail) {
|
|||
masm.reserveStack(sizeof(void*));
|
||||
masm.movl(esp, ecx);
|
||||
|
||||
using Fn = bool (*)(InvalidationBailoutStack * sp, size_t * frameSizeOut,
|
||||
BaselineBailoutInfo * *info);
|
||||
masm.setupUnalignedABICall(edx);
|
||||
masm.passABIArg(eax);
|
||||
masm.passABIArg(ebx);
|
||||
masm.passABIArg(ecx);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, InvalidationBailout),
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, InvalidationBailout>(
|
||||
MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(ecx); // Get bailoutInfo outparam.
|
||||
masm.pop(ebx); // Get the frameSize outparam.
|
||||
|
@ -577,11 +579,12 @@ static void GenerateBailoutThunk(MacroAssembler& masm, uint32_t frameClass,
|
|||
masm.movl(esp, ebx);
|
||||
|
||||
// Call the bailout function. This will correct the size of the bailout.
|
||||
using Fn = bool (*)(BailoutStack * sp, BaselineBailoutInfo * *info);
|
||||
masm.setupUnalignedABICall(ecx);
|
||||
masm.passABIArg(eax);
|
||||
masm.passABIArg(ebx);
|
||||
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, Bailout), MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
masm.callWithABI<Fn, Bailout>(MoveOp::GENERAL,
|
||||
CheckUnsafeCallWithABI::DontCheckOther);
|
||||
|
||||
masm.pop(ecx); // Get bailoutInfo outparam.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче