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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 #define UNARY_MATH_FUNCTION(name, generator) \ | 296 #define UNARY_MATH_FUNCTION(name, generator) \ |
297 static UnaryMathFunction fast_##name##_function = NULL; \ | 297 static UnaryMathFunction fast_##name##_function = NULL; \ |
298 void init_fast_##name##_function() { \ | 298 void init_fast_##name##_function() { \ |
299 fast_##name##_function = generator; \ | 299 fast_##name##_function = generator; \ |
300 } \ | 300 } \ |
301 double fast_##name(double x) { \ | 301 double fast_##name(double x) { \ |
302 return (*fast_##name##_function)(x); \ | 302 return (*fast_##name##_function)(x); \ |
303 } | 303 } |
304 | 304 |
305 UNARY_MATH_FUNCTION(sin, CreateTranscendentalFunction(TranscendentalCache::SIN)) | |
306 UNARY_MATH_FUNCTION(cos, CreateTranscendentalFunction(TranscendentalCache::COS)) | |
307 UNARY_MATH_FUNCTION(tan, CreateTranscendentalFunction(TranscendentalCache::TAN)) | |
308 UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) | 305 UNARY_MATH_FUNCTION(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) |
309 UNARY_MATH_FUNCTION(exp, CreateExpFunction()) | 306 UNARY_MATH_FUNCTION(exp, CreateExpFunction()) |
310 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) | 307 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) |
311 | 308 |
312 #undef UNARY_MATH_FUNCTION | 309 #undef UNARY_MATH_FUNCTION |
313 | 310 |
314 | 311 |
315 void lazily_initialize_fast_exp() { | 312 void lazily_initialize_fast_exp() { |
316 if (fast_exp_function == NULL) { | 313 if (fast_exp_function == NULL) { |
317 init_fast_exp_function(); | 314 init_fast_exp_function(); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 OS::MemMoveFunction generated_memmove = CreateMemMoveFunction(); | 511 OS::MemMoveFunction generated_memmove = CreateMemMoveFunction(); |
515 if (generated_memmove != NULL) { | 512 if (generated_memmove != NULL) { |
516 memmove_function = generated_memmove; | 513 memmove_function = generated_memmove; |
517 } | 514 } |
518 #elif defined(V8_HOST_ARCH_ARM) | 515 #elif defined(V8_HOST_ARCH_ARM) |
519 OS::memcopy_uint8_function = | 516 OS::memcopy_uint8_function = |
520 CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper); | 517 CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper); |
521 OS::memcopy_uint16_uint8_function = | 518 OS::memcopy_uint16_uint8_function = |
522 CreateMemCopyUint16Uint8Function(&OS::MemCopyUint16Uint8Wrapper); | 519 CreateMemCopyUint16Uint8Function(&OS::MemCopyUint16Uint8Wrapper); |
523 #endif | 520 #endif |
524 init_fast_sin_function(); | |
525 init_fast_cos_function(); | |
526 init_fast_tan_function(); | |
527 init_fast_log_function(); | 521 init_fast_log_function(); |
528 // fast_exp is initialized lazily. | 522 // fast_exp is initialized lazily. |
529 init_fast_sqrt_function(); | 523 init_fast_sqrt_function(); |
530 } | 524 } |
531 | 525 |
532 | 526 |
533 // ---------------------------------------------------------------------------- | 527 // ---------------------------------------------------------------------------- |
534 // POSIX string support. | 528 // POSIX string support. |
535 // | 529 // |
536 | 530 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 | 762 |
769 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 763 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
770 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 764 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
771 int result = pthread_setspecific(pthread_key, value); | 765 int result = pthread_setspecific(pthread_key, value); |
772 ASSERT_EQ(0, result); | 766 ASSERT_EQ(0, result); |
773 USE(result); | 767 USE(result); |
774 } | 768 } |
775 | 769 |
776 | 770 |
777 } } // namespace v8::internal | 771 } } // namespace v8::internal |
OLD | NEW |