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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #else | 65 #else |
66 #define V8_HOST_ARCH_X64 1 | 66 #define V8_HOST_ARCH_X64 1 |
67 #define V8_HOST_ARCH_64_BIT 1 | 67 #define V8_HOST_ARCH_64_BIT 1 |
68 #define V8_HOST_CAN_READ_UNALIGNED 1 | 68 #define V8_HOST_CAN_READ_UNALIGNED 1 |
69 #endif // __native_client__ | 69 #endif // __native_client__ |
70 #elif defined(_M_IX86) || defined(__i386__) | 70 #elif defined(_M_IX86) || defined(__i386__) |
71 #define V8_HOST_ARCH_IA32 1 | 71 #define V8_HOST_ARCH_IA32 1 |
72 #define V8_HOST_ARCH_32_BIT 1 | 72 #define V8_HOST_ARCH_32_BIT 1 |
73 #define V8_HOST_CAN_READ_UNALIGNED 1 | 73 #define V8_HOST_CAN_READ_UNALIGNED 1 |
74 #elif defined(__AARCH64EL__) | 74 #elif defined(__AARCH64EL__) |
75 #define V8_HOST_ARCH_A64 1 | 75 #define V8_HOST_ARCH_ARM64 1 |
76 #define V8_HOST_ARCH_64_BIT 1 | 76 #define V8_HOST_ARCH_64_BIT 1 |
77 #define V8_HOST_CAN_READ_UNALIGNED 1 | 77 #define V8_HOST_CAN_READ_UNALIGNED 1 |
78 #elif defined(__ARMEL__) | 78 #elif defined(__ARMEL__) |
79 #define V8_HOST_ARCH_ARM 1 | 79 #define V8_HOST_ARCH_ARM 1 |
80 #define V8_HOST_ARCH_32_BIT 1 | 80 #define V8_HOST_ARCH_32_BIT 1 |
81 #elif defined(__MIPSEL__) | 81 #elif defined(__MIPSEL__) |
82 #define V8_HOST_ARCH_MIPS 1 | 82 #define V8_HOST_ARCH_MIPS 1 |
83 #define V8_HOST_ARCH_32_BIT 1 | 83 #define V8_HOST_ARCH_32_BIT 1 |
84 #else | 84 #else |
85 #error "Host architecture was not detected as supported by v8" | 85 #error "Host architecture was not detected as supported by v8" |
86 #endif | 86 #endif |
87 | 87 |
88 #if defined(__ARM_ARCH_7A__) || \ | 88 #if defined(__ARM_ARCH_7A__) || \ |
89 defined(__ARM_ARCH_7R__) || \ | 89 defined(__ARM_ARCH_7R__) || \ |
90 defined(__ARM_ARCH_7__) | 90 defined(__ARM_ARCH_7__) |
91 # define CAN_USE_ARMV7_INSTRUCTIONS 1 | 91 # define CAN_USE_ARMV7_INSTRUCTIONS 1 |
92 # ifndef CAN_USE_VFP3_INSTRUCTIONS | 92 # ifndef CAN_USE_VFP3_INSTRUCTIONS |
93 # define CAN_USE_VFP3_INSTRUCTIONS | 93 # define CAN_USE_VFP3_INSTRUCTIONS |
94 # endif | 94 # endif |
95 #endif | 95 #endif |
96 | 96 |
97 | 97 |
98 // Target architecture detection. This may be set externally. If not, detect | 98 // Target architecture detection. This may be set externally. If not, detect |
99 // in the same way as the host architecture, that is, target the native | 99 // in the same way as the host architecture, that is, target the native |
100 // environment as presented by the compiler. | 100 // environment as presented by the compiler. |
101 #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && \ | 101 #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && \ |
102 !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_A64 && !V8_TARGET_ARCH_MIPS | 102 !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_MIPS |
103 #if defined(_M_X64) || defined(__x86_64__) | 103 #if defined(_M_X64) || defined(__x86_64__) |
104 #define V8_TARGET_ARCH_X64 1 | 104 #define V8_TARGET_ARCH_X64 1 |
105 #elif defined(_M_IX86) || defined(__i386__) | 105 #elif defined(_M_IX86) || defined(__i386__) |
106 #define V8_TARGET_ARCH_IA32 1 | 106 #define V8_TARGET_ARCH_IA32 1 |
107 #elif defined(__AARCH64EL__) | 107 #elif defined(__AARCH64EL__) |
108 #define V8_TARGET_ARCH_A64 1 | 108 #define V8_TARGET_ARCH_ARM64 1 |
109 #elif defined(__ARMEL__) | 109 #elif defined(__ARMEL__) |
110 #define V8_TARGET_ARCH_ARM 1 | 110 #define V8_TARGET_ARCH_ARM 1 |
111 #elif defined(__MIPSEL__) | 111 #elif defined(__MIPSEL__) |
112 #define V8_TARGET_ARCH_MIPS 1 | 112 #define V8_TARGET_ARCH_MIPS 1 |
113 #else | 113 #else |
114 #error Target architecture was not detected as supported by v8 | 114 #error Target architecture was not detected as supported by v8 |
115 #endif | 115 #endif |
116 #endif | 116 #endif |
117 | 117 |
118 // Check for supported combinations of host and target architectures. | 118 // Check for supported combinations of host and target architectures. |
119 #if V8_TARGET_ARCH_IA32 && !V8_HOST_ARCH_IA32 | 119 #if V8_TARGET_ARCH_IA32 && !V8_HOST_ARCH_IA32 |
120 #error Target architecture ia32 is only supported on ia32 host | 120 #error Target architecture ia32 is only supported on ia32 host |
121 #endif | 121 #endif |
122 #if V8_TARGET_ARCH_X64 && !V8_HOST_ARCH_X64 | 122 #if V8_TARGET_ARCH_X64 && !V8_HOST_ARCH_X64 |
123 #error Target architecture x64 is only supported on x64 host | 123 #error Target architecture x64 is only supported on x64 host |
124 #endif | 124 #endif |
125 #if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM)) | 125 #if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM)) |
126 #error Target architecture arm is only supported on arm and ia32 host | 126 #error Target architecture arm is only supported on arm and ia32 host |
127 #endif | 127 #endif |
128 #if (V8_TARGET_ARCH_A64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_A64)) | 128 #if (V8_TARGET_ARCH_ARM64 && !(V8_HOST_ARCH_X64 || V8_HOST_ARCH_ARM64)) |
129 #error Target architecture a64 is only supported on a64 and x64 host | 129 #error Target architecture arm64 is only supported on arm64 and x64 host |
130 #endif | 130 #endif |
131 #if (V8_TARGET_ARCH_MIPS && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_MIPS)) | 131 #if (V8_TARGET_ARCH_MIPS && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_MIPS)) |
132 #error Target architecture mips is only supported on mips and ia32 host | 132 #error Target architecture mips is only supported on mips and ia32 host |
133 #endif | 133 #endif |
134 | 134 |
135 // Determine whether we are running in a simulated environment. | 135 // Determine whether we are running in a simulated environment. |
136 // Setting USE_SIMULATOR explicitly from the build script will force | 136 // Setting USE_SIMULATOR explicitly from the build script will force |
137 // the use of a simulated environment. | 137 // the use of a simulated environment. |
138 #if !defined(USE_SIMULATOR) | 138 #if !defined(USE_SIMULATOR) |
139 #if (V8_TARGET_ARCH_A64 && !V8_HOST_ARCH_A64) | 139 #if (V8_TARGET_ARCH_ARM64 && !V8_HOST_ARCH_ARM64) |
140 #define USE_SIMULATOR 1 | 140 #define USE_SIMULATOR 1 |
141 #endif | 141 #endif |
142 #if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM) | 142 #if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM) |
143 #define USE_SIMULATOR 1 | 143 #define USE_SIMULATOR 1 |
144 #endif | 144 #endif |
145 #if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS) | 145 #if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS) |
146 #define USE_SIMULATOR 1 | 146 #define USE_SIMULATOR 1 |
147 #endif | 147 #endif |
148 #endif | 148 #endif |
149 | 149 |
150 // Determine architecture endiannes (we only support little-endian). | 150 // Determine architecture endiannes (we only support little-endian). |
151 #if V8_TARGET_ARCH_IA32 | 151 #if V8_TARGET_ARCH_IA32 |
152 #define V8_TARGET_LITTLE_ENDIAN 1 | 152 #define V8_TARGET_LITTLE_ENDIAN 1 |
153 #elif V8_TARGET_ARCH_X64 | 153 #elif V8_TARGET_ARCH_X64 |
154 #define V8_TARGET_LITTLE_ENDIAN 1 | 154 #define V8_TARGET_LITTLE_ENDIAN 1 |
155 #elif V8_TARGET_ARCH_ARM | 155 #elif V8_TARGET_ARCH_ARM |
156 #define V8_TARGET_LITTLE_ENDIAN 1 | 156 #define V8_TARGET_LITTLE_ENDIAN 1 |
157 #elif V8_TARGET_ARCH_A64 | 157 #elif V8_TARGET_ARCH_ARM64 |
158 #define V8_TARGET_LITTLE_ENDIAN 1 | 158 #define V8_TARGET_LITTLE_ENDIAN 1 |
159 #elif V8_TARGET_ARCH_MIPS | 159 #elif V8_TARGET_ARCH_MIPS |
160 #define V8_TARGET_LITTLE_ENDIAN 1 | 160 #define V8_TARGET_LITTLE_ENDIAN 1 |
161 #else | 161 #else |
162 #error Unknown target architecture endiannes | 162 #error Unknown target architecture endiannes |
163 #endif | 163 #endif |
164 | 164 |
165 // Determine whether the architecture uses an out-of-line constant pool. | 165 // Determine whether the architecture uses an out-of-line constant pool. |
166 #define V8_OOL_CONSTANT_POOL 0 | 166 #define V8_OOL_CONSTANT_POOL 0 |
167 | 167 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // Declarations for use in both the preparser and the rest of V8. | 411 // Declarations for use in both the preparser and the rest of V8. |
412 | 412 |
413 // The Strict Mode (ECMA-262 5th edition, 4.2.2). | 413 // The Strict Mode (ECMA-262 5th edition, 4.2.2). |
414 | 414 |
415 enum StrictMode { SLOPPY, STRICT }; | 415 enum StrictMode { SLOPPY, STRICT }; |
416 | 416 |
417 | 417 |
418 } } // namespace v8::internal | 418 } } // namespace v8::internal |
419 | 419 |
420 #endif // V8_GLOBALS_H_ | 420 #endif // V8_GLOBALS_H_ |
OLD | NEW |