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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 # else | 180 # else |
181 # define V8_INTPTR_C(x) (x) | 181 # define V8_INTPTR_C(x) (x) |
182 # define V8_PTR_PREFIX "" | 182 # define V8_PTR_PREFIX "" |
183 # endif // V8_HOST_ARCH_64_BIT | 183 # endif // V8_HOST_ARCH_64_BIT |
184 #elif V8_CC_MINGW64 | 184 #elif V8_CC_MINGW64 |
185 # define V8_UINT64_C(x) (x ## ULL) | 185 # define V8_UINT64_C(x) (x ## ULL) |
186 # define V8_INT64_C(x) (x ## LL) | 186 # define V8_INT64_C(x) (x ## LL) |
187 # define V8_INTPTR_C(x) (x ## LL) | 187 # define V8_INTPTR_C(x) (x ## LL) |
188 # define V8_PTR_PREFIX "I64" | 188 # define V8_PTR_PREFIX "I64" |
189 #elif V8_HOST_ARCH_64_BIT | 189 #elif V8_HOST_ARCH_64_BIT |
190 # define V8_UINT64_C(x) (x ## UL) | 190 # if V8_OS_MACOSX |
191 # define V8_INT64_C(x) (x ## L) | 191 # define V8_UINT64_C(x) (x ## ULL) |
| 192 # define V8_INT64_C(x) (x ## LL) |
| 193 # else |
| 194 # define V8_UINT64_C(x) (x ## UL) |
| 195 # define V8_INT64_C(x) (x ## L) |
| 196 # endif |
192 # define V8_INTPTR_C(x) (x ## L) | 197 # define V8_INTPTR_C(x) (x ## L) |
193 # define V8_PTR_PREFIX "l" | 198 # define V8_PTR_PREFIX "l" |
194 #else | 199 #else |
195 # define V8_UINT64_C(x) (x ## ULL) | 200 # define V8_UINT64_C(x) (x ## ULL) |
196 # define V8_INT64_C(x) (x ## LL) | 201 # define V8_INT64_C(x) (x ## LL) |
197 # define V8_INTPTR_C(x) (x) | 202 # define V8_INTPTR_C(x) (x) |
198 # define V8_PTR_PREFIX "" | 203 # define V8_PTR_PREFIX "" |
199 #endif | 204 #endif |
200 | 205 |
201 // The following macro works on both 32 and 64-bit platforms. | 206 // The following macro works on both 32 and 64-bit platforms. |
202 // Usage: instead of writing 0x1234567890123456 | 207 // Usage: instead of writing 0x1234567890123456 |
203 // write V8_2PART_UINT64_C(0x12345678,90123456); | 208 // write V8_2PART_UINT64_C(0x12345678,90123456); |
204 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) | 209 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) |
205 | 210 |
206 #define V8PRIxPTR V8_PTR_PREFIX "x" | 211 #define V8PRIxPTR V8_PTR_PREFIX "x" |
207 #define V8PRIdPTR V8_PTR_PREFIX "d" | 212 #define V8PRIdPTR V8_PTR_PREFIX "d" |
208 #define V8PRIuPTR V8_PTR_PREFIX "u" | 213 #define V8PRIuPTR V8_PTR_PREFIX "u" |
209 | 214 |
210 // Fix for Mac OS X defining uintptr_t as "unsigned long": | 215 // Fix for Mac OS X defining uintptr_t as "unsigned long": |
211 #if defined(__APPLE__) && defined(__MACH__) | 216 #if V8_OS_MACOSX |
212 #undef V8PRIxPTR | 217 #undef V8PRIxPTR |
213 #define V8PRIxPTR "lx" | 218 #define V8PRIxPTR "lx" |
214 #endif | 219 #endif |
215 | 220 |
216 #if (defined(__APPLE__) && defined(__MACH__)) || \ | 221 #if V8_OS_MACOSX || defined(__FreeBSD__) || defined(__OpenBSD__) |
217 defined(__FreeBSD__) || defined(__OpenBSD__) | |
218 #define USING_BSD_ABI | 222 #define USING_BSD_ABI |
219 #endif | 223 #endif |
220 | 224 |
221 // ----------------------------------------------------------------------------- | 225 // ----------------------------------------------------------------------------- |
222 // Constants | 226 // Constants |
223 | 227 |
224 const int KB = 1024; | 228 const int KB = 1024; |
225 const int MB = KB * KB; | 229 const int MB = KB * KB; |
226 const int GB = KB * KB * KB; | 230 const int GB = KB * KB * KB; |
227 const int kMaxInt = 0x7FFFFFFF; | 231 const int kMaxInt = 0x7FFFFFFF; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // the backend, so both modes are represented by the kStrictMode value. | 413 // the backend, so both modes are represented by the kStrictMode value. |
410 enum StrictModeFlag { | 414 enum StrictModeFlag { |
411 kNonStrictMode, | 415 kNonStrictMode, |
412 kStrictMode | 416 kStrictMode |
413 }; | 417 }; |
414 | 418 |
415 | 419 |
416 } } // namespace v8::internal | 420 } } // namespace v8::internal |
417 | 421 |
418 #endif // V8_GLOBALS_H_ | 422 #endif // V8_GLOBALS_H_ |
OLD | NEW |