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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 #endif // _WIN64 | 197 #endif // _WIN64 |
198 | 198 |
199 | 199 |
200 #define UNARY_MATH_FUNCTION(name, generator) \ | 200 #define UNARY_MATH_FUNCTION(name, generator) \ |
201 static UnaryMathFunction fast_##name##_function = NULL; \ | 201 static UnaryMathFunction fast_##name##_function = NULL; \ |
202 V8_DECLARE_ONCE(fast_##name##_init_once); \ | 202 V8_DECLARE_ONCE(fast_##name##_init_once); \ |
203 void init_fast_##name##_function() { \ | 203 void init_fast_##name##_function() { \ |
204 fast_##name##_function = generator; \ | 204 fast_##name##_function = generator; \ |
205 } \ | 205 } \ |
206 double fast_##name(double x) { \ | 206 double fast_##name(double x) { \ |
207 CallOnce(&fast_##name##_init_once, \ | 207 if (!fast_##name##_function ) { \ |
208 &init_fast_##name##_function); \ | 208 CallOnce(&fast_##name##_init_once, \ |
| 209 &init_fast_##name##_function); \ |
| 210 } \ |
209 return (*fast_##name##_function)(x); \ | 211 return (*fast_##name##_function)(x); \ |
210 } | 212 } |
211 | 213 |
212 UNARY_MATH_FUNCTION(sin, CreateTranscendentalFunction(TranscendentalCache::SIN)) | 214 UNARY_MATH_FUNCTION(sin, CreateTranscendentalFunction(TranscendentalCache::SIN)) |
213 UNARY_MATH_FUNCTION(cos, CreateTranscendentalFunction(TranscendentalCache::COS)) | 215 UNARY_MATH_FUNCTION(cos, CreateTranscendentalFunction(TranscendentalCache::COS)) |
214 UNARY_MATH_FUNCTION(tan, CreateTranscendentalFunction(TranscendentalCache::TAN)) | 216 UNARY_MATH_FUNCTION(tan, CreateTranscendentalFunction(TranscendentalCache::TAN)) |
215 UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) | 217 UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) |
216 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) | 218 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) |
217 | 219 |
218 #undef MATH_FUNCTION | 220 #undef MATH_FUNCTION |
(...skipping 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2087 | 2089 |
2088 | 2090 |
2089 void Sampler::Stop() { | 2091 void Sampler::Stop() { |
2090 ASSERT(IsActive()); | 2092 ASSERT(IsActive()); |
2091 SamplerThread::RemoveActiveSampler(this); | 2093 SamplerThread::RemoveActiveSampler(this); |
2092 SetActive(false); | 2094 SetActive(false); |
2093 } | 2095 } |
2094 | 2096 |
2095 | 2097 |
2096 } } // namespace v8::internal | 2098 } } // namespace v8::internal |
OLD | NEW |