21#define PRODUCT_DEF "defined(PRODUCT)"
23#define PRODUCT_DEF "!defined(PRODUCT)"
26#if defined(TARGET_ARCH_ARM)
27#define ARCH_DEF_CPU "defined(TARGET_ARCH_ARM)"
28#elif defined(TARGET_ARCH_X64)
29#define ARCH_DEF_CPU "defined(TARGET_ARCH_X64)"
30#elif defined(TARGET_ARCH_IA32)
31#define ARCH_DEF_CPU "defined(TARGET_ARCH_IA32)"
32#elif defined(TARGET_ARCH_ARM64)
33#define ARCH_DEF_CPU "defined(TARGET_ARCH_ARM64)"
34#elif defined(TARGET_ARCH_RISCV32)
35#define ARCH_DEF_CPU "defined(TARGET_ARCH_RISCV32)"
36#elif defined(TARGET_ARCH_RISCV64)
37#define ARCH_DEF_CPU "defined(TARGET_ARCH_RISCV64)"
39#error Unknown architecture
42#if defined(DART_COMPRESSED_POINTERS)
43#define COMPRESSED_DEF "defined(DART_COMPRESSED_POINTERS)"
45#define COMPRESSED_DEF "!defined(DART_COMPRESSED_POINTERS)"
48#define PREPROCESSOR_CONDITION \
49 "#if " PRODUCT_DEF " && " ARCH_DEF_CPU " && " COMPRESSED_DEF
51#define PREPROCESSOR_CONDITION_END \
52 "#endif // " PRODUCT_DEF " && \n // " ARCH_DEF_CPU \
53 " && \n // " COMPRESSED_DEF
73#define PRINT_ARRAY_SIZEOF(Class, Name, ElementOffset)
74#define PRINT_PAYLOAD_SIZEOF(Class, Name, HeaderSize)
76#if defined(DART_PRECOMPILED_RUNTIME)
78#define PRINT_FIELD_OFFSET(Class, Name) \
79 std::cout << "static constexpr dart::compiler::target::word AOT_" #Class \
81 << Class::Name() << ";\n";
83#define PRINT_ARRAY_LAYOUT(Class, Name) \
84 std::cout << "static constexpr dart::compiler::target::word AOT_" #Class \
85 "_elements_start_offset = 0x" \
86 << Class::ArrayTraits::elements_start_offset() << ";\n"; \
87 std::cout << "static constexpr dart::compiler::target::word AOT_" #Class \
88 "_element_size = 0x" \
89 << Class::ArrayTraits::kElementSize << ";\n";
91#define PRINT_SIZEOF(Class, Name, What) \
92 std::cout << "static constexpr dart::compiler::target::word AOT_" #Class \
94 << sizeof(What) << ";\n";
96#define PRINT_RANGE(Class, Name, Type, First, Last, Filter) \
98 auto filter = Filter; \
100 std::cout << "static constexpr dart::compiler::target::word AOT_" #Class \
101 "_" #Name "[] = {"; \
102 for (intptr_t i = static_cast<intptr_t>(First); \
103 i <= static_cast<intptr_t>(Last); i++) { \
104 auto v = static_cast<Type>(i); \
105 std::cout << (comma ? ", " : ""); \
107 std::cout << "0x" << Class::Name(v); \
113 std::cout << "};\n"; \
116#define PRINT_CONSTANT(Class, Name) \
117 std::cout << "static constexpr dart::compiler::target::word AOT_" #Class \
119 << Class::Name << ";\n";
127#define PRINT_FIELD_OFFSET(Class, Name) \
128 std::cout << "static constexpr dart::compiler::target::word " #Class \
130 << Class::Name() << ";\n";
132#define PRINT_ARRAY_LAYOUT(Class, Name) \
133 std::cout << "static constexpr dart::compiler::target::word " #Class \
134 "_elements_start_offset = 0x" \
135 << Class::ArrayTraits::elements_start_offset() << ";\n"; \
136 std::cout << "static constexpr dart::compiler::target::word " #Class \
137 "_element_size = 0x" \
138 << Class::ArrayTraits::kElementSize << ";\n";
140#define PRINT_SIZEOF(Class, Name, What) \
141 std::cout << "static constexpr dart::compiler::target::word " #Class \
143 << sizeof(What) << ";\n";
145#define PRINT_RANGE(Class, Name, Type, First, Last, Filter) \
147 auto filter = Filter; \
148 bool comma = false; \
149 std::cout << "static constexpr dart::compiler::target::word " #Class \
150 "_" #Name "[] = {"; \
151 for (intptr_t i = static_cast<intptr_t>(First); \
152 i <= static_cast<intptr_t>(Last); i++) { \
153 auto v = static_cast<Type>(i); \
154 std::cout << (comma ? ", " : ""); \
156 std::cout << "0x" << Class::Name(v); \
162 std::cout << "};\n"; \
165#define PRINT_CONSTANT(Class, Name) \
166 std::cout << "static constexpr dart::compiler::target::word " #Class \
168 << Class::Name << ";\n";
180#undef PRINT_FIELD_OFFSET
181#undef PRINT_ARRAY_LAYOUT
185#undef PRINT_ARRAY_SIZEOF
186#undef PRINT_PAYLOAD_SIZEOF
194#if !defined(TARGET_ARCH_IA32) || !defined(DART_PRECOMPILED_RUNTIME)
DART_NORETURN void Fail(const char *format,...) const PRINTF_ATTRIBUTE(2
uint32_t uint32_t * format
#define JIT_OFFSETS_LIST(FIELD, ARRAY, SIZEOF, ARRAY_SIZEOF, PAYLOAD_SIZEOF, RANGE, CONSTANT)
#define AOT_OFFSETS_LIST(FIELD, ARRAY, SIZEOF, ARRAY_SIZEOF, PAYLOAD_SIZEOF, RANGE, CONSTANT)
#define COMMON_OFFSETS_LIST(FIELD, ARRAY, SIZEOF, ARRAY_SIZEOF, PAYLOAD_SIZEOF, RANGE, CONSTANT)