Bug 1661256 part 21 - Convert jsnum.h functions called with callWithABI. r=caroline

Differential Revision: https://phabricator.services.mozilla.com/D91801
This commit is contained in:
Nicolas B. Pierron 2020-10-05 16:55:56 +00:00
Родитель 58b77b84bc
Коммит a49b62bd9c
3 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@ -10,6 +10,9 @@
#include "jslibmath.h" // js::NumberMod
#include "jsmath.h" // js::ecmaPow, js::ecmaHypot, js::hypot3, js::hypot4,
// js::ecmaAtan2, js::UnaryMathFunctionType, js::powi
#include "jsnum.h" // js::StringToNumberPure, js::Int32ToStringHelperPure,
// js::NumberToStringHelperPure
#include "builtin/Array.h" // js::ArrayShiftMoveElements
#include "builtin/MapObject.h" // js::MapIteratorObject::next,
// js::SetIteratorObject::next
@ -63,6 +66,7 @@ namespace jit {
_(js::ExecuteRegExpAtomRaw) \
_(js::hypot3) \
_(js::hypot4) \
_(js::Int32ToStringHelperPure) \
_(js::irregexp::CaseInsensitiveCompareNonUnicode) \
_(js::irregexp::CaseInsensitiveCompareUnicode) \
_(js::irregexp::GrowBacktrackStack) \
@ -82,10 +86,12 @@ namespace jit {
_(js::jit::Printf1) \
_(js::MapIteratorObject::next) \
_(js::NumberMod) \
_(js::NumberToStringHelperPure) \
_(js::powi) \
_(js::RegExpInstanceOptimizableRaw) \
_(js::RegExpPrototypeOptimizableRaw) \
_(js::SetIteratorObject::next) \
_(js::StringToNumberPure) \
_(js::TraceLogStartEventPrivate) \
_(js::TraceLogStopEventPrivate)

Просмотреть файл

@ -2195,12 +2195,13 @@ bool CacheIRCompiler::emitGuardStringToNumber(StringOperandId strId,
liveVolatileFloatRegs());
masm.PushRegsInMask(volatileRegs);
using Fn = bool (*)(JSContext * cx, JSString * str, double* result);
masm.setupUnalignedABICall(scratch);
masm.loadJSContext(scratch);
masm.passABIArg(scratch);
masm.passABIArg(str);
masm.passABIArg(output.payloadOrValueReg());
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, StringToNumberPure));
masm.callWithABI<Fn, js::StringToNumberPure>();
masm.mov(ReturnReg, scratch);
LiveRegisterSet ignore;
@ -7295,11 +7296,12 @@ bool CacheIRCompiler::emitCallInt32ToString(Int32OperandId inputId,
volatileRegs.takeUnchecked(result);
masm.PushRegsInMask(volatileRegs);
using Fn = JSLinearString* (*)(JSContext * cx, int32_t i);
masm.setupUnalignedABICall(result);
masm.loadJSContext(result);
masm.passABIArg(result);
masm.passABIArg(input);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (js::Int32ToStringHelperPure)));
masm.callWithABI<Fn, js::Int32ToStringHelperPure>();
masm.mov(ReturnReg, result);
masm.PopRegsInMask(volatileRegs);
@ -7331,11 +7333,12 @@ bool CacheIRCompiler::emitCallNumberToString(NumberOperandId inputId,
volatileRegs.addUnchecked(floatScratch0);
masm.PushRegsInMask(volatileRegs);
using Fn = JSString* (*)(JSContext * cx, double d);
masm.setupUnalignedABICall(result);
masm.loadJSContext(result);
masm.passABIArg(result);
masm.passABIArg(floatScratch0, MoveOp::DOUBLE);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (js::NumberToStringHelperPure)));
masm.callWithABI<Fn, js::NumberToStringHelperPure>();
masm.mov(ReturnReg, result);
masm.PopRegsInMask(volatileRegs);

Просмотреть файл

@ -4880,12 +4880,13 @@ void CodeGenerator::visitGuardStringToDouble(LGuardStringToDouble* lir) {
volatileRegs.takeUnchecked(temp2);
masm.PushRegsInMask(volatileRegs);
using Fn = bool (*)(JSContext * cx, JSString * str, double* result);
masm.setupUnalignedABICall(temp2);
masm.loadJSContext(temp2);
masm.passABIArg(temp2);
masm.passABIArg(str);
masm.passABIArg(temp1);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, StringToNumberPure));
masm.callWithABI<Fn, StringToNumberPure>();
masm.mov(ReturnReg, temp1);
masm.PopRegsInMask(volatileRegs);