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(log, CreateTranscendentalFunction(TranscendentalCache::LOG)) | |
306 UNARY_MATH_FUNCTION(exp, CreateExpFunction()) | 305 UNARY_MATH_FUNCTION(exp, CreateExpFunction()) |
307 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) | 306 UNARY_MATH_FUNCTION(sqrt, CreateSqrtFunction()) |
308 | 307 |
309 #undef UNARY_MATH_FUNCTION | 308 #undef UNARY_MATH_FUNCTION |
310 | 309 |
311 | 310 |
312 void lazily_initialize_fast_exp() { | 311 void lazily_initialize_fast_exp() { |
313 if (fast_exp_function == NULL) { | 312 if (fast_exp_function == NULL) { |
314 init_fast_exp_function(); | 313 init_fast_exp_function(); |
315 } | 314 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 } | 519 } |
521 #elif defined(V8_HOST_ARCH_ARM) | 520 #elif defined(V8_HOST_ARCH_ARM) |
522 OS::memcopy_uint8_function = | 521 OS::memcopy_uint8_function = |
523 CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper); | 522 CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper); |
524 OS::memcopy_uint16_uint8_function = | 523 OS::memcopy_uint16_uint8_function = |
525 CreateMemCopyUint16Uint8Function(&OS::MemCopyUint16Uint8Wrapper); | 524 CreateMemCopyUint16Uint8Function(&OS::MemCopyUint16Uint8Wrapper); |
526 #elif defined(V8_HOST_ARCH_MIPS) | 525 #elif defined(V8_HOST_ARCH_MIPS) |
527 OS::memcopy_uint8_function = | 526 OS::memcopy_uint8_function = |
528 CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper); | 527 CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper); |
529 #endif | 528 #endif |
530 init_fast_log_function(); | |
531 // fast_exp is initialized lazily. | 529 // fast_exp is initialized lazily. |
532 init_fast_sqrt_function(); | 530 init_fast_sqrt_function(); |
533 } | 531 } |
534 | 532 |
535 | 533 |
536 // ---------------------------------------------------------------------------- | 534 // ---------------------------------------------------------------------------- |
537 // POSIX string support. | 535 // POSIX string support. |
538 // | 536 // |
539 | 537 |
540 char* OS::StrChr(char* str, int c) { | 538 char* OS::StrChr(char* str, int c) { |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 | 769 |
772 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 770 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
773 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 771 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
774 int result = pthread_setspecific(pthread_key, value); | 772 int result = pthread_setspecific(pthread_key, value); |
775 ASSERT_EQ(0, result); | 773 ASSERT_EQ(0, result); |
776 USE(result); | 774 USE(result); |
777 } | 775 } |
778 | 776 |
779 | 777 |
780 } } // namespace v8::internal | 778 } } // namespace v8::internal |
OLD | NEW |