| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 #elif defined(__MIPSEL__) | 98 #elif defined(__MIPSEL__) |
| 99 #define V8_HOST_ARCH_MIPS 1 | 99 #define V8_HOST_ARCH_MIPS 1 |
| 100 #define V8_HOST_ARCH_32_BIT 1 | 100 #define V8_HOST_ARCH_32_BIT 1 |
| 101 #else | 101 #else |
| 102 #error Host architecture was not detected as supported by v8 | 102 #error Host architecture was not detected as supported by v8 |
| 103 #endif | 103 #endif |
| 104 | 104 |
| 105 // Target architecture detection. This may be set externally. If not, detect | 105 // Target architecture detection. This may be set externally. If not, detect |
| 106 // in the same way as the host architecture, that is, target the native | 106 // in the same way as the host architecture, that is, target the native |
| 107 // environment as presented by the compiler. | 107 // environment as presented by the compiler. |
| 108 #if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_IA32) && \ | 108 #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && \ |
| 109 !defined(V8_TARGET_ARCH_ARM) && !defined(V8_TARGET_ARCH_MIPS) | 109 !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS |
| 110 #if defined(_M_X64) || defined(__x86_64__) | 110 #if defined(_M_X64) || defined(__x86_64__) |
| 111 #define V8_TARGET_ARCH_X64 1 | 111 #define V8_TARGET_ARCH_X64 1 |
| 112 #elif defined(_M_IX86) || defined(__i386__) | 112 #elif defined(_M_IX86) || defined(__i386__) |
| 113 #define V8_TARGET_ARCH_IA32 1 | 113 #define V8_TARGET_ARCH_IA32 1 |
| 114 #elif defined(__ARMEL__) | 114 #elif defined(__ARMEL__) |
| 115 #define V8_TARGET_ARCH_ARM 1 | 115 #define V8_TARGET_ARCH_ARM 1 |
| 116 #elif defined(__MIPSEL__) | 116 #elif defined(__MIPSEL__) |
| 117 #define V8_TARGET_ARCH_MIPS 1 | 117 #define V8_TARGET_ARCH_MIPS 1 |
| 118 #else | 118 #else |
| 119 #error Target architecture was not detected as supported by v8 | 119 #error Target architecture was not detected as supported by v8 |
| 120 #endif | 120 #endif |
| 121 #endif | 121 #endif |
| 122 | 122 |
| 123 // Check for supported combinations of host and target architectures. | 123 // Check for supported combinations of host and target architectures. |
| 124 #if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32) | 124 #if V8_TARGET_ARCH_IA32 && !V8_HOST_ARCH_IA32 |
| 125 #error Target architecture ia32 is only supported on ia32 host | 125 #error Target architecture ia32 is only supported on ia32 host |
| 126 #endif | 126 #endif |
| 127 #if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64) | 127 #if V8_TARGET_ARCH_X64 && !V8_HOST_ARCH_X64 |
| 128 #error Target architecture x64 is only supported on x64 host | 128 #error Target architecture x64 is only supported on x64 host |
| 129 #endif | 129 #endif |
| 130 #if (defined(V8_TARGET_ARCH_ARM) && \ | 130 #if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM)) |
| 131 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) | |
| 132 #error Target architecture arm is only supported on arm and ia32 host | 131 #error Target architecture arm is only supported on arm and ia32 host |
| 133 #endif | 132 #endif |
| 134 #if (defined(V8_TARGET_ARCH_MIPS) && \ | 133 #if (V8_TARGET_ARCH_MIPS && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_MIPS)) |
| 135 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) | |
| 136 #error Target architecture mips is only supported on mips and ia32 host | 134 #error Target architecture mips is only supported on mips and ia32 host |
| 137 #endif | 135 #endif |
| 138 | 136 |
| 139 // Determine whether we are running in a simulated environment. | 137 // Determine whether we are running in a simulated environment. |
| 140 // Setting USE_SIMULATOR explicitly from the build script will force | 138 // Setting USE_SIMULATOR explicitly from the build script will force |
| 141 // the use of a simulated environment. | 139 // the use of a simulated environment. |
| 142 #if !defined(USE_SIMULATOR) | 140 #if !defined(USE_SIMULATOR) |
| 143 #if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM)) | 141 #if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM) |
| 144 #define USE_SIMULATOR 1 | 142 #define USE_SIMULATOR 1 |
| 145 #endif | 143 #endif |
| 146 #if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS)) | 144 #if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS) |
| 147 #define USE_SIMULATOR 1 | 145 #define USE_SIMULATOR 1 |
| 148 #endif | 146 #endif |
| 149 #endif | 147 #endif |
| 150 | 148 |
| 151 // Determine architecture endiannes (we only support little-endian). | 149 // Determine architecture endiannes (we only support little-endian). |
| 152 #if defined(V8_TARGET_ARCH_IA32) | 150 #if V8_TARGET_ARCH_IA32 |
| 153 #define V8_TARGET_LITTLE_ENDIAN 1 | 151 #define V8_TARGET_LITTLE_ENDIAN 1 |
| 154 #elif defined(V8_TARGET_ARCH_X64) | 152 #elif V8_TARGET_ARCH_X64 |
| 155 #define V8_TARGET_LITTLE_ENDIAN 1 | 153 #define V8_TARGET_LITTLE_ENDIAN 1 |
| 156 #elif defined(V8_TARGET_ARCH_ARM) | 154 #elif V8_TARGET_ARCH_ARM |
| 157 #define V8_TARGET_LITTLE_ENDIAN 1 | 155 #define V8_TARGET_LITTLE_ENDIAN 1 |
| 158 #elif defined(V8_TARGET_ARCH_MIPS) | 156 #elif V8_TARGET_ARCH_MIPS |
| 159 #define V8_TARGET_LITTLE_ENDIAN 1 | 157 #define V8_TARGET_LITTLE_ENDIAN 1 |
| 160 #else | 158 #else |
| 161 #error Unknown target architecture endiannes | 159 #error Unknown target architecture endiannes |
| 162 #endif | 160 #endif |
| 163 | 161 |
| 164 // Support for alternative bool type. This is only enabled if the code is | 162 // Support for alternative bool type. This is only enabled if the code is |
| 165 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. | 163 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. |
| 166 // For instance, 'bool b = "false";' results in b == true! This is a hidden | 164 // For instance, 'bool b = "false";' results in b == true! This is a hidden |
| 167 // source of bugs. | 165 // source of bugs. |
| 168 // However, redefining the bool type does have some negative impact on some | 166 // However, redefining the bool type does have some negative impact on some |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 // the backend, so both modes are represented by the kStrictMode value. | 429 // the backend, so both modes are represented by the kStrictMode value. |
| 432 enum StrictModeFlag { | 430 enum StrictModeFlag { |
| 433 kNonStrictMode, | 431 kNonStrictMode, |
| 434 kStrictMode | 432 kStrictMode |
| 435 }; | 433 }; |
| 436 | 434 |
| 437 | 435 |
| 438 } } // namespace v8::internal | 436 } } // namespace v8::internal |
| 439 | 437 |
| 440 #endif // V8_GLOBALS_H_ | 438 #endif // V8_GLOBALS_H_ |
| OLD | NEW |