| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 #define V8_HOST_CAN_READ_UNALIGNED 1 | 79 #define V8_HOST_CAN_READ_UNALIGNED 1 |
| 80 #else | 80 #else |
| 81 #define V8_HOST_ARCH_X64 1 | 81 #define V8_HOST_ARCH_X64 1 |
| 82 #define V8_HOST_ARCH_64_BIT 1 | 82 #define V8_HOST_ARCH_64_BIT 1 |
| 83 #define V8_HOST_CAN_READ_UNALIGNED 1 | 83 #define V8_HOST_CAN_READ_UNALIGNED 1 |
| 84 #endif // __native_client__ | 84 #endif // __native_client__ |
| 85 #elif defined(_M_IX86) || defined(__i386__) | 85 #elif defined(_M_IX86) || defined(__i386__) |
| 86 #define V8_HOST_ARCH_IA32 1 | 86 #define V8_HOST_ARCH_IA32 1 |
| 87 #define V8_HOST_ARCH_32_BIT 1 | 87 #define V8_HOST_ARCH_32_BIT 1 |
| 88 #define V8_HOST_CAN_READ_UNALIGNED 1 | 88 #define V8_HOST_CAN_READ_UNALIGNED 1 |
| 89 #elif defined(__AARCH64EL__) |
| 90 #define V8_HOST_ARCH_A64 1 |
| 91 #define V8_HOST_ARCH_64_BIT 1 |
| 92 #define V8_HOST_CAN_READ_UNALIGNED 1 |
| 89 #elif defined(__ARMEL__) | 93 #elif defined(__ARMEL__) |
| 90 #define V8_HOST_ARCH_ARM 1 | 94 #define V8_HOST_ARCH_ARM 1 |
| 91 #define V8_HOST_ARCH_32_BIT 1 | 95 #define V8_HOST_ARCH_32_BIT 1 |
| 92 // Some CPU-OS combinations allow unaligned access on ARM. We assume | 96 // Some CPU-OS combinations allow unaligned access on ARM. We assume |
| 93 // that unaligned accesses are not allowed unless the build system | 97 // that unaligned accesses are not allowed unless the build system |
| 94 // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero. | 98 // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero. |
| 95 #if CAN_USE_UNALIGNED_ACCESSES | 99 #if CAN_USE_UNALIGNED_ACCESSES |
| 96 #define V8_HOST_CAN_READ_UNALIGNED 1 | 100 #define V8_HOST_CAN_READ_UNALIGNED 1 |
| 97 #endif | 101 #endif |
| 98 #elif defined(__MIPSEL__) | 102 #elif defined(__MIPSEL__) |
| 99 #define V8_HOST_ARCH_MIPS 1 | 103 #define V8_HOST_ARCH_MIPS 1 |
| 100 #define V8_HOST_ARCH_32_BIT 1 | 104 #define V8_HOST_ARCH_32_BIT 1 |
| 101 #else | 105 #else |
| 102 #error Host architecture was not detected as supported by v8 | 106 #error "Host architecture was not detected as supported by v8" |
| 103 #endif | 107 #endif |
| 104 | 108 |
| 105 // Target architecture detection. This may be set externally. If not, detect | 109 // 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 | 110 // in the same way as the host architecture, that is, target the native |
| 107 // environment as presented by the compiler. | 111 // environment as presented by the compiler. |
| 108 #if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_IA32) && \ | 112 #if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_IA32) && \ |
| 109 !defined(V8_TARGET_ARCH_ARM) && !defined(V8_TARGET_ARCH_MIPS) | 113 !defined(V8_TARGET_ARCH_A64) && !defined(V8_TARGET_ARCH_ARM) && \ |
| 114 !defined(V8_TARGET_ARCH_MIPS) |
| 110 #if defined(_M_X64) || defined(__x86_64__) | 115 #if defined(_M_X64) || defined(__x86_64__) |
| 111 #define V8_TARGET_ARCH_X64 1 | 116 #define V8_TARGET_ARCH_X64 1 |
| 112 #elif defined(_M_IX86) || defined(__i386__) | 117 #elif defined(_M_IX86) || defined(__i386__) |
| 113 #define V8_TARGET_ARCH_IA32 1 | 118 #define V8_TARGET_ARCH_IA32 1 |
| 119 #elif defined(__AARCH64EL__) |
| 120 #define V8_TARGET_ARCH_A64 1 |
| 114 #elif defined(__ARMEL__) | 121 #elif defined(__ARMEL__) |
| 115 #define V8_TARGET_ARCH_ARM 1 | 122 #define V8_TARGET_ARCH_ARM 1 |
| 116 #elif defined(__MIPSEL__) | 123 #elif defined(__MIPSEL__) |
| 117 #define V8_TARGET_ARCH_MIPS 1 | 124 #define V8_TARGET_ARCH_MIPS 1 |
| 118 #else | 125 #else |
| 119 #error Target architecture was not detected as supported by v8 | 126 #error Target architecture was not detected as supported by v8 |
| 120 #endif | 127 #endif |
| 121 #endif | 128 #endif |
| 122 | 129 |
| 123 // Check for supported combinations of host and target architectures. | 130 // Check for supported combinations of host and target architectures. |
| 124 #if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32) | 131 #if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32) |
| 125 #error Target architecture ia32 is only supported on ia32 host | 132 #error Target architecture ia32 is only supported on ia32 host |
| 126 #endif | 133 #endif |
| 127 #if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64) | 134 #if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64) |
| 128 #error Target architecture x64 is only supported on x64 host | 135 #error Target architecture x64 is only supported on x64 host |
| 129 #endif | 136 #endif |
| 130 #if (defined(V8_TARGET_ARCH_ARM) && \ | 137 #if (defined(V8_TARGET_ARCH_ARM) && \ |
| 131 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) | 138 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) |
| 132 #error Target architecture arm is only supported on arm and ia32 host | 139 #error Target architecture arm is only supported on arm and ia32 host |
| 133 #endif | 140 #endif |
| 141 #if (defined(V8_TARGET_ARCH_A64) && \ |
| 142 !(defined(V8_HOST_ARCH_X64) || defined(V8_HOST_ARCH_A64))) |
| 143 #error Target architecture a64 is only supported on a64 and x64 host |
| 144 #endif |
| 134 #if (defined(V8_TARGET_ARCH_MIPS) && \ | 145 #if (defined(V8_TARGET_ARCH_MIPS) && \ |
| 135 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) | 146 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) |
| 136 #error Target architecture mips is only supported on mips and ia32 host | 147 #error Target architecture mips is only supported on mips and ia32 host |
| 137 #endif | 148 #endif |
| 138 | 149 |
| 139 // Determine whether we are running in a simulated environment. | 150 // Determine whether we are running in a simulated environment. |
| 140 // Setting USE_SIMULATOR explicitly from the build script will force | 151 // Setting USE_SIMULATOR explicitly from the build script will force |
| 141 // the use of a simulated environment. | 152 // the use of a simulated environment. |
| 142 #if !defined(USE_SIMULATOR) | 153 #if !defined(USE_SIMULATOR) |
| 154 #if (defined(V8_TARGET_ARCH_A64) && !defined(V8_HOST_ARCH_A64)) |
| 155 #define USE_SIMULATOR 1 |
| 156 #endif |
| 143 #if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM)) | 157 #if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM)) |
| 144 #define USE_SIMULATOR 1 | 158 #define USE_SIMULATOR 1 |
| 145 #endif | 159 #endif |
| 146 #if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS)) | 160 #if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS)) |
| 147 #define USE_SIMULATOR 1 | 161 #define USE_SIMULATOR 1 |
| 148 #endif | 162 #endif |
| 149 #endif | 163 #endif |
| 150 | 164 |
| 151 // Support for alternative bool type. This is only enabled if the code is | 165 // Support for alternative bool type. This is only enabled if the code is |
| 152 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. | 166 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 // the backend, so both modes are represented by the kStrictMode value. | 420 // the backend, so both modes are represented by the kStrictMode value. |
| 407 enum StrictModeFlag { | 421 enum StrictModeFlag { |
| 408 kNonStrictMode, | 422 kNonStrictMode, |
| 409 kStrictMode | 423 kStrictMode |
| 410 }; | 424 }; |
| 411 | 425 |
| 412 | 426 |
| 413 } } // namespace v8::internal | 427 } } // namespace v8::internal |
| 414 | 428 |
| 415 #endif // V8_GLOBALS_H_ | 429 #endif // V8_GLOBALS_H_ |
| OLD | NEW |