Chromium Code Reviews| 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 #elif defined(_MIPS_ARCH_MIPS32R2) | |
| 50 #define V8_HOST_ARCH_MIPS 1 | |
| 51 #define V8_HOST_ARCH_32_BIT 1 | |
| 49 #else | 52 #else |
| 50 #error Your host architecture was not detected as supported by v8 | 53 #error Your host architecture was not detected as supported by v8 |
| 51 #endif | 54 #endif |
| 52 | 55 |
| 53 #if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32) | 56 #if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32) |
| 54 #define V8_TARGET_CAN_READ_UNALIGNED 1 | 57 #define V8_TARGET_CAN_READ_UNALIGNED 1 |
| 55 #elif V8_TARGET_ARCH_ARM | 58 #elif V8_TARGET_ARCH_ARM |
| 59 #elif V8_TARGET_ARCH_MIPS | |
| 60 #define V8_TARGET_CAN_READ_UNALIGNED 0 | |
|
Søren Thygesen Gjesse
2010/01/19 22:59:12
defining V8_TARGET_CAN_READ_UNALIGNED to 0 should
Alexandre
2010/01/22 23:08:42
Removed.
On 2010/01/19 22:59:12, Søren Gjesse wrot
| |
| 56 #else | 61 #else |
| 57 #error Your target architecture is not supported by v8 | 62 #error Your target architecture is not supported by v8 |
| 58 #endif | 63 #endif |
| 59 | 64 |
| 60 // Support for alternative bool type. This is only enabled if the code is | 65 // Support for alternative bool type. This is only enabled if the code is |
| 61 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. | 66 // compiled with USE_MYBOOL defined. This catches some nasty type bugs. |
| 62 // For instance, 'bool b = "false";' results in b == true! This is a hidden | 67 // For instance, 'bool b = "false";' results in b == true! This is a hidden |
| 63 // source of bugs. | 68 // source of bugs. |
| 64 // However, redefining the bool type does have some negative impact on some | 69 // However, redefining the bool type does have some negative impact on some |
| 65 // platforms. It gives rise to compiler warnings (i.e. with | 70 // platforms. It gives rise to compiler warnings (i.e. with |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 // Should be a recognizable hex value tagged as a heap object pointer. | 167 // Should be a recognizable hex value tagged as a heap object pointer. |
| 163 #ifdef V8_HOST_ARCH_64_BIT | 168 #ifdef V8_HOST_ARCH_64_BIT |
| 164 const Address kZapValue = | 169 const Address kZapValue = |
| 165 reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeed)); | 170 reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeed)); |
| 166 const Address kHandleZapValue = | 171 const Address kHandleZapValue = |
| 167 reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddead)); | 172 reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddead)); |
| 168 const Address kFromSpaceZapValue = | 173 const Address kFromSpaceZapValue = |
| 169 reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdad)); | 174 reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdad)); |
| 170 #else | 175 #else |
| 171 const Address kZapValue = reinterpret_cast<Address>(0xdeadbeed); | 176 const Address kZapValue = reinterpret_cast<Address>(0xdeadbeed); |
| 177 #ifndef V8_TARGET_ARCH_MIPS | |
| 172 const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddead); | 178 const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddead); |
| 179 #else | |
| 180 // On mips 0xbaddead is the encoding of jump to 0xeb77ab4. | |
|
Søren Thygesen Gjesse
2010/01/19 22:59:12
I don't think this is important. The handle zap va
Alexandre
2010/01/22 23:08:42
I wrote this in the early development stage. It ca
| |
| 181 // This can be misleading when debugging and developping as we get a segfault | |
| 182 // instead of an illegal instruction when executing it. | |
| 183 // The 0b111011 opcode is reserved for future use. Executing this instruction | |
| 184 // raises a Reserved Instruction Exception error on MIPS not using this opcode. | |
| 185 const Address kHandleZapValue = reinterpret_cast<Address>(0xec000000); | |
| 186 #endif | |
| 173 const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdad); | 187 const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdad); |
| 174 #endif | 188 #endif |
| 175 | 189 |
| 176 | 190 |
| 177 // Constants relevant to double precision floating point numbers. | 191 // Constants relevant to double precision floating point numbers. |
| 178 | 192 |
| 179 // Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no | 193 // Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no |
| 180 // other bits set. | 194 // other bits set. |
| 181 const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51; | 195 const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51; |
| 182 // If looking only at the top 32 bits, the QNaN mask is bits 19 to 30. | 196 // If looking only at the top 32 bits, the QNaN mask is bits 19 to 30. |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 570 | 584 |
| 571 Dest dest; | 585 Dest dest; |
| 572 memcpy(&dest, &source, sizeof(dest)); | 586 memcpy(&dest, &source, sizeof(dest)); |
| 573 return dest; | 587 return dest; |
| 574 } | 588 } |
| 575 | 589 |
| 576 | 590 |
| 577 } } // namespace v8::internal | 591 } } // namespace v8::internal |
| 578 | 592 |
| 579 #endif // V8_GLOBALS_H_ | 593 #endif // V8_GLOBALS_H_ |
| OLD | NEW |