32 #define V8_INFINITY INFINITY
37 #define __GNUC_VERSION_FOR_INFTY__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100)
45 #if __GNUC_VERSION_FOR_INFTY__ >= 29600 && __GNUC_VERSION_FOR_INFTY__ < 40100
48 #define V8_INFINITY std::numeric_limits<double>::infinity()
50 #undef __GNUC_VERSION_FOR_INFTY__
56 #define V8_INFINITY HUGE_VAL
60 #include "../include/v8stdint.h"
69 #if defined(_M_X64) || defined(__x86_64__)
70 #define V8_HOST_ARCH_X64 1
71 #define V8_HOST_ARCH_64_BIT 1
72 #define V8_HOST_CAN_READ_UNALIGNED 1
73 #elif defined(_M_IX86) || defined(__i386__)
74 #define V8_HOST_ARCH_IA32 1
75 #define V8_HOST_ARCH_32_BIT 1
76 #define V8_HOST_CAN_READ_UNALIGNED 1
77 #elif defined(__ARMEL__)
78 #define V8_HOST_ARCH_ARM 1
79 #define V8_HOST_ARCH_32_BIT 1
83 #if CAN_USE_UNALIGNED_ACCESSES
84 #define V8_HOST_CAN_READ_UNALIGNED 1
86 #elif defined(__MIPSEL__)
87 #define V8_HOST_ARCH_MIPS 1
88 #define V8_HOST_ARCH_32_BIT 1
90 #error Host architecture was not detected as supported by v8
96 #if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_IA32) && \
97 !defined(V8_TARGET_ARCH_ARM) && !defined(V8_TARGET_ARCH_MIPS)
98 #if defined(_M_X64) || defined(__x86_64__)
99 #define V8_TARGET_ARCH_X64 1
100 #elif defined(_M_IX86) || defined(__i386__)
101 #define V8_TARGET_ARCH_IA32 1
102 #elif defined(__ARMEL__)
103 #define V8_TARGET_ARCH_ARM 1
104 #elif defined(__MIPSEL__)
105 #define V8_TARGET_ARCH_MIPS 1
107 #error Target architecture was not detected as supported by v8
112 #if defined(V8_TARGET_ARCH_IA32) && !defined(V8_HOST_ARCH_IA32)
113 #error Target architecture ia32 is only supported on ia32 host
115 #if defined(V8_TARGET_ARCH_X64) && !defined(V8_HOST_ARCH_X64)
116 #error Target architecture x64 is only supported on x64 host
118 #if (defined(V8_TARGET_ARCH_ARM) && \
119 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM)))
120 #error Target architecture arm is only supported on arm and ia32 host
122 #if (defined(V8_TARGET_ARCH_MIPS) && \
123 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS)))
124 #error Target architecture mips is only supported on mips and ia32 host
130 #if !defined(USE_SIMULATOR)
131 #if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM))
132 #define USE_SIMULATOR 1
134 #if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS))
135 #define USE_SIMULATOR 1
152 typedef unsigned int __my_bool__;
153 #define bool __my_bool__ // use 'indirection' to avoid name clashes
162 #if V8_HOST_ARCH_64_BIT
163 #if defined(_MSC_VER)
164 #define V8_UINT64_C(x) (x ## UI64)
165 #define V8_INT64_C(x) (x ## I64)
166 #define V8_INTPTR_C(x) (x ## I64)
167 #define V8_PTR_PREFIX "ll"
168 #elif defined(__MINGW64__)
169 #define V8_UINT64_C(x) (x ## ULL)
170 #define V8_INT64_C(x) (x ## LL)
171 #define V8_INTPTR_C(x) (x ## LL)
172 #define V8_PTR_PREFIX "I64"
174 #define V8_UINT64_C(x) (x ## UL)
175 #define V8_INT64_C(x) (x ## L)
176 #define V8_INTPTR_C(x) (x ## L)
177 #define V8_PTR_PREFIX "l"
179 #else // V8_HOST_ARCH_64_BIT
180 #define V8_INTPTR_C(x) (x)
181 #define V8_PTR_PREFIX ""
182 #endif // V8_HOST_ARCH_64_BIT
187 #define V8_2PART_UINT64_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
189 #define V8PRIxPTR V8_PTR_PREFIX "x"
190 #define V8PRIdPTR V8_PTR_PREFIX "d"
191 #define V8PRIuPTR V8_PTR_PREFIX "u"
194 #if defined(__APPLE__) && defined(__MACH__)
196 #define V8PRIxPTR "lx"
199 #if (defined(__APPLE__) && defined(__MACH__)) || \
200 defined(__FreeBSD__) || defined(__OpenBSD__)
201 #define USING_BSD_ABI
227 #if V8_HOST_ARCH_64_BIT
273 #define OFFSET_OF(type, field) \
274 (reinterpret_cast<intptr_t>(&(reinterpret_cast<type*>(4)->field)) - 4)
281 #define ARRAY_SIZE(a) \
282 ((sizeof(a) / sizeof(*(a))) / \
283 static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))
288 template <
typename T>
293 #define FUNCTION_ADDR(f) \
294 (reinterpret_cast<v8::internal::Address>(reinterpret_cast<intptr_t>(f)))
299 template <
typename F>
301 return reinterpret_cast<F>(
reinterpret_cast<intptr_t
>(addr));
307 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
308 TypeName(const TypeName&); \
309 void operator=(const TypeName&)
318 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
320 DISALLOW_COPY_AND_ASSIGN(TypeName)
326 #if defined(__GNUC__) && !defined(DEBUG)
328 #define INLINE(header) inline header __attribute__((always_inline))
329 #define NO_INLINE(header) header __attribute__((noinline))
331 #define INLINE(header) inline __attribute__((always_inline)) header
332 #define NO_INLINE(header) __attribute__((noinline)) header
334 #elif defined(_MSC_VER) && !defined(DEBUG)
335 #define INLINE(header) __forceinline header
336 #define NO_INLINE(header) header
338 #define INLINE(header) inline header
339 #define NO_INLINE(header) header
343 #if defined(__GNUC__) && __GNUC__ >= 4
344 #define MUST_USE_RESULT __attribute__ ((warn_unused_result))
346 #define MUST_USE_RESULT
351 #if defined(__has_feature)
352 #if __has_feature(address_sanitizer)
353 #define DISABLE_ASAN __attribute__((no_address_safety_analysis))
367 class FreeStoreAllocationPolicy;
368 template <
typename T,
class P = FreeStoreAllocationPolicy>
class List;
405 #endif // V8_GLOBALS_H_
const int kBinary32ExponentShift
const int kDoubleSizeLog2
const uint32_t kBinary32MantissaMask
const int kBinary32MaxExponent
const intptr_t kIntptrSignBit
const int kBitsPerPointer
const uint64_t kQuietNaNMask
const int kBinary32MantissaBits
const uint32_t kMaxAsciiCharCodeU
const int kBitsPerByteLog2
const int kPointerSizeLog2
const uintptr_t kUintptrAllBitsSet
const int kBinary32MinExponent
const int kBinary32ExponentBias
#define T(name, string, precedence)
const int kRandomStateSize
const uint32_t kBinary32ExponentMask
const uint32_t kBinary32SignMask
const uint32_t kMaxUInt32
const uc32 kMaxAsciiCharCode
F FUNCTION_CAST(Address addr)