diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 0ea4bd54aa3c..e91b3e47a65a 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -8522,73 +8522,73 @@ void CodeGenerator::visitMathFunctionD(LMathFunctionD* ins) { void* funptr = nullptr; switch (ins->mir()->function()) { - case MMathFunction::Log: + case UnaryMathFunction::Log: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_log_impl); break; - case MMathFunction::Sin: + case UnaryMathFunction::Sin: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_sin_impl); break; - case MMathFunction::Cos: + case UnaryMathFunction::Cos: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_cos_impl); break; - case MMathFunction::Exp: + case UnaryMathFunction::Exp: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_exp_impl); break; - case MMathFunction::Tan: + case UnaryMathFunction::Tan: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_tan_impl); break; - case MMathFunction::ATan: + case UnaryMathFunction::ATan: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_atan_impl); break; - case MMathFunction::ASin: + case UnaryMathFunction::ASin: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_asin_impl); break; - case MMathFunction::ACos: + case UnaryMathFunction::ACos: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_acos_impl); break; - case MMathFunction::Log10: + case UnaryMathFunction::Log10: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_log10_impl); break; - case MMathFunction::Log2: + case UnaryMathFunction::Log2: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_log2_impl); break; - case MMathFunction::Log1P: + case UnaryMathFunction::Log1P: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_log1p_impl); break; - case MMathFunction::ExpM1: + case UnaryMathFunction::ExpM1: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_expm1_impl); break; - case MMathFunction::CosH: + case UnaryMathFunction::CosH: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_cosh_impl); break; - case MMathFunction::SinH: + case UnaryMathFunction::SinH: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_sinh_impl); break; - case MMathFunction::TanH: + case UnaryMathFunction::TanH: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_tanh_impl); break; - case MMathFunction::ACosH: + case UnaryMathFunction::ACosH: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_acosh_impl); break; - case MMathFunction::ASinH: + case UnaryMathFunction::ASinH: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_asinh_impl); break; - case MMathFunction::ATanH: + case UnaryMathFunction::ATanH: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_atanh_impl); break; - case MMathFunction::Trunc: + case UnaryMathFunction::Trunc: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_trunc_impl); break; - case MMathFunction::Cbrt: + case UnaryMathFunction::Cbrt: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_cbrt_impl); break; - case MMathFunction::Floor: + case UnaryMathFunction::Floor: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_floor_impl); break; - case MMathFunction::Ceil: + case UnaryMathFunction::Ceil: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_ceil_impl); break; - case MMathFunction::Round: + case UnaryMathFunction::Round: funptr = JS_FUNC_TO_DATA_PTR(void*, js::math_round_impl); break; default: @@ -8611,17 +8611,17 @@ void CodeGenerator::visitMathFunctionF(LMathFunctionF* ins) { void* funptr = nullptr; CheckUnsafeCallWithABI check = CheckUnsafeCallWithABI::Check; switch (ins->mir()->function()) { - case MMathFunction::Floor: + case UnaryMathFunction::Floor: funptr = JS_FUNC_TO_DATA_PTR(void*, floorf); check = CheckUnsafeCallWithABI::DontCheckOther; break; - case MMathFunction::Round: + case UnaryMathFunction::Round: funptr = JS_FUNC_TO_DATA_PTR(void*, math_roundf_impl); break; - case MMathFunction::Trunc: + case UnaryMathFunction::Trunc: funptr = JS_FUNC_TO_DATA_PTR(void*, math_truncf_impl); break; - case MMathFunction::Ceil: + case UnaryMathFunction::Ceil: funptr = JS_FUNC_TO_DATA_PTR(void*, ceilf); check = CheckUnsafeCallWithABI::DontCheckOther; break; diff --git a/js/src/jit/IonBuilder.h b/js/src/jit/IonBuilder.h index f7cadcfac59c..07f11abc1337 100644 --- a/js/src/jit/IonBuilder.h +++ b/js/src/jit/IonBuilder.h @@ -758,7 +758,7 @@ class MOZ_STACK_CLASS IonBuilder { InliningResult inlineMathTrunc(CallInfo& callInfo); InliningResult inlineMathSign(CallInfo& callInfo); InliningResult inlineMathFunction(CallInfo& callInfo, - MMathFunction::Function function); + UnaryMathFunction function); // String natives. InliningResult inlineStringObject(CallInfo& callInfo); diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp index 0f7beef86844..3fa3e08dc3e7 100644 --- a/js/src/jit/MCallOptimize.cpp +++ b/js/src/jit/MCallOptimize.cpp @@ -427,43 +427,43 @@ IonBuilder::InliningResult IonBuilder::inlineNativeCall(CallInfo& callInfo, case InlinableNative::MathSign: return inlineMathSign(callInfo); case InlinableNative::MathSin: - return inlineMathFunction(callInfo, MMathFunction::Sin); + return inlineMathFunction(callInfo, UnaryMathFunction::Sin); case InlinableNative::MathTan: - return inlineMathFunction(callInfo, MMathFunction::Tan); + return inlineMathFunction(callInfo, UnaryMathFunction::Tan); case InlinableNative::MathCos: - return inlineMathFunction(callInfo, MMathFunction::Cos); + return inlineMathFunction(callInfo, UnaryMathFunction::Cos); case InlinableNative::MathExp: - return inlineMathFunction(callInfo, MMathFunction::Exp); + return inlineMathFunction(callInfo, UnaryMathFunction::Exp); case InlinableNative::MathLog: - return inlineMathFunction(callInfo, MMathFunction::Log); + return inlineMathFunction(callInfo, UnaryMathFunction::Log); case InlinableNative::MathASin: - return inlineMathFunction(callInfo, MMathFunction::ASin); + return inlineMathFunction(callInfo, UnaryMathFunction::ASin); case InlinableNative::MathATan: - return inlineMathFunction(callInfo, MMathFunction::ATan); + return inlineMathFunction(callInfo, UnaryMathFunction::ATan); case InlinableNative::MathACos: - return inlineMathFunction(callInfo, MMathFunction::ACos); + return inlineMathFunction(callInfo, UnaryMathFunction::ACos); case InlinableNative::MathLog10: - return inlineMathFunction(callInfo, MMathFunction::Log10); + return inlineMathFunction(callInfo, UnaryMathFunction::Log10); case InlinableNative::MathLog2: - return inlineMathFunction(callInfo, MMathFunction::Log2); + return inlineMathFunction(callInfo, UnaryMathFunction::Log2); case InlinableNative::MathLog1P: - return inlineMathFunction(callInfo, MMathFunction::Log1P); + return inlineMathFunction(callInfo, UnaryMathFunction::Log1P); case InlinableNative::MathExpM1: - return inlineMathFunction(callInfo, MMathFunction::ExpM1); + return inlineMathFunction(callInfo, UnaryMathFunction::ExpM1); case InlinableNative::MathCosH: - return inlineMathFunction(callInfo, MMathFunction::CosH); + return inlineMathFunction(callInfo, UnaryMathFunction::CosH); case InlinableNative::MathSinH: - return inlineMathFunction(callInfo, MMathFunction::SinH); + return inlineMathFunction(callInfo, UnaryMathFunction::SinH); case InlinableNative::MathTanH: - return inlineMathFunction(callInfo, MMathFunction::TanH); + return inlineMathFunction(callInfo, UnaryMathFunction::TanH); case InlinableNative::MathACosH: - return inlineMathFunction(callInfo, MMathFunction::ACosH); + return inlineMathFunction(callInfo, UnaryMathFunction::ACosH); case InlinableNative::MathASinH: - return inlineMathFunction(callInfo, MMathFunction::ASinH); + return inlineMathFunction(callInfo, UnaryMathFunction::ASinH); case InlinableNative::MathATanH: - return inlineMathFunction(callInfo, MMathFunction::ATanH); + return inlineMathFunction(callInfo, UnaryMathFunction::ATanH); case InlinableNative::MathCbrt: - return inlineMathFunction(callInfo, MMathFunction::Cbrt); + return inlineMathFunction(callInfo, UnaryMathFunction::Cbrt); // Reflect natives. case InlinableNative::ReflectGetPrototypeOf: @@ -740,7 +740,7 @@ MIRType IonBuilder::getInlineReturnType() { } IonBuilder::InliningResult IonBuilder::inlineMathFunction( - CallInfo& callInfo, MMathFunction::Function function) { + CallInfo& callInfo, UnaryMathFunction function) { if (callInfo.constructing()) { return InliningStatus_NotInlined; } @@ -1429,7 +1429,7 @@ IonBuilder::InliningResult IonBuilder::inlineMathFloor(CallInfo& callInfo) { RoundingMode::Down); } else { ins = MMathFunction::New(alloc(), callInfo.getArg(0), - MMathFunction::Floor); + UnaryMathFunction::Floor); } current->add(ins); @@ -1481,7 +1481,7 @@ IonBuilder::InliningResult IonBuilder::inlineMathCeil(CallInfo& callInfo) { RoundingMode::Up); } else { ins = MMathFunction::New(alloc(), callInfo.getArg(0), - MMathFunction::Ceil); + UnaryMathFunction::Ceil); } current->add(ins); @@ -1547,8 +1547,8 @@ IonBuilder::InliningResult IonBuilder::inlineMathRound(CallInfo& callInfo) { if (IsFloatingPointType(argType) && returnType == MIRType::Double) { callInfo.setImplicitlyUsedUnchecked(); - MMathFunction* ins = - MMathFunction::New(alloc(), callInfo.getArg(0), MMathFunction::Round); + MMathFunction* ins = MMathFunction::New(alloc(), callInfo.getArg(0), + UnaryMathFunction::Round); current->add(ins); current->push(ins); return InliningStatus_Inlined; @@ -1783,7 +1783,7 @@ IonBuilder::InliningResult IonBuilder::inlineMathTrunc(CallInfo& callInfo) { RoundingMode::TowardsZero); } else { ins = MMathFunction::New(alloc(), callInfo.getArg(0), - MMathFunction::Trunc); + UnaryMathFunction::Trunc); } current->add(ins); @@ -3638,7 +3638,7 @@ IonBuilder::InliningResult IonBuilder::inlineToInteger(CallInfo& callInfo) { ins = MNearbyInt::New(alloc(), input, MIRType::Double, RoundingMode::TowardsZero); } else { - ins = MMathFunction::New(alloc(), input, MMathFunction::Trunc); + ins = MMathFunction::New(alloc(), input, UnaryMathFunction::Trunc); } current->add(ins); diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp index 7c00becd0935..1540c8ed68b4 100644 --- a/js/src/jit/MIR.cpp +++ b/js/src/jit/MIR.cpp @@ -13,6 +13,7 @@ #include "mozilla/MathAlgorithms.h" #include "jslibmath.h" +#include "jsmath.h" #include "builtin/RegExp.h" #include "jit/AtomicOperations.h" @@ -1373,53 +1374,53 @@ MDefinition* MSign::foldsTo(TempAllocator& alloc) { return MConstant::New(alloc, DoubleValue(out)); } -const char* MMathFunction::FunctionName(Function function) { +const char* MMathFunction::FunctionName(UnaryMathFunction function) { switch (function) { - case Log: + case UnaryMathFunction::Log: return "Log"; - case Sin: + case UnaryMathFunction::Sin: return "Sin"; - case Cos: + case UnaryMathFunction::Cos: return "Cos"; - case Exp: + case UnaryMathFunction::Exp: return "Exp"; - case Tan: + case UnaryMathFunction::Tan: return "Tan"; - case ACos: + case UnaryMathFunction::ACos: return "ACos"; - case ASin: + case UnaryMathFunction::ASin: return "ASin"; - case ATan: + case UnaryMathFunction::ATan: return "ATan"; - case Log10: + case UnaryMathFunction::Log10: return "Log10"; - case Log2: + case UnaryMathFunction::Log2: return "Log2"; - case Log1P: + case UnaryMathFunction::Log1P: return "Log1P"; - case ExpM1: + case UnaryMathFunction::ExpM1: return "ExpM1"; - case CosH: + case UnaryMathFunction::CosH: return "CosH"; - case SinH: + case UnaryMathFunction::SinH: return "SinH"; - case TanH: + case UnaryMathFunction::TanH: return "TanH"; - case ACosH: + case UnaryMathFunction::ACosH: return "ACosH"; - case ASinH: + case UnaryMathFunction::ASinH: return "ASinH"; - case ATanH: + case UnaryMathFunction::ATanH: return "ATanH"; - case Trunc: + case UnaryMathFunction::Trunc: return "Trunc"; - case Cbrt: + case UnaryMathFunction::Cbrt: return "Cbrt"; - case Floor: + case UnaryMathFunction::Floor: return "Floor"; - case Ceil: + case UnaryMathFunction::Ceil: return "Ceil"; - case Round: + case UnaryMathFunction::Round: return "Round"; default: MOZ_CRASH("Unknown math function"); @@ -1443,73 +1444,73 @@ MDefinition* MMathFunction::foldsTo(TempAllocator& alloc) { double in = input->toConstant()->numberToDouble(); double out; switch (function_) { - case Log: + case UnaryMathFunction::Log: out = js::math_log_impl(in); break; - case Sin: + case UnaryMathFunction::Sin: out = js::math_sin_impl(in); break; - case Cos: + case UnaryMathFunction::Cos: out = js::math_cos_impl(in); break; - case Exp: + case UnaryMathFunction::Exp: out = js::math_exp_impl(in); break; - case Tan: + case UnaryMathFunction::Tan: out = js::math_tan_impl(in); break; - case ACos: + case UnaryMathFunction::ACos: out = js::math_acos_impl(in); break; - case ASin: + case UnaryMathFunction::ASin: out = js::math_asin_impl(in); break; - case ATan: + case UnaryMathFunction::ATan: out = js::math_atan_impl(in); break; - case Log10: + case UnaryMathFunction::Log10: out = js::math_log10_impl(in); break; - case Log2: + case UnaryMathFunction::Log2: out = js::math_log2_impl(in); break; - case Log1P: + case UnaryMathFunction::Log1P: out = js::math_log1p_impl(in); break; - case ExpM1: + case UnaryMathFunction::ExpM1: out = js::math_expm1_impl(in); break; - case CosH: + case UnaryMathFunction::CosH: out = js::math_cosh_impl(in); break; - case SinH: + case UnaryMathFunction::SinH: out = js::math_sinh_impl(in); break; - case TanH: + case UnaryMathFunction::TanH: out = js::math_tanh_impl(in); break; - case ACosH: + case UnaryMathFunction::ACosH: out = js::math_acosh_impl(in); break; - case ASinH: + case UnaryMathFunction::ASinH: out = js::math_asinh_impl(in); break; - case ATanH: + case UnaryMathFunction::ATanH: out = js::math_atanh_impl(in); break; - case Trunc: + case UnaryMathFunction::Trunc: out = js::math_trunc_impl(in); break; - case Cbrt: + case UnaryMathFunction::Cbrt: out = js::math_cbrt_impl(in); break; - case Floor: + case UnaryMathFunction::Floor: out = js::math_floor_impl(in); break; - case Ceil: + case UnaryMathFunction::Ceil: out = js::math_ceil_impl(in); break; - case Round: + case UnaryMathFunction::Round: out = js::math_round_impl(in); break; default: @@ -3237,6 +3238,32 @@ void MMathFunction::trySpecializeFloat32(TempAllocator& alloc) { specialization_ = MIRType::Float32; } +bool MMathFunction::isFloat32Commutative() const { + switch (function_) { + case UnaryMathFunction::Floor: + case UnaryMathFunction::Ceil: + case UnaryMathFunction::Round: + case UnaryMathFunction::Trunc: + return true; + default: + return false; + } +} + +bool MMathFunction::canRecoverOnBailout() const { + switch (function_) { + case UnaryMathFunction::Sin: + case UnaryMathFunction::Log: + case UnaryMathFunction::Ceil: + case UnaryMathFunction::Floor: + case UnaryMathFunction::Round: + case UnaryMathFunction::Trunc: + return true; + default: + return false; + } +} + MHypot* MHypot::New(TempAllocator& alloc, const MDefinitionVector& vector) { uint32_t length = vector.length(); MHypot* hypot = new (alloc) MHypot; diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index 91af7d75f598..11fcf8a69aa9 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -45,6 +45,8 @@ class FuncExport; class StringObject; +enum class UnaryMathFunction : uint8_t; + namespace jit { // Forward declarations of MIR types. @@ -5277,39 +5279,11 @@ class MSign : public MUnaryInstruction, public SignPolicy::Data { class MMathFunction : public MUnaryInstruction, public FloatingPointPolicy<0>::Data { - public: - enum Function { - Log, - Sin, - Cos, - Exp, - Tan, - ACos, - ASin, - ATan, - Log10, - Log2, - Log1P, - ExpM1, - CosH, - SinH, - TanH, - ACosH, - ASinH, - ATanH, - Trunc, - Cbrt, - Floor, - Ceil, - Round - }; - - private: - Function function_; + UnaryMathFunction function_; // A nullptr cache means this function will neither access nor update the // cache. - MMathFunction(MDefinition* input, Function function) + MMathFunction(MDefinition* input, UnaryMathFunction function) : MUnaryInstruction(classOpcode, input), function_(function) { setResultType(MIRType::Double); specialization_ = MIRType::Double; @@ -5320,7 +5294,7 @@ class MMathFunction : public MUnaryInstruction, INSTRUCTION_HEADER(MathFunction) TRIVIAL_NEW_WRAPPERS - Function function() const { return function_; } + UnaryMathFunction function() const { return function_; } bool congruentTo(const MDefinition* ins) const override { if (!ins->isMathFunction()) { @@ -5342,29 +5316,16 @@ class MMathFunction : public MUnaryInstruction, void printOpcode(GenericPrinter& out) const override; #endif - static const char* FunctionName(Function function); + static const char* FunctionName(UnaryMathFunction function); - bool isFloat32Commutative() const override { - return function_ == Floor || function_ == Ceil || function_ == Round || - function_ == Trunc; - } + bool isFloat32Commutative() const override; void trySpecializeFloat32(TempAllocator& alloc) override; + void computeRange(TempAllocator& alloc) override; + MOZ_MUST_USE bool writeRecoverData( CompactBufferWriter& writer) const override; - bool canRecoverOnBailout() const override { - switch (function_) { - case Sin: - case Log: - case Ceil: - case Floor: - case Round: - case Trunc: - return true; - default: - return false; - } - } + bool canRecoverOnBailout() const override; ALLOW_CLONE(MMathFunction) }; diff --git a/js/src/jit/RangeAnalysis.cpp b/js/src/jit/RangeAnalysis.cpp index 48a11069415b..8f4f3e31af40 100644 --- a/js/src/jit/RangeAnalysis.cpp +++ b/js/src/jit/RangeAnalysis.cpp @@ -11,6 +11,7 @@ #include +#include "jsmath.h" #include "jsnum.h" #include "jit/Ion.h" @@ -1835,8 +1836,8 @@ void MArrayPush::computeRange(TempAllocator& alloc) { void MMathFunction::computeRange(TempAllocator& alloc) { Range opRange(getOperand(0)); switch (function()) { - case Sin: - case Cos: + case UnaryMathFunction::Sin: + case UnaryMathFunction::Cos: if (!opRange.canBeInfiniteOrNaN()) { setRange(Range::NewDoubleRange(alloc, -1.0, 1.0)); } diff --git a/js/src/jit/Recover.cpp b/js/src/jit/Recover.cpp index 67f9a8c45046..087110ed6bc0 100644 --- a/js/src/jit/Recover.cpp +++ b/js/src/jit/Recover.cpp @@ -892,22 +892,23 @@ bool RSign::recover(JSContext* cx, SnapshotIterator& iter) const { bool MMathFunction::writeRecoverData(CompactBufferWriter& writer) const { MOZ_ASSERT(canRecoverOnBailout()); switch (function_) { - case Ceil: + case UnaryMathFunction::Ceil: writer.writeUnsigned(uint32_t(RInstruction::Recover_Ceil)); return true; - case Floor: + case UnaryMathFunction::Floor: writer.writeUnsigned(uint32_t(RInstruction::Recover_Floor)); return true; - case Round: + case UnaryMathFunction::Round: writer.writeUnsigned(uint32_t(RInstruction::Recover_Round)); return true; - case Trunc: + case UnaryMathFunction::Trunc: writer.writeUnsigned(uint32_t(RInstruction::Recover_Trunc)); return true; - case Sin: - case Log: + case UnaryMathFunction::Sin: + case UnaryMathFunction::Log: + static_assert(sizeof(UnaryMathFunction) == sizeof(uint8_t)); writer.writeUnsigned(uint32_t(RInstruction::Recover_MathFunction)); - writer.writeByte(function_); + writer.writeByte(uint8_t(function_)); return true; default: MOZ_CRASH("Unknown math function."); @@ -915,12 +916,12 @@ bool MMathFunction::writeRecoverData(CompactBufferWriter& writer) const { } RMathFunction::RMathFunction(CompactBufferReader& reader) { - function_ = reader.readByte(); + function_ = UnaryMathFunction(reader.readByte()); } bool RMathFunction::recover(JSContext* cx, SnapshotIterator& iter) const { switch (function_) { - case MMathFunction::Sin: { + case UnaryMathFunction::Sin: { RootedValue arg(cx, iter.read()); RootedValue result(cx); @@ -931,7 +932,7 @@ bool RMathFunction::recover(JSContext* cx, SnapshotIterator& iter) const { iter.storeInstructionResult(result); return true; } - case MMathFunction::Log: { + case UnaryMathFunction::Log: { RootedValue arg(cx, iter.read()); RootedValue result(cx); diff --git a/js/src/jit/Recover.h b/js/src/jit/Recover.h index fb7ba4432f28..5145858975a7 100644 --- a/js/src/jit/Recover.h +++ b/js/src/jit/Recover.h @@ -488,7 +488,7 @@ class RSign final : public RInstruction { class RMathFunction final : public RInstruction { private: - uint8_t function_; + UnaryMathFunction function_; public: RINSTRUCTION_HEADER_NUM_OP_(MathFunction, 1) diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index ba90e6789c0a..07b09e38c7bb 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -52,8 +52,6 @@ using mozilla::NumberEqualsInt32; using mozilla::PositiveInfinity; using mozilla::WrappingMultiply; -using UnaryMathFunctionType = double (*)(double); - template static bool math_function(JSContext* cx, HandleValue val, MutableHandleValue res) { diff --git a/js/src/jsmath.h b/js/src/jsmath.h index 588063b355a1..964041aa5396 100644 --- a/js/src/jsmath.h +++ b/js/src/jsmath.h @@ -15,7 +15,36 @@ namespace js { -using UnaryFunType = double (*)(double); +using UnaryMathFunctionType = double (*)(double); + +// Used for inlining calls to double => double Math functions from JIT code. +// Note that this list does not include all unary Math functions: abs and sqrt +// for example are missing because the JITs optimize them without a C++ call. +enum class UnaryMathFunction : uint8_t { + Log, + Sin, + Cos, + Exp, + Tan, + ACos, + ASin, + ATan, + Log10, + Log2, + Log1P, + ExpM1, + CosH, + SinH, + TanH, + ACosH, + ASinH, + ATanH, + Trunc, + Cbrt, + Floor, + Ceil, + Round, +}; /* * JS math functions.