| 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 // This module contains the platform-specific code. This make the rest of the | 5 // This module contains the platform-specific code. This make the rest of the |
| 6 // code less dependent on operating system, compilers and runtime libraries. | 6 // code less dependent on operating system, compilers and runtime libraries. |
| 7 // This module does specifically not deal with differences between different | 7 // This module does specifically not deal with differences between different |
| 8 // processor architecture. | 8 // processor architecture. |
| 9 // The platform classes have the same definition for all platforms. The | 9 // The platform classes have the same definition for all platforms. The |
| 10 // implementation for a particular platform is put in platform_<os>.cc. | 10 // implementation for a particular platform is put in platform_<os>.cc. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 INLINE(intptr_t InternalGetExistingThreadLocal(intptr_t index)); | 50 INLINE(intptr_t InternalGetExistingThreadLocal(intptr_t index)); |
| 51 | 51 |
| 52 inline intptr_t InternalGetExistingThreadLocal(intptr_t index) { | 52 inline intptr_t InternalGetExistingThreadLocal(intptr_t index) { |
| 53 const intptr_t kTibInlineTlsOffset = 0xE10; | 53 const intptr_t kTibInlineTlsOffset = 0xE10; |
| 54 const intptr_t kTibExtraTlsOffset = 0xF94; | 54 const intptr_t kTibExtraTlsOffset = 0xF94; |
| 55 const intptr_t kMaxInlineSlots = 64; | 55 const intptr_t kMaxInlineSlots = 64; |
| 56 const intptr_t kMaxSlots = kMaxInlineSlots + 1024; | 56 const intptr_t kMaxSlots = kMaxInlineSlots + 1024; |
| 57 const intptr_t kPointerSize = sizeof(void*); | 57 const intptr_t kPointerSize = sizeof(void*); |
| 58 DCHECK(0 <= index && index < kMaxSlots); | 58 DCHECK(0 <= index && index < kMaxSlots); |
| 59 USE(kMaxSlots); |
| 59 if (index < kMaxInlineSlots) { | 60 if (index < kMaxInlineSlots) { |
| 60 return static_cast<intptr_t>(__readfsdword(kTibInlineTlsOffset + | 61 return static_cast<intptr_t>(__readfsdword(kTibInlineTlsOffset + |
| 61 kPointerSize * index)); | 62 kPointerSize * index)); |
| 62 } | 63 } |
| 63 intptr_t extra = static_cast<intptr_t>(__readfsdword(kTibExtraTlsOffset)); | 64 intptr_t extra = static_cast<intptr_t>(__readfsdword(kTibExtraTlsOffset)); |
| 64 DCHECK(extra != 0); | 65 DCHECK(extra != 0); |
| 65 return *reinterpret_cast<intptr_t*>(extra + | 66 return *reinterpret_cast<intptr_t*>(extra + |
| 66 kPointerSize * (index - kMaxInlineSlots)); | 67 kPointerSize * (index - kMaxInlineSlots)); |
| 67 } | 68 } |
| 68 | 69 |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 int stack_size_; | 509 int stack_size_; |
| 509 Semaphore* start_semaphore_; | 510 Semaphore* start_semaphore_; |
| 510 | 511 |
| 511 DISALLOW_COPY_AND_ASSIGN(Thread); | 512 DISALLOW_COPY_AND_ASSIGN(Thread); |
| 512 }; | 513 }; |
| 513 | 514 |
| 514 } // namespace base | 515 } // namespace base |
| 515 } // namespace v8 | 516 } // namespace v8 |
| 516 | 517 |
| 517 #endif // V8_BASE_PLATFORM_PLATFORM_H_ | 518 #endif // V8_BASE_PLATFORM_PLATFORM_H_ |
| OLD | NEW |