Bug 1661256 part 31 - Convert BigInt's callWithABI calls. r=iain

Differential Revision: https://phabricator.services.mozilla.com/D91811
This commit is contained in:
Nicolas B. Pierron 2020-10-05 16:56:24 +00:00
Родитель 4688bba3ec
Коммит bb62e3366b
2 изменённых файлов: 38 добавлений и 33 удалений

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

@ -103,6 +103,12 @@ namespace jit {
_(js::jit::AssertValidValue) \
_(js::jit::AssumeUnreachable) \
_(js::jit::Bailout) \
_(js::jit::BigIntNumberEqual<EqualityKind::Equal>) \
_(js::jit::BigIntNumberEqual<EqualityKind::NotEqual>) \
_(js::jit::BigIntNumberCompare<ComparisonKind::LessThan>) \
_(js::jit::NumberBigIntCompare<ComparisonKind::LessThan>) \
_(js::jit::NumberBigIntCompare<ComparisonKind::GreaterThanOrEqual>) \
_(js::jit::BigIntNumberCompare<ComparisonKind::GreaterThanOrEqual>) \
_(js::jit::CreateMatchResultFallbackFunc) \
_(js::jit::FinishBailoutToBaseline) \
_(js::jit::GetDynamicNamePure) \
@ -153,6 +159,9 @@ namespace jit {
#define ABIFUNCTIONSIG_LIST(_) \
_(AtomicsCompareExchangeFn) \
_(AtomicsReadWriteModifyFn) \
_(bool (*)(BigInt*, BigInt*)) \
_(bool (*)(BigInt*, double)) \
_(bool (*)(double, BigInt*)) \
_(float (*)(float)) \
_(JSJitGetterOp) \
_(JSJitMethodOp) \

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

@ -6107,7 +6107,7 @@ bool CacheIRCompiler::emitCompareBigIntResult(JSOp op, BigIntOperandId lhsId,
fn = jit::BigIntCompare<ComparisonKind::GreaterThanOrEqual>;
}
masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, fn));
masm.callWithABI(DynamicFunction<Fn>(fn));
masm.storeCallBoolResult(scratch);
LiveRegisterSet ignore;
@ -6293,45 +6293,43 @@ bool CacheIRCompiler::emitCompareBigIntNumberResult(JSOp op,
using FnBigIntNumber = bool (*)(BigInt*, double);
using FnNumberBigInt = bool (*)(double, BigInt*);
void* fun;
switch (op) {
case JSOp::Eq: {
FnBigIntNumber fn = jit::BigIntNumberEqual<EqualityKind::Equal>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<FnBigIntNumber,
jit::BigIntNumberEqual<EqualityKind::Equal>>();
break;
}
case JSOp::Ne: {
FnBigIntNumber fn = jit::BigIntNumberEqual<EqualityKind::NotEqual>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<FnBigIntNumber,
jit::BigIntNumberEqual<EqualityKind::NotEqual>>();
break;
}
case JSOp::Lt: {
FnBigIntNumber fn = jit::BigIntNumberCompare<ComparisonKind::LessThan>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<FnBigIntNumber,
jit::BigIntNumberCompare<ComparisonKind::LessThan>>();
break;
}
case JSOp::Gt: {
FnNumberBigInt fn = jit::NumberBigIntCompare<ComparisonKind::LessThan>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<FnNumberBigInt,
jit::NumberBigIntCompare<ComparisonKind::LessThan>>();
break;
}
case JSOp::Le: {
FnNumberBigInt fn =
jit::NumberBigIntCompare<ComparisonKind::GreaterThanOrEqual>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<
FnNumberBigInt,
jit::NumberBigIntCompare<ComparisonKind::GreaterThanOrEqual>>();
break;
}
case JSOp::Ge: {
FnBigIntNumber fn =
jit::BigIntNumberCompare<ComparisonKind::GreaterThanOrEqual>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<
FnBigIntNumber,
jit::BigIntNumberCompare<ComparisonKind::GreaterThanOrEqual>>();
break;
}
default:
MOZ_CRASH("unhandled op");
}
masm.callWithABI(fun);
masm.storeCallBoolResult(scratch);
LiveRegisterSet ignore;
@ -6376,45 +6374,43 @@ bool CacheIRCompiler::emitCompareNumberBigIntResult(JSOp op,
using FnBigIntNumber = bool (*)(BigInt*, double);
using FnNumberBigInt = bool (*)(double, BigInt*);
void* fun;
switch (op) {
case JSOp::Eq: {
FnBigIntNumber fn = jit::BigIntNumberEqual<EqualityKind::Equal>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<FnBigIntNumber,
jit::BigIntNumberEqual<EqualityKind::Equal>>();
break;
}
case JSOp::Ne: {
FnBigIntNumber fn = jit::BigIntNumberEqual<EqualityKind::NotEqual>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<FnBigIntNumber,
jit::BigIntNumberEqual<EqualityKind::NotEqual>>();
break;
}
case JSOp::Lt: {
FnNumberBigInt fn = jit::NumberBigIntCompare<ComparisonKind::LessThan>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<FnNumberBigInt,
jit::NumberBigIntCompare<ComparisonKind::LessThan>>();
break;
}
case JSOp::Gt: {
FnBigIntNumber fn = jit::BigIntNumberCompare<ComparisonKind::LessThan>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<FnBigIntNumber,
jit::BigIntNumberCompare<ComparisonKind::LessThan>>();
break;
}
case JSOp::Le: {
FnBigIntNumber fn =
jit::BigIntNumberCompare<ComparisonKind::GreaterThanOrEqual>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<
FnBigIntNumber,
jit::BigIntNumberCompare<ComparisonKind::GreaterThanOrEqual>>();
break;
}
case JSOp::Ge: {
FnNumberBigInt fn =
jit::NumberBigIntCompare<ComparisonKind::GreaterThanOrEqual>;
fun = JS_FUNC_TO_DATA_PTR(void*, fn);
masm.callWithABI<
FnNumberBigInt,
jit::NumberBigIntCompare<ComparisonKind::GreaterThanOrEqual>>();
break;
}
default:
MOZ_CRASH("unhandled op");
}
masm.callWithABI(fun);
masm.storeCallBoolResult(scratch);
LiveRegisterSet ignore;