Bug 1661256 part 33 - Convert String-related callWithABI calls. r=djvj

Differential Revision: https://phabricator.services.mozilla.com/D91813
This commit is contained in:
Nicolas B. Pierron 2020-10-05 16:56:30 +00:00
Родитель 690d601f54
Коммит 83bfd111d3
6 изменённых файлов: 16 добавлений и 6 удалений

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

@ -110,8 +110,11 @@ namespace jit {
_(js::jit::NumberBigIntCompare<ComparisonKind::GreaterThanOrEqual>) \
_(js::jit::BigIntNumberCompare<ComparisonKind::GreaterThanOrEqual>) \
_(js::jit::CreateMatchResultFallbackFunc) \
_(js::jit::EqualStringsHelperPure) \
_(js::jit::FinishBailoutToBaseline) \
_(js::jit::GetDynamicNamePure) \
_(js::jit::GetIndexFromString) \
_(js::jit::GetInt32FromStringPure) \
_(js::jit::GetNativeDataPropertyByValuePure<false>) \
_(js::jit::GetNativeDataPropertyByValuePure<true>) \
_(js::jit::GetNativeDataPropertyPure<false>) \
@ -133,6 +136,7 @@ namespace jit {
_(js::jit::Printf1) \
_(js::jit::SetNativeDataPropertyPure<false>) \
_(js::jit::SetNativeDataPropertyPure<true>) \
_(js::jit::StringFromCharCodeNoGC) \
_(js::jit::WrapObjectPure) \
_(js::MapIteratorObject::next) \
_(js::NativeObject::addDenseElementPure) \

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

@ -414,11 +414,12 @@ bool BaselineCacheIRCompiler::emitGuardSpecificAtom(StringOperandId strId,
liveVolatileFloatRegs());
masm.PushRegsInMask(volatileRegs);
using Fn = bool (*)(JSString * str1, JSString * str2);
masm.setupUnalignedABICall(scratch);
masm.loadPtr(atomAddr, scratch);
masm.passABIArg(scratch);
masm.passABIArg(str);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, EqualStringsHelperPure));
masm.callWithABI<Fn, EqualStringsHelperPure>();
masm.mov(ReturnReg, scratch);
LiveRegisterSet ignore;

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

@ -2262,9 +2262,10 @@ bool CacheIRCompiler::emitGuardStringToIndex(StringOperandId strId,
liveVolatileFloatRegs());
masm.PushRegsInMask(save);
using Fn = int32_t (*)(JSString * str);
masm.setupUnalignedABICall(output);
masm.passABIArg(str);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, GetIndexFromString));
masm.callWithABI<Fn, GetIndexFromString>();
masm.storeCallInt32Result(output);
LiveRegisterSet ignore;

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

@ -4821,9 +4821,10 @@ void CodeGenerator::visitGuardStringToIndex(LGuardStringToIndex* lir) {
volatileRegs.takeUnchecked(output);
masm.PushRegsInMask(volatileRegs);
using Fn = int32_t (*)(JSString* str);
masm.setupUnalignedABICall(output);
masm.passABIArg(str);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, GetIndexFromString));
masm.callWithABI<Fn, GetIndexFromString>();
masm.storeCallInt32Result(output);
masm.PopRegsInMask(volatileRegs);

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

@ -1946,11 +1946,12 @@ bool IonCacheIRCompiler::emitLoadStringCharResult(StringOperandId strId,
volatileRegs.takeUnchecked(output);
masm.PushRegsInMask(volatileRegs);
using Fn = JSLinearString* (*)(JSContext * cx, int32_t code);
masm.setupUnalignedABICall(scratch2);
masm.loadJSContext(scratch2);
masm.passABIArg(scratch2);
masm.passABIArg(scratch1);
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, jit::StringFromCharCodeNoGC));
masm.callWithABI<Fn, jit::StringFromCharCodeNoGC>();
masm.storeCallPointerResult(scratch2);
masm.PopRegsInMask(volatileRegs);

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

@ -1880,11 +1880,12 @@ void MacroAssembler::guardSpecificAtom(Register str, JSAtom* atom,
// function to do the comparison.
PushRegsInMask(volatileRegs);
using Fn = bool (*)(JSString * str1, JSString * str2);
setupUnalignedABICall(scratch);
movePtr(ImmGCPtr(atom), scratch);
passABIArg(scratch);
passABIArg(str);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, EqualStringsHelperPure));
callWithABI<Fn, EqualStringsHelperPure>();
mov(ReturnReg, scratch);
MOZ_ASSERT(!volatileRegs.has(scratch));
@ -1915,12 +1916,13 @@ void MacroAssembler::guardStringToInt32(Register str, Register output,
}
PushRegsInMask(volatileRegs);
using Fn = bool (*)(JSContext * cx, JSString * str, int32_t * result);
setupUnalignedABICall(scratch);
loadJSContext(scratch);
passABIArg(scratch);
passABIArg(str);
passABIArg(output);
callWithABI(JS_FUNC_TO_DATA_PTR(void*, GetInt32FromStringPure));
callWithABI<Fn, GetInt32FromStringPure>();
mov(ReturnReg, scratch);
PopRegsInMask(volatileRegs);