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_ARCH_32_BIT 1 | 79 #define V8_HOST_ARCH_32_BIT 1 |
80 // Some CPU-OS combinations allow unaligned access on ARM. We assume | 80 // Some CPU-OS combinations allow unaligned access on ARM. We assume |
81 // that unaligned accesses are not allowed unless the build system | 81 // that unaligned accesses are not allowed unless the build system |
82 // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero. | 82 // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero. |
83 #if CAN_USE_UNALIGNED_ACCESSES | 83 #if CAN_USE_UNALIGNED_ACCESSES |
84 #define V8_HOST_CAN_READ_UNALIGNED 1 | 84 #define V8_HOST_CAN_READ_UNALIGNED 1 |
85 #endif | 85 #endif |
86 #elif defined(__MIPSEL__) | 86 #elif defined(__MIPSEL__) |
87 #define V8_HOST_ARCH_MIPS 1 | 87 #define V8_HOST_ARCH_MIPS 1 |
88 #define V8_HOST_ARCH_32_BIT 1 | 88 #define V8_HOST_ARCH_32_BIT 1 |
89 #elif defined(__SH4__) | |
90 #define V8_HOST_ARCH_SH4 1 | |
91 #define V8_HOST_ARCH_32_BIT 1 | |
89 #else | 92 #else |
90 #error Host architecture was not detected as supported by v8 | 93 #error Host architecture was not detected as supported by v8 |
91 #endif | 94 #endif |
92 | 95 |
93 // Target architecture detection. This may be set externally. If not, detect | 96 // Target architecture detection. This may be set externally. If not, detect |
94 // in the same way as the host architecture, that is, target the native | 97 // in the same way as the host architecture, that is, target the native |
95 // environment as presented by the compiler. | 98 // environment as presented by the compiler. |
96 #if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_IA32) && \ | 99 #if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_IA32) && \ |
97 !defined(V8_TARGET_ARCH_ARM) && !defined(V8_TARGET_ARCH_MIPS) | 100 !defined(V8_TARGET_ARCH_ARM) && !defined(V8_TARGET_ARCH_MIPS) && \ |
101 !defined(V8_TARGET_ARCH_SH4) | |
98 #if defined(_M_X64) || defined(__x86_64__) | 102 #if defined(_M_X64) || defined(__x86_64__) |
99 #define V8_TARGET_ARCH_X64 1 | 103 #define V8_TARGET_ARCH_X64 1 |
100 #elif defined(_M_IX86) || defined(__i386__) | 104 #elif defined(_M_IX86) || defined(__i386__) |
101 #define V8_TARGET_ARCH_IA32 1 | 105 #define V8_TARGET_ARCH_IA32 1 |
102 #elif defined(__ARMEL__) | 106 #elif defined(__ARMEL__) |
103 #define V8_TARGET_ARCH_ARM 1 | 107 #define V8_TARGET_ARCH_ARM 1 |
104 #elif defined(__MIPSEL__) | 108 #elif defined(__MIPSEL__) |
105 #define V8_TARGET_ARCH_MIPS 1 | 109 #define V8_TARGET_ARCH_MIPS 1 |
110 #elif defined(__SH4__) | |
111 #define V8_TARGET_ARCH_SH4 1 | |
106 #else | 112 #else |
107 #error Target architecture was not detected as supported by v8 | 113 #error Target architecture was not detected as supported by v8 |
108 #endif | 114 #endif |
109 #endif | 115 #endif |
110 | 116 |
111 // Check for supported combinations of host and target architectures. | 117 // Check for supported combinations of host and target architectures. |
112 #if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32) | 118 #if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32) |
113 #error Target architecture ia32 is only supported on ia32 host | 119 #error Target architecture ia32 is only supported on ia32 host |
114 #endif | 120 #endif |
115 #if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64) | 121 #if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64) |
116 #error Target architecture x64 is only supported on x64 host | 122 #error Target architecture x64 is only supported on x64 host |
117 #endif | 123 #endif |
118 #if (defined(V8_TARGET_ARCH_ARM) && \ | 124 #if (defined(V8_TARGET_ARCH_ARM) && \ |
119 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) | 125 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) |
120 #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 |
121 #endif | 127 #endif |
122 #if (defined(V8_TARGET_ARCH_MIPS) && \ | 128 #if (defined(V8_TARGET_ARCH_MIPS) && \ |
123 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) | 129 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) |
124 #error Target architecture mips is only supported on mips and ia32 host | 130 #error Target architecture mips is only supported on mips and ia32 host |
125 #endif | 131 #endif |
132 #if defined(V8_TARGET_ARCH_SH4) && !defined(V8_HOST_ARCH_SH4) | |
133 #error Target architecture sh4 is only supported on sh4 host | |
Jakob Kummerow
2012/11/07 11:18:24
How about adding a simulator to allow development/
remi.duraffort
2012/11/07 11:59:26
This is not planned as we use Qemu user mode along
| |
134 #endif | |
135 | |
126 | 136 |
127 // Determine whether we are running in a simulated environment. | 137 // Determine whether we are running in a simulated environment. |
128 // Setting USE_SIMULATOR explicitly from the build script will force | 138 // Setting USE_SIMULATOR explicitly from the build script will force |
129 // the use of a simulated environment. | 139 // the use of a simulated environment. |
130 #if !defined(USE_SIMULATOR) | 140 #if !defined(USE_SIMULATOR) |
131 #if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM)) | 141 #if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM)) |
132 #define USE_SIMULATOR 1 | 142 #define USE_SIMULATOR 1 |
133 #endif | 143 #endif |
134 #if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS)) | 144 #if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS)) |
135 #define USE_SIMULATOR 1 | 145 #define USE_SIMULATOR 1 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
396 // the backend, so both modes are represented by the kStrictMode value. | 406 // the backend, so both modes are represented by the kStrictMode value. |
397 enum StrictModeFlag { | 407 enum StrictModeFlag { |
398 kNonStrictMode, | 408 kNonStrictMode, |
399 kStrictMode | 409 kStrictMode |
400 }; | 410 }; |
401 | 411 |
402 | 412 |
403 } } // namespace v8::internal | 413 } } // namespace v8::internal |
404 | 414 |
405 #endif // V8_GLOBALS_H_ | 415 #endif // V8_GLOBALS_H_ |
OLD | NEW |