| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 typedef uint8_t byte; | 140 typedef uint8_t byte; |
| 141 typedef byte* Address; | 141 typedef byte* Address; |
| 142 | 142 |
| 143 // Define our own macros for writing 64-bit constants. This is less fragile | 143 // Define our own macros for writing 64-bit constants. This is less fragile |
| 144 // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it | 144 // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it |
| 145 // works on compilers that don't have it (like MSVC). | 145 // works on compilers that don't have it (like MSVC). |
| 146 #if V8_HOST_ARCH_64_BIT | 146 #if V8_HOST_ARCH_64_BIT |
| 147 #ifdef _MSC_VER | 147 #ifdef _MSC_VER |
| 148 #define V8_UINT64_C(x) (x ## UI64) | 148 #define V8_UINT64_C(x) (x ## UI64) |
| 149 #define V8_INT64_C(x) (x ## I64) | 149 #define V8_INT64_C(x) (x ## I64) |
| 150 #define V8_INTPTR_C(x) (x ## I64) |
| 150 #define V8_PTR_PREFIX "ll" | 151 #define V8_PTR_PREFIX "ll" |
| 151 #else // _MSC_VER | 152 #else // _MSC_VER |
| 152 #define V8_UINT64_C(x) (x ## UL) | 153 #define V8_UINT64_C(x) (x ## UL) |
| 153 #define V8_INT64_C(x) (x ## L) | 154 #define V8_INT64_C(x) (x ## L) |
| 155 #define V8_INTPTR_C(x) (x ## L) |
| 154 #define V8_PTR_PREFIX "l" | 156 #define V8_PTR_PREFIX "l" |
| 155 #endif // _MSC_VER | 157 #endif // _MSC_VER |
| 156 #else // V8_HOST_ARCH_64_BIT | 158 #else // V8_HOST_ARCH_64_BIT |
| 159 #define V8_INTPTR_C(x) (x) |
| 157 #define V8_PTR_PREFIX "" | 160 #define V8_PTR_PREFIX "" |
| 158 #endif // V8_HOST_ARCH_64_BIT | 161 #endif // V8_HOST_ARCH_64_BIT |
| 159 | 162 |
| 160 // The following macro works on both 32 and 64-bit platforms. | 163 // The following macro works on both 32 and 64-bit platforms. |
| 161 // Usage: instead of writing 0x1234567890123456 | 164 // Usage: instead of writing 0x1234567890123456 |
| 162 // write V8_2PART_UINT64_C(0x12345678,90123456); | 165 // write V8_2PART_UINT64_C(0x12345678,90123456); |
| 163 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) | 166 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) |
| 164 | 167 |
| 165 #define V8PRIxPTR V8_PTR_PREFIX "x" | 168 #define V8PRIxPTR V8_PTR_PREFIX "x" |
| 166 #define V8PRIdPTR V8_PTR_PREFIX "d" | 169 #define V8PRIdPTR V8_PTR_PREFIX "d" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // IEEE 754 single precision floating point number bit layout. | 219 // IEEE 754 single precision floating point number bit layout. |
| 217 const uint32_t kBinary32SignMask = 0x80000000u; | 220 const uint32_t kBinary32SignMask = 0x80000000u; |
| 218 const uint32_t kBinary32ExponentMask = 0x7f800000u; | 221 const uint32_t kBinary32ExponentMask = 0x7f800000u; |
| 219 const uint32_t kBinary32MantissaMask = 0x007fffffu; | 222 const uint32_t kBinary32MantissaMask = 0x007fffffu; |
| 220 const int kBinary32ExponentBias = 127; | 223 const int kBinary32ExponentBias = 127; |
| 221 const int kBinary32MaxExponent = 0xFE; | 224 const int kBinary32MaxExponent = 0xFE; |
| 222 const int kBinary32MinExponent = 0x01; | 225 const int kBinary32MinExponent = 0x01; |
| 223 const int kBinary32MantissaBits = 23; | 226 const int kBinary32MantissaBits = 23; |
| 224 const int kBinary32ExponentShift = 23; | 227 const int kBinary32ExponentShift = 23; |
| 225 | 228 |
| 229 |
| 226 // The expression OFFSET_OF(type, field) computes the byte-offset | 230 // The expression OFFSET_OF(type, field) computes the byte-offset |
| 227 // of the specified field relative to the containing type. This | 231 // of the specified field relative to the containing type. This |
| 228 // corresponds to 'offsetof' (in stddef.h), except that it doesn't | 232 // corresponds to 'offsetof' (in stddef.h), except that it doesn't |
| 229 // use 0 or NULL, which causes a problem with the compiler warnings | 233 // use 0 or NULL, which causes a problem with the compiler warnings |
| 230 // we have enabled (which is also why 'offsetof' doesn't seem to work). | 234 // we have enabled (which is also why 'offsetof' doesn't seem to work). |
| 231 // Here we simply use the non-zero value 4, which seems to work. | 235 // Here we simply use the non-zero value 4, which seems to work. |
| 232 #define OFFSET_OF(type, field) \ | 236 #define OFFSET_OF(type, field) \ |
| 233 (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4) | 237 (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4) |
| 234 | 238 |
| 235 | 239 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // ----------------------------------------------------------------------------- | 309 // ----------------------------------------------------------------------------- |
| 306 // Forward declarations for frequently used classes | 310 // Forward declarations for frequently used classes |
| 307 // (sorted alphabetically) | 311 // (sorted alphabetically) |
| 308 | 312 |
| 309 class FreeStoreAllocationPolicy; | 313 class FreeStoreAllocationPolicy; |
| 310 template <typename T, class P = FreeStoreAllocationPolicy> class List; | 314 template <typename T, class P = FreeStoreAllocationPolicy> class List; |
| 311 | 315 |
| 312 } } // namespace v8::internal | 316 } } // namespace v8::internal |
| 313 | 317 |
| 314 #endif // V8_GLOBALS_H_ | 318 #endif // V8_GLOBALS_H_ |
| OLD | NEW |