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 } |
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 ASSERT(result); | 1506 ASSERT(result); |
1508 } | 1507 } |
1509 | 1508 |
1510 | 1509 |
1511 | 1510 |
1512 void Thread::YieldCPU() { | 1511 void Thread::YieldCPU() { |
1513 Sleep(0); | 1512 Sleep(0); |
1514 } | 1513 } |
1515 | 1514 |
1516 } } // namespace v8::internal | 1515 } } // namespace v8::internal |
OLD | NEW |