| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 // Copy memory area to disjoint memory area. | 391 // Copy memory area to disjoint memory area. |
| 392 static void MemCopy(void* dest, const void* src, size_t size) { | 392 static void MemCopy(void* dest, const void* src, size_t size) { |
| 393 memcpy(dest, src, size); | 393 memcpy(dest, src, size); |
| 394 } | 394 } |
| 395 static void MemMove(void* dest, const void* src, size_t size) { | 395 static void MemMove(void* dest, const void* src, size_t size) { |
| 396 memmove(dest, src, size); | 396 memmove(dest, src, size); |
| 397 } | 397 } |
| 398 static const int kMinComplexMemCopy = 16 * kPointerSize; | 398 static const int kMinComplexMemCopy = 16 * kPointerSize; |
| 399 #endif // V8_TARGET_ARCH_IA32 | 399 #endif // V8_TARGET_ARCH_IA32 |
| 400 | 400 |
| 401 // Perform the per-thread setup necessary for specific OSes and CPUs. |
| 402 static void PerThreadSetUp() { |
| 403 #if V8_OS_QNX && defined(V8_HOST_ARCH_ARM) |
| 404 // Clear the ARM_VFP_FPSCR_FZ flag in the FPSCR register. |
| 405 // This disables the flush-to-zero mode in the VFP, allowing |
| 406 // the handling of subnormals. |
| 407 asm volatile( |
| 408 "vmrs r3, fpscr \n\t" |
| 409 "bic r3, r3, 0x01000000 \n\t" |
| 410 "vmsr fpscr, r3" |
| 411 : : : "r3"); |
| 412 #endif // V8_OS_QNX && V8_HOST_ARCH_ARM |
| 413 } |
| 414 |
| 401 static int GetCurrentProcessId(); | 415 static int GetCurrentProcessId(); |
| 402 | 416 |
| 403 private: | 417 private: |
| 404 static const int msPerSecond = 1000; | 418 static const int msPerSecond = 1000; |
| 405 | 419 |
| 406 DISALLOW_IMPLICIT_CONSTRUCTORS(OS); | 420 DISALLOW_IMPLICIT_CONSTRUCTORS(OS); |
| 407 }; | 421 }; |
| 408 | 422 |
| 409 // Represents and controls an area of reserved memory. | 423 // Represents and controls an area of reserved memory. |
| 410 // Control of the reserved memory can be assigned to another VirtualMemory | 424 // Control of the reserved memory can be assigned to another VirtualMemory |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 char name_[kMaxThreadNameLength]; | 624 char name_[kMaxThreadNameLength]; |
| 611 int stack_size_; | 625 int stack_size_; |
| 612 Semaphore* start_semaphore_; | 626 Semaphore* start_semaphore_; |
| 613 | 627 |
| 614 DISALLOW_COPY_AND_ASSIGN(Thread); | 628 DISALLOW_COPY_AND_ASSIGN(Thread); |
| 615 }; | 629 }; |
| 616 | 630 |
| 617 } } // namespace v8::internal | 631 } } // namespace v8::internal |
| 618 | 632 |
| 619 #endif // V8_PLATFORM_H_ | 633 #endif // V8_PLATFORM_H_ |
| OLD | NEW |