Index: src/platform-posix.cc |
diff --git a/src/platform-posix.cc b/src/platform-posix.cc |
index 3bc83733ca21249808c74388dd98de6be4125497..0016d59d3a72ecf3c0609cc87396b1928071b71f 100644 |
--- a/src/platform-posix.cc |
+++ b/src/platform-posix.cc |
@@ -142,11 +142,19 @@ UNARY_MATH_FUNCTION(sin, CreateTranscendentalFunction(TranscendentalCache::SIN)) |
UNARY_MATH_FUNCTION(cos, CreateTranscendentalFunction(TranscendentalCache::COS)) |
UNARY_MATH_FUNCTION(tan, CreateTranscendentalFunction(TranscendentalCache::TAN)) |
UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) |
+UNARY_MATH_FUNCTION(exp, CreateExpFunction()) |
UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) |
#undef MATH_FUNCTION |
+void lazily_initialize_fast_exp() { |
+ if (fast_exp_function == NULL) { |
+ init_fast_exp_function(); |
+ } |
+} |
+ |
+ |
double OS::nan_value() { |
// NAN from math.h is defined in C99 and not in POSIX. |
return NAN; |
@@ -332,6 +340,7 @@ void POSIXPostSetUp() { |
init_fast_cos_function(); |
init_fast_tan_function(); |
init_fast_log_function(); |
+ // fast_exp is initialized lazily. |
init_fast_sqrt_function(); |
} |