OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_BASE_BUILD_CONFIG_H_ | 5 #ifndef V8_BASE_BUILD_CONFIG_H_ |
6 #define V8_BASE_BUILD_CONFIG_H_ | 6 #define V8_BASE_BUILD_CONFIG_H_ |
7 | 7 |
8 #include "include/v8config.h" | 8 #include "include/v8config.h" |
9 | 9 |
10 // Processor architecture detection. For more info on what's defined, see: | 10 // Processor architecture detection. For more info on what's defined, see: |
11 // http://msdn.microsoft.com/en-us/library/b0084kay.aspx | 11 // http://msdn.microsoft.com/en-us/library/b0084kay.aspx |
12 // http://www.agner.org/optimize/calling_conventions.pdf | 12 // http://www.agner.org/optimize/calling_conventions.pdf |
13 // or with gcc, run: "echo | gcc -E -dM -" | 13 // or with gcc, run: "echo | gcc -E -dM -" |
14 #if defined(_M_X64) || defined(__x86_64__) | 14 #if defined(_M_X64) || defined(__x86_64__) |
15 #if defined(__native_client__) | 15 #if defined(__native_client__) |
16 // For Native Client builds of V8, use V8_TARGET_ARCH_ARM, so that V8 | 16 // For Native Client builds of V8, use V8_TARGET_ARCH_ARM, so that V8 |
17 // generates ARM machine code, together with a portable ARM simulator | 17 // generates ARM machine code, together with a portable ARM simulator |
18 // compiled for the host architecture in question. | 18 // compiled for the host architecture in question. |
19 // | 19 // |
20 // Since Native Client is ILP-32 on all architectures we use | 20 // Since Native Client is ILP-32 on all architectures we use |
21 // V8_HOST_ARCH_IA32 on both 32- and 64-bit x86. | 21 // V8_HOST_ARCH_IA32 on both 32- and 64-bit x86. |
22 #define V8_HOST_ARCH_IA32 1 | 22 #define V8_HOST_ARCH_IA32 1 |
23 #define V8_HOST_ARCH_32_BIT 1 | 23 #define V8_HOST_ARCH_32_BIT 1 |
24 #define V8_HOST_CAN_READ_UNALIGNED 1 | 24 #define V8_HOST_CAN_READ_UNALIGNED 1 |
25 #else | 25 #else |
26 #define V8_HOST_ARCH_X64 1 | 26 #define V8_HOST_ARCH_X64 1 |
27 #if defined(__x86_64__) && !defined(__LP64__) | 27 #if defined(__x86_64__) && __SIZEOF_POINTER__ == 4 // Check for x32. |
28 #define V8_HOST_ARCH_32_BIT 1 | 28 #define V8_HOST_ARCH_32_BIT 1 |
29 #else | 29 #else |
30 #define V8_HOST_ARCH_64_BIT 1 | 30 #define V8_HOST_ARCH_64_BIT 1 |
31 #endif | 31 #endif |
32 #define V8_HOST_CAN_READ_UNALIGNED 1 | 32 #define V8_HOST_CAN_READ_UNALIGNED 1 |
33 #endif // __native_client__ | 33 #endif // __native_client__ |
34 #elif defined(_M_IX86) || defined(__i386__) | 34 #elif defined(_M_IX86) || defined(__i386__) |
35 #define V8_HOST_ARCH_IA32 1 | 35 #define V8_HOST_ARCH_IA32 1 |
36 #define V8_HOST_ARCH_32_BIT 1 | 36 #define V8_HOST_ARCH_32_BIT 1 |
37 #define V8_HOST_CAN_READ_UNALIGNED 1 | 37 #define V8_HOST_CAN_READ_UNALIGNED 1 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 #else | 83 #else |
84 #error Target architecture was not detected as supported by v8 | 84 #error Target architecture was not detected as supported by v8 |
85 #endif | 85 #endif |
86 #endif | 86 #endif |
87 | 87 |
88 // Determine architecture pointer size. | 88 // Determine architecture pointer size. |
89 #if V8_TARGET_ARCH_IA32 | 89 #if V8_TARGET_ARCH_IA32 |
90 #define V8_TARGET_ARCH_32_BIT 1 | 90 #define V8_TARGET_ARCH_32_BIT 1 |
91 #elif V8_TARGET_ARCH_X64 | 91 #elif V8_TARGET_ARCH_X64 |
92 #if !V8_TARGET_ARCH_32_BIT && !V8_TARGET_ARCH_64_BIT | 92 #if !V8_TARGET_ARCH_32_BIT && !V8_TARGET_ARCH_64_BIT |
93 #if defined(__x86_64__) && !defined(__LP64__) | 93 #if defined(__x86_64__) && __SIZEOF_POINTER__ == 4 // Check for x32. |
94 #define V8_TARGET_ARCH_32_BIT 1 | 94 #define V8_TARGET_ARCH_32_BIT 1 |
95 #else | 95 #else |
96 #define V8_TARGET_ARCH_64_BIT 1 | 96 #define V8_TARGET_ARCH_64_BIT 1 |
97 #endif | 97 #endif |
98 #endif | 98 #endif |
99 #elif V8_TARGET_ARCH_ARM | 99 #elif V8_TARGET_ARCH_ARM |
100 #define V8_TARGET_ARCH_32_BIT 1 | 100 #define V8_TARGET_ARCH_32_BIT 1 |
101 #elif V8_TARGET_ARCH_ARM64 | 101 #elif V8_TARGET_ARCH_ARM64 |
102 #define V8_TARGET_ARCH_64_BIT 1 | 102 #define V8_TARGET_ARCH_64_BIT 1 |
103 #elif V8_TARGET_ARCH_MIPS | 103 #elif V8_TARGET_ARCH_MIPS |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 #define V8_TARGET_LITTLE_ENDIAN 1 | 156 #define V8_TARGET_LITTLE_ENDIAN 1 |
157 #else | 157 #else |
158 #error Unknown target architecture endianness | 158 #error Unknown target architecture endianness |
159 #endif | 159 #endif |
160 | 160 |
161 // Number of bits to represent the page size for paged spaces. The value of 20 | 161 // Number of bits to represent the page size for paged spaces. The value of 20 |
162 // gives 1Mb bytes per page. | 162 // gives 1Mb bytes per page. |
163 const int kPageSizeBits = 20; | 163 const int kPageSizeBits = 20; |
164 | 164 |
165 #endif // V8_BASE_BUILD_CONFIG_H_ | 165 #endif // V8_BASE_BUILD_CONFIG_H_ |
OLD | NEW |