зеркало из https://github.com/mozilla/gecko-dev.git
Bug 717379, part 2 - Add JIT support for new ES6 Math functions, except Math.hypot(). r=jorendorff.
--HG-- extra : rebase_source : f92507aa60224c3383968c96cfb29c6ba2ae8105
This commit is contained in:
Родитель
2d8132167a
Коммит
2e23622f38
|
@ -3571,6 +3571,45 @@ CodeGenerator::visitMathFunctionD(LMathFunctionD *ins)
|
||||||
case MMathFunction::ACos:
|
case MMathFunction::ACos:
|
||||||
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_acos_impl);
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_acos_impl);
|
||||||
break;
|
break;
|
||||||
|
case MMathFunction::Log10:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_log10_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::Log2:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_log2_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::Log1P:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_log1p_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::ExpM1:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_expm1_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::CosH:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_cosh_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::SinH:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_sinh_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::TanH:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_tanh_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::ACosH:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_acosh_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::ASinH:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_asinh_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::ATanH:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_atanh_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::Sign:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_sign_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::Trunc:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_trunc_impl);
|
||||||
|
break;
|
||||||
|
case MMathFunction::Cbrt:
|
||||||
|
funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_cbrt_impl);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
MOZ_ASSUME_UNREACHABLE("Unknown math function");
|
MOZ_ASSUME_UNREACHABLE("Unknown math function");
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,32 @@ IonBuilder::inlineNativeCall(CallInfo &callInfo, JSNative native)
|
||||||
return inlineMathFunction(callInfo, MMathFunction::ASin);
|
return inlineMathFunction(callInfo, MMathFunction::ASin);
|
||||||
if (native == js::math_acos)
|
if (native == js::math_acos)
|
||||||
return inlineMathFunction(callInfo, MMathFunction::ACos);
|
return inlineMathFunction(callInfo, MMathFunction::ACos);
|
||||||
|
if (native == js::math_log10)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::Log10);
|
||||||
|
if (native == js::math_log2)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::Log2);
|
||||||
|
if (native == js::math_log1p)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::Log1P);
|
||||||
|
if (native == js::math_expm1)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::ExpM1);
|
||||||
|
if (native == js::math_cosh)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::CosH);
|
||||||
|
if (native == js::math_sin)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::SinH);
|
||||||
|
if (native == js::math_tan)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::TanH);
|
||||||
|
if (native == js::math_acosh)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::ACosH);
|
||||||
|
if (native == js::math_asin)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::ASinH);
|
||||||
|
if (native == js::math_atan)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::ATanH);
|
||||||
|
if (native == js::math_sign)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::Sign);
|
||||||
|
if (native == js::math_trunc)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::Trunc);
|
||||||
|
if (native == js::math_cbrt)
|
||||||
|
return inlineMathFunction(callInfo, MMathFunction::Cbrt);
|
||||||
|
|
||||||
// String natives.
|
// String natives.
|
||||||
if (native == js_String)
|
if (native == js_String)
|
||||||
|
|
|
@ -3206,7 +3206,20 @@ class MMathFunction
|
||||||
Tan,
|
Tan,
|
||||||
ACos,
|
ACos,
|
||||||
ASin,
|
ASin,
|
||||||
ATan
|
ATan,
|
||||||
|
Log10,
|
||||||
|
Log2,
|
||||||
|
Log1P,
|
||||||
|
ExpM1,
|
||||||
|
CosH,
|
||||||
|
SinH,
|
||||||
|
TanH,
|
||||||
|
ACosH,
|
||||||
|
ASinH,
|
||||||
|
ATanH,
|
||||||
|
Sign,
|
||||||
|
Trunc,
|
||||||
|
Cbrt
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче