OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Platform-specific code for POSIX goes here. This is not a platform on its | 5 // Platform-specific code for POSIX goes here. This is not a platform on its |
6 // own, but contains the parts which are the same across the POSIX platforms | 6 // own, but contains the parts which are the same across the POSIX platforms |
7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. | 7 // Linux, MacOS, FreeBSD, OpenBSD, NetBSD and QNX. |
8 | 8 |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #include <pthread.h> | 10 #include <pthread.h> |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 *dest++ = static_cast<uint16_t>(*src++); | 507 *dest++ = static_cast<uint16_t>(*src++); |
508 } | 508 } |
509 } | 509 } |
510 | 510 |
511 | 511 |
512 OS::MemCopyUint8Function OS::memcopy_uint8_function = &OS::MemCopyUint8Wrapper; | 512 OS::MemCopyUint8Function OS::memcopy_uint8_function = &OS::MemCopyUint8Wrapper; |
513 OS::MemCopyUint16Uint8Function OS::memcopy_uint16_uint8_function = | 513 OS::MemCopyUint16Uint8Function OS::memcopy_uint16_uint8_function = |
514 &OS::MemCopyUint16Uint8Wrapper; | 514 &OS::MemCopyUint16Uint8Wrapper; |
515 // Defined in codegen-arm.cc. | 515 // Defined in codegen-arm.cc. |
516 OS::MemCopyUint8Function CreateMemCopyUint8Function( | 516 OS::MemCopyUint8Function CreateMemCopyUint8Function( |
517 bool serializer_enabled, | |
518 OS::MemCopyUint8Function stub); | 517 OS::MemCopyUint8Function stub); |
519 OS::MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function( | 518 OS::MemCopyUint16Uint8Function CreateMemCopyUint16Uint8Function( |
520 bool serializer_enabled, | |
521 OS::MemCopyUint16Uint8Function stub); | 519 OS::MemCopyUint16Uint8Function stub); |
522 | 520 |
523 #elif defined(V8_HOST_ARCH_MIPS) | 521 #elif defined(V8_HOST_ARCH_MIPS) |
524 OS::MemCopyUint8Function OS::memcopy_uint8_function = &OS::MemCopyUint8Wrapper; | 522 OS::MemCopyUint8Function OS::memcopy_uint8_function = &OS::MemCopyUint8Wrapper; |
525 // Defined in codegen-mips.cc. | 523 // Defined in codegen-mips.cc. |
526 OS::MemCopyUint8Function CreateMemCopyUint8Function( | 524 OS::MemCopyUint8Function CreateMemCopyUint8Function( |
527 bool serializer_enabled, | |
528 OS::MemCopyUint8Function stub); | 525 OS::MemCopyUint8Function stub); |
529 #endif | 526 #endif |
530 | 527 |
531 | 528 |
532 void OS::PostSetUp(bool serializer_enabled) { | 529 void OS::PostSetUp() { |
533 #if V8_TARGET_ARCH_IA32 | 530 #if V8_TARGET_ARCH_IA32 |
534 OS::MemMoveFunction generated_memmove = CreateMemMoveFunction(); | 531 OS::MemMoveFunction generated_memmove = CreateMemMoveFunction(); |
535 if (generated_memmove != NULL) { | 532 if (generated_memmove != NULL) { |
536 memmove_function = generated_memmove; | 533 memmove_function = generated_memmove; |
537 } | 534 } |
538 #elif defined(V8_HOST_ARCH_ARM) | 535 #elif defined(V8_HOST_ARCH_ARM) |
539 OS::memcopy_uint8_function = | 536 OS::memcopy_uint8_function = |
540 CreateMemCopyUint8Function(serializer_enabled, &OS::MemCopyUint8Wrapper); | 537 CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper); |
541 OS::memcopy_uint16_uint8_function = | 538 OS::memcopy_uint16_uint8_function = |
542 CreateMemCopyUint16Uint8Function(serializer_enabled, | 539 CreateMemCopyUint16Uint8Function(&OS::MemCopyUint16Uint8Wrapper); |
543 &OS::MemCopyUint16Uint8Wrapper); | |
544 #elif defined(V8_HOST_ARCH_MIPS) | 540 #elif defined(V8_HOST_ARCH_MIPS) |
545 OS::memcopy_uint8_function = | 541 OS::memcopy_uint8_function = |
546 CreateMemCopyUint8Function(serializer_enabled, &OS::MemCopyUint8Wrapper); | 542 CreateMemCopyUint8Function(&OS::MemCopyUint8Wrapper); |
547 #endif | 543 #endif |
548 // fast_exp is initialized lazily. | 544 // fast_exp is initialized lazily. |
549 init_fast_sqrt_function(); | 545 init_fast_sqrt_function(); |
550 } | 546 } |
551 | 547 |
552 | 548 |
553 // ---------------------------------------------------------------------------- | 549 // ---------------------------------------------------------------------------- |
554 // POSIX string support. | 550 // POSIX string support. |
555 // | 551 // |
556 | 552 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 | 789 |
794 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { | 790 void Thread::SetThreadLocal(LocalStorageKey key, void* value) { |
795 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); | 791 pthread_key_t pthread_key = LocalKeyToPthreadKey(key); |
796 int result = pthread_setspecific(pthread_key, value); | 792 int result = pthread_setspecific(pthread_key, value); |
797 ASSERT_EQ(0, result); | 793 ASSERT_EQ(0, result); |
798 USE(result); | 794 USE(result); |
799 } | 795 } |
800 | 796 |
801 | 797 |
802 } } // namespace v8::internal | 798 } } // namespace v8::internal |
OLD | NEW |