OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 28 matching lines...) Expand all Loading... |
39 #define V8_HOST_ARCH_X64 1 | 39 #define V8_HOST_ARCH_X64 1 |
40 #define V8_HOST_ARCH_64_BIT 1 | 40 #define V8_HOST_ARCH_64_BIT 1 |
41 #define V8_HOST_CAN_READ_UNALIGNED 1 | 41 #define V8_HOST_CAN_READ_UNALIGNED 1 |
42 #elif defined(_M_IX86) || defined(__i386__) | 42 #elif defined(_M_IX86) || defined(__i386__) |
43 #define V8_HOST_ARCH_IA32 1 | 43 #define V8_HOST_ARCH_IA32 1 |
44 #define V8_HOST_ARCH_32_BIT 1 | 44 #define V8_HOST_ARCH_32_BIT 1 |
45 #define V8_HOST_CAN_READ_UNALIGNED 1 | 45 #define V8_HOST_CAN_READ_UNALIGNED 1 |
46 #elif defined(__ARMEL__) | 46 #elif defined(__ARMEL__) |
47 #define V8_HOST_ARCH_ARM 1 | 47 #define V8_HOST_ARCH_ARM 1 |
48 #define V8_HOST_ARCH_32_BIT 1 | 48 #define V8_HOST_ARCH_32_BIT 1 |
| 49 // Some CPU-OS combinations allow unaligned access on ARM. We assume |
| 50 // that unaligned accesses are not allowed unless the build system |
| 51 // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero. |
| 52 #if CAN_USE_UNALIGNED_ACCESSES |
| 53 #define V8_HOST_CAN_READ_UNALIGNED 1 |
| 54 #endif |
49 #elif defined(_MIPS_ARCH_MIPS32R2) | 55 #elif defined(_MIPS_ARCH_MIPS32R2) |
50 #define V8_HOST_ARCH_MIPS 1 | 56 #define V8_HOST_ARCH_MIPS 1 |
51 #define V8_HOST_ARCH_32_BIT 1 | 57 #define V8_HOST_ARCH_32_BIT 1 |
52 #else | 58 #else |
53 #error Host architecture was not detected as supported by v8 | 59 #error Host architecture was not detected as supported by v8 |
54 #endif | 60 #endif |
55 | 61 |
56 // Check for supported combinations of host and target architectures. | 62 // Check for supported combinations of host and target architectures. |
57 #if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32) | 63 #if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32) |
58 #error Target architecture ia32 is only supported on ia32 host | 64 #error Target architecture ia32 is only supported on ia32 host |
59 #endif | 65 #endif |
60 #if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64) | 66 #if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64) |
61 #error Target architecture x64 is only supported on x64 host | 67 #error Target architecture x64 is only supported on x64 host |
62 #endif | 68 #endif |
63 #if (defined(V8_TARGET_ARCH_ARM) && \ | 69 #if (defined(V8_TARGET_ARCH_ARM) && \ |
64 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) | 70 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) |
65 #error Target architecture arm is only supported on arm and ia32 host | 71 #error Target architecture arm is only supported on arm and ia32 host |
66 #endif | 72 #endif |
67 #if (defined(V8_TARGET_ARCH_MIPS) && \ | 73 #if (defined(V8_TARGET_ARCH_MIPS) && \ |
68 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) | 74 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) |
69 #error Target architecture mips is only supported on mips and ia32 host | 75 #error Target architecture mips is only supported on mips and ia32 host |
70 #endif | 76 #endif |
71 | 77 |
72 // Define unaligned read for the target architectures supporting it. | 78 // Define unaligned read for the target architectures supporting it. |
73 #if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32) | 79 #if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32) |
74 #define V8_TARGET_CAN_READ_UNALIGNED 1 | 80 #define V8_TARGET_CAN_READ_UNALIGNED 1 |
75 #elif V8_TARGET_ARCH_ARM | 81 #elif V8_TARGET_ARCH_ARM |
| 82 // Some CPU-OS combinations allow unaligned access on ARM. We assume |
| 83 // that unaligned accesses are not allowed unless the build system |
| 84 // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero. |
| 85 #if CAN_USE_UNALIGNED_ACCESSES |
| 86 #define V8_TARGET_CAN_READ_UNALIGNED 1 |
| 87 #endif |
76 #elif V8_TARGET_ARCH_MIPS | 88 #elif V8_TARGET_ARCH_MIPS |
77 #else | 89 #else |
78 #error Target architecture is not supported by v8 | 90 #error Target architecture is not supported by v8 |
79 #endif | 91 #endif |
80 | 92 |
81 // Support for alternative bool type. This is only enabled if the code is | 93 // Support for alternative bool type. This is only enabled if the code is |
82 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. | 94 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. |
83 // For instance, 'bool b = "false";' results in b == true! This is a hidden | 95 // For instance, 'bool b = "false";' results in b == true! This is a hidden |
84 // source of bugs. | 96 // source of bugs. |
85 // However, redefining the bool type does have some negative impact on some | 97 // However, redefining the bool type does have some negative impact on some |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 CMOV = 15, // x86 | 635 CMOV = 15, // x86 |
624 RDTSC = 4, // x86 | 636 RDTSC = 4, // x86 |
625 CPUID = 10, // x86 | 637 CPUID = 10, // x86 |
626 VFP3 = 1, // ARM | 638 VFP3 = 1, // ARM |
627 ARMv7 = 2, // ARM | 639 ARMv7 = 2, // ARM |
628 SAHF = 0}; // x86 | 640 SAHF = 0}; // x86 |
629 | 641 |
630 } } // namespace v8::internal | 642 } } // namespace v8::internal |
631 | 643 |
632 #endif // V8_GLOBALS_H_ | 644 #endif // V8_GLOBALS_H_ |
OLD | NEW |