OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 gets enough CPU information to optimize the | 5 // This module gets enough CPU information to optimize the |
6 // atomicops module on x86. | 6 // atomicops module on x86. |
7 | 7 |
8 #include <string.h> // NOLINT(build/include) | 8 #include <string.h> // NOLINT(build/include) |
9 | 9 |
10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // Set the flags so that code will run correctly and conservatively, so even | 40 // Set the flags so that code will run correctly and conservatively, so even |
41 // if we haven't been initialized yet, we're probably single threaded, and our | 41 // if we haven't been initialized yet, we're probably single threaded, and our |
42 // default values should hopefully be pretty safe. | 42 // default values should hopefully be pretty safe. |
43 struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures = { | 43 struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures = { |
44 false, // bug can't exist before process spawns multiple threads | 44 false, // bug can't exist before process spawns multiple threads |
45 #if !defined(__SSE2__) | 45 #if !defined(__SSE2__) |
46 false, // no SSE2 | 46 false, // no SSE2 |
47 #endif | 47 #endif |
48 }; | 48 }; |
49 | 49 |
50 } } // namespace v8::base | 50 } // namespace base |
| 51 } // namespace v8 |
51 | 52 |
52 namespace { | 53 namespace { |
53 | 54 |
54 // Initialize the AtomicOps_Internalx86CPUFeatures struct. | 55 // Initialize the AtomicOps_Internalx86CPUFeatures struct. |
55 void AtomicOps_Internalx86CPUFeaturesInit() { | 56 void AtomicOps_Internalx86CPUFeaturesInit() { |
56 using v8::base::AtomicOps_Internalx86CPUFeatures; | 57 using v8::base::AtomicOps_Internalx86CPUFeatures; |
57 | 58 |
58 uint32_t eax = 0; | 59 uint32_t eax = 0; |
59 uint32_t ebx = 0; | 60 uint32_t ebx = 0; |
60 uint32_t ecx = 0; | 61 uint32_t ecx = 0; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 107 |
107 | 108 |
108 // A global to get use initialized on startup via static initialization :/ | 109 // A global to get use initialized on startup via static initialization :/ |
109 AtomicOpsx86Initializer g_initer; | 110 AtomicOpsx86Initializer g_initer; |
110 | 111 |
111 } // namespace | 112 } // namespace |
112 | 113 |
113 #endif // if x86 | 114 #endif // if x86 |
114 | 115 |
115 #endif // ifdef V8_BASE_ATOMICOPS_INTERNALS_X86_GCC_H_ | 116 #endif // ifdef V8_BASE_ATOMICOPS_INTERNALS_X86_GCC_H_ |
OLD | NEW |