| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 #define UNARY_MATH_FUNCTION(name, generator) \ | 190 #define UNARY_MATH_FUNCTION(name, generator) \ |
| 191 static UnaryMathFunction fast_##name##_function = NULL; \ | 191 static UnaryMathFunction fast_##name##_function = NULL; \ |
| 192 void init_fast_##name##_function() { \ | 192 void init_fast_##name##_function() { \ |
| 193 fast_##name##_function = generator; \ | 193 fast_##name##_function = generator; \ |
| 194 } \ | 194 } \ |
| 195 double fast_##name(double x) { \ | 195 double fast_##name(double x) { \ |
| 196 return (*fast_##name##_function)(x); \ | 196 return (*fast_##name##_function)(x); \ |
| 197 } | 197 } |
| 198 | 198 |
| 199 UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) | |
| 200 UNARY_MATH_FUNCTION(exp, CreateExpFunction()) | 199 UNARY_MATH_FUNCTION(exp, CreateExpFunction()) |
| 201 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) | 200 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) |
| 202 | 201 |
| 203 #undef UNARY_MATH_FUNCTION | 202 #undef UNARY_MATH_FUNCTION |
| 204 | 203 |
| 205 | 204 |
| 206 void lazily_initialize_fast_exp() { | 205 void lazily_initialize_fast_exp() { |
| 207 if (fast_exp_function == NULL) { | 206 if (fast_exp_function == NULL) { |
| 208 init_fast_exp_function(); | 207 init_fast_exp_function(); |
| 209 } | 208 } |
| 210 } | 209 } |
| 211 | 210 |
| 212 | 211 |
| 213 void MathSetup() { | 212 void MathSetup() { |
| 214 #ifdef _WIN64 | 213 #ifdef _WIN64 |
| 215 init_modulo_function(); | 214 init_modulo_function(); |
| 216 #endif | 215 #endif |
| 217 init_fast_log_function(); | |
| 218 // fast_exp is initialized lazily. | 216 // fast_exp is initialized lazily. |
| 219 init_fast_sqrt_function(); | 217 init_fast_sqrt_function(); |
| 220 } | 218 } |
| 221 | 219 |
| 222 | 220 |
| 223 // ---------------------------------------------------------------------------- | 221 // ---------------------------------------------------------------------------- |
| 224 // The Time class represents time on win32. A timestamp is represented as | 222 // The Time class represents time on win32. A timestamp is represented as |
| 225 // a 64-bit integer in 100 nanoseconds since January 1, 1601 (UTC). JavaScript | 223 // a 64-bit integer in 100 nanoseconds since January 1, 1601 (UTC). JavaScript |
| 226 // timestamps are represented as a doubles in milliseconds since 00:00:00 UTC, | 224 // timestamps are represented as a doubles in milliseconds since 00:00:00 UTC, |
| 227 // January 1, 1970. | 225 // January 1, 1970. |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1507 ASSERT(result); | 1505 ASSERT(result); |
| 1508 } | 1506 } |
| 1509 | 1507 |
| 1510 | 1508 |
| 1511 | 1509 |
| 1512 void Thread::YieldCPU() { | 1510 void Thread::YieldCPU() { |
| 1513 Sleep(0); | 1511 Sleep(0); |
| 1514 } | 1512 } |
| 1515 | 1513 |
| 1516 } } // namespace v8::internal | 1514 } } // namespace v8::internal |
| OLD | NEW |