diff --git a/js/src/ion/CodeGenerator.cpp b/js/src/ion/CodeGenerator.cpp index 7d2c44dca9d..77cf4669c04 100644 --- a/js/src/ion/CodeGenerator.cpp +++ b/js/src/ion/CodeGenerator.cpp @@ -3571,6 +3571,45 @@ CodeGenerator::visitMathFunctionD(LMathFunctionD *ins) case MMathFunction::ACos: funptr = JS_FUNC_TO_DATA_PTR(void *, js::math_acos_impl); 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: MOZ_ASSUME_UNREACHABLE("Unknown math function"); } diff --git a/js/src/ion/MCallOptimize.cpp b/js/src/ion/MCallOptimize.cpp index 0e44338f005..6426451b682 100644 --- a/js/src/ion/MCallOptimize.cpp +++ b/js/src/ion/MCallOptimize.cpp @@ -72,6 +72,32 @@ IonBuilder::inlineNativeCall(CallInfo &callInfo, JSNative native) return inlineMathFunction(callInfo, MMathFunction::ASin); if (native == js::math_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. if (native == js_String) diff --git a/js/src/ion/MIR.h b/js/src/ion/MIR.h index 3ad2362e2a0..b61fac70d93 100644 --- a/js/src/ion/MIR.h +++ b/js/src/ion/MIR.h @@ -3206,7 +3206,20 @@ class MMathFunction Tan, ACos, ASin, - ATan + ATan, + Log10, + Log2, + Log1P, + ExpM1, + CosH, + SinH, + TanH, + ACosH, + ASinH, + ATanH, + Sign, + Trunc, + Cbrt }; private: