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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 typedef unsigned int __my_bool__; | 164 typedef unsigned int __my_bool__; |
165 #define bool __my_bool__ // use 'indirection' to avoid name clashes | 165 #define bool __my_bool__ // use 'indirection' to avoid name clashes |
166 #endif | 166 #endif |
167 | 167 |
168 typedef uint8_t byte; | 168 typedef uint8_t byte; |
169 typedef byte* Address; | 169 typedef byte* Address; |
170 | 170 |
171 // Define our own macros for writing 64-bit constants. This is less fragile | 171 // Define our own macros for writing 64-bit constants. This is less fragile |
172 // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it | 172 // than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it |
173 // works on compilers that don't have it (like MSVC). | 173 // works on compilers that don't have it (like MSVC). |
174 #if V8_HOST_ARCH_64_BIT | 174 #if V8_CC_MSVC |
175 #if defined(_MSC_VER) | 175 # define V8_UINT64_C(x) (x ## UI64) |
176 #define V8_UINT64_C(x) (x ## UI64) | 176 # define V8_INT64_C(x) (x ## I64) |
177 #define V8_INT64_C(x) (x ## I64) | 177 # if V8_HOST_ARCH_64_BIT |
178 #define V8_INTPTR_C(x) (x ## I64) | 178 # define V8_INTPTR_C(x) (x ## I64) |
179 #define V8_PTR_PREFIX "ll" | 179 # define V8_PTR_PREFIX "ll" |
180 #elif defined(__MINGW64__) | 180 # else |
181 #define V8_UINT64_C(x) (x ## ULL) | 181 # define V8_INTPTR_C(x) (x) |
182 #define V8_INT64_C(x) (x ## LL) | 182 # define V8_PTR_PREFIX "" |
183 #define V8_INTPTR_C(x) (x ## LL) | 183 # endif // V8_HOST_ARCH_64_BIT |
184 #define V8_PTR_PREFIX "I64" | 184 #elif V8_CC_MINGW64 |
| 185 # define V8_UINT64_C(x) (x ## ULL) |
| 186 # define V8_INT64_C(x) (x ## LL) |
| 187 # define V8_INTPTR_C(x) (x ## LL) |
| 188 # define V8_PTR_PREFIX "I64" |
| 189 #elif V8_HOST_ARCH_64_BIT |
| 190 # define V8_UINT64_C(x) (x ## UL) |
| 191 # define V8_INT64_C(x) (x ## L) |
| 192 # define V8_INTPTR_C(x) (x ## L) |
| 193 # define V8_PTR_PREFIX "l" |
185 #else | 194 #else |
186 #define V8_UINT64_C(x) (x ## UL) | 195 # define V8_UINT64_C(x) (x ## ULL) |
187 #define V8_INT64_C(x) (x ## L) | 196 # define V8_INT64_C(x) (x ## LL) |
188 #define V8_INTPTR_C(x) (x ## L) | 197 # define V8_INTPTR_C(x) (x) |
189 #define V8_PTR_PREFIX "l" | 198 # define V8_PTR_PREFIX "" |
190 #endif | 199 #endif |
191 #else // V8_HOST_ARCH_64_BIT | |
192 #define V8_INTPTR_C(x) (x) | |
193 #define V8_PTR_PREFIX "" | |
194 #endif // V8_HOST_ARCH_64_BIT | |
195 | 200 |
196 // The following macro works on both 32 and 64-bit platforms. | 201 // The following macro works on both 32 and 64-bit platforms. |
197 // Usage: instead of writing 0x1234567890123456 | 202 // Usage: instead of writing 0x1234567890123456 |
198 // write V8_2PART_UINT64_C(0x12345678,90123456); | 203 // write V8_2PART_UINT64_C(0x12345678,90123456); |
199 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) | 204 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u)) |
200 | 205 |
201 #define V8PRIxPTR V8_PTR_PREFIX "x" | 206 #define V8PRIxPTR V8_PTR_PREFIX "x" |
202 #define V8PRIdPTR V8_PTR_PREFIX "d" | 207 #define V8PRIdPTR V8_PTR_PREFIX "d" |
203 #define V8PRIuPTR V8_PTR_PREFIX "u" | 208 #define V8PRIuPTR V8_PTR_PREFIX "u" |
204 | 209 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 // the backend, so both modes are represented by the kStrictMode value. | 412 // the backend, so both modes are represented by the kStrictMode value. |
408 enum StrictModeFlag { | 413 enum StrictModeFlag { |
409 kNonStrictMode, | 414 kNonStrictMode, |
410 kStrictMode | 415 kStrictMode |
411 }; | 416 }; |
412 | 417 |
413 | 418 |
414 } } // namespace v8::internal | 419 } } // namespace v8::internal |
415 | 420 |
416 #endif // V8_GLOBALS_H_ | 421 #endif // V8_GLOBALS_H_ |
OLD | NEW |