5#ifndef RUNTIME_VM_GLOBALS_H_
6#define RUNTIME_VM_GLOBALS_H_
23#if !defined(DART_COMPRESSED_POINTERS)
36#if defined(DART_COMPRESSED_POINTERS)
65#define kPosInfinity bit_cast<double>(DART_UINT64_C(0x7ff0000000000000))
66#define kNegInfinity bit_cast<double>(DART_UINT64_C(0xfff0000000000000))
72#define ARRAY_SIZE(array) \
73 ((sizeof(array) / sizeof(*(array))) / \
74 static_cast<intptr_t>(!(sizeof(array) % sizeof(*(array)))))
76#if defined(PRODUCT) && defined(DEBUG)
77#error Both PRODUCT and DEBUG defined.
81#define NOT_IN_PRODUCT(code)
82#define ONLY_IN_PRODUCT(code) code
84#define NOT_IN_PRODUCT(code) code
85#define ONLY_IN_PRODUCT(code)
88#if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_PRECOMPILER)
89#error DART_PRECOMPILED_RUNTIME and DART_PRECOMPILER are mutually exclusive
92#if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_NOSNAPSHOT)
93#error DART_PRECOMPILED_RUNTIME and DART_NOSNAPSHOT are mutually exclusive
96#if defined(DART_PRECOMPILED_RUNTIME)
97#define NOT_IN_PRECOMPILED(code)
98#define ONLY_IN_PRECOMPILED(code) code
100#define NOT_IN_PRECOMPILED(code) code
101#define ONLY_IN_PRECOMPILED(code)
104#if defined(TARGET_ARCH_IA32)
105#define NOT_IN_IA32(code)
107#define NOT_IN_IA32(code) code
110#if defined(DART_PRECOMPILED_RUNTIME)
111#define NOT_IN_PRECOMPILED_RUNTIME(code)
113#define NOT_IN_PRECOMPILED_RUNTIME(code) code
116#if !defined(DART_DISABLE_TIMELINE) && \
117 (defined(DART_ENABLE_TIMELINE) || !defined(PRODUCT) || \
118 defined(DART_HOST_OS_FUCHSIA) || defined(DART_TARGET_OS_FUCHSIA) || \
119 defined(DART_TARGET_OS_ANDROID) || defined(DART_TARGET_OS_MACOS))
120#define SUPPORT_TIMELINE 1
123#if defined(ARCH_IS_64_BIT) && !defined(IS_SIMARM_HOST64)
124#define HASH_IN_OBJECT_HEADER 1
138#define OFFSET_OF(type, field) \
139 (reinterpret_cast<intptr_t>( \
140 &(reinterpret_cast<type*>(kOffsetOfPtr)->field)) - \
143#define OFFSET_OF_RETURNED_VALUE(type, accessor) \
144 (reinterpret_cast<intptr_t>( \
145 (reinterpret_cast<type*>(kOffsetOfPtr)->accessor())) - \
148#define SIZE_OF_RETURNED_VALUE(type, method) \
149 sizeof(reinterpret_cast<type*>(kOffsetOfPtr)->method())
151#define SIZE_OF_DEREFERENCED_RETURNED_VALUE(type, method) \
152 sizeof(*(reinterpret_cast<type*>(kOffsetOfPtr))->method())
154#define OPEN_ARRAY_START(type, align) \
156 const uword result = reinterpret_cast<uword>(this) + sizeof(*this); \
157 ASSERT(Utils::IsAligned(result, alignof(align))); \
158 return reinterpret_cast<type*>(result); \
167#if defined(DART_HOST_OS_WINDOWS)
168#define ALIGN8 __declspec(align(8))
169#define ALIGN16 __declspec(align(16))
171#define ALIGN8 __attribute__((aligned(8)))
172#define ALIGN16 __attribute__((aligned(16)))
176#if defined(ARCH_IS_32_BIT)
184#if defined(DART_HOST_OS_WINDOWS)
187#if defined(HOST_ARCH_IA32)
188#define COPY_FP_REGISTER(fp) \
189 __asm { mov fp, ebp} \
194#define COPY_FP_REGISTER(fp) fp = OSThread::GetCurrentStackPointer();
200#define COPY_FP_REGISTER(fp) \
201 fp = reinterpret_cast<uintptr_t>(__builtin_frame_address(0));
205#if defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_ARM64) || \
206 defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_RISCV32) || \
207 defined(TARGET_ARCH_RISCV64)
208#define TARGET_USES_OBJECT_POOL 1
211#if defined(DART_PRECOMPILER) && \
212 (defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM) || \
213 defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_RISCV32) || \
214 defined(TARGET_ARCH_RISCV64))
215#define DART_SUPPORT_PRECOMPILATION 1
const intptr_t kOffsetOfPtr
static constexpr intptr_t kCompressedWordSizeLog2
constexpr intptr_t kBitsPerWord
static constexpr intptr_t kAllocationCanary
constexpr intptr_t MBLog2
constexpr intptr_t kInt32SizeLog2
const intptr_t kDefaultNewGenSemiMaxSize
constexpr intptr_t kWordSizeLog2
uintptr_t compressed_uword
static constexpr uword kZapUninitializedWord
constexpr intptr_t kInt32Size
constexpr intptr_t kBitsPerInt32
static constexpr intptr_t kCompressedWordSize
const intptr_t kDefaultMaxOldGenHeapSize
const intptr_t kBytesPerBigIntDigit
constexpr intptr_t kWordSize
const intptr_t kSmiBits32
const intptr_t kMaxAddrSpaceInWords
const intptr_t kMaxAddrSpaceMB