Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Functions
offsets_extractor.cc File Reference
#include <iostream>
#include "vm/compiler/runtime_api.h"
#include "vm/compiler/runtime_offsets_list.h"
#include "vm/dart_api_state.h"
#include "vm/dart_entry.h"
#include "vm/longjump.h"
#include "vm/native_arguments.h"
#include "vm/native_entry.h"
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/runtime_entry.h"
#include "vm/symbols.h"
#include "vm/timeline.h"

Go to the source code of this file.

Classes

class  dart::OffsetsExtractor
 

Namespaces

namespace  dart
 

Macros

#define PRODUCT_DEF   "!defined(PRODUCT)"
 
#define COMPRESSED_DEF   "!defined(DART_COMPRESSED_POINTERS)"
 
#define PREPROCESSOR_CONDITION    "#if " PRODUCT_DEF " && " ARCH_DEF_CPU " && " COMPRESSED_DEF
 
#define PREPROCESSOR_CONDITION_END
 
#define PRINT_ARRAY_SIZEOF(Class, Name, ElementOffset)
 
#define PRINT_PAYLOAD_SIZEOF(Class, Name, HeaderSize)
 
#define PRINT_FIELD_OFFSET(Class, Name)
 
#define PRINT_ARRAY_LAYOUT(Class, Name)
 
#define PRINT_SIZEOF(Class, Name, What)
 
#define PRINT_RANGE(Class, Name, Type, First, Last, Filter)
 
#define PRINT_CONSTANT(Class, Name)
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ COMPRESSED_DEF

#define COMPRESSED_DEF   "!defined(DART_COMPRESSED_POINTERS)"

Definition at line 45 of file offsets_extractor.cc.

◆ PREPROCESSOR_CONDITION

#define PREPROCESSOR_CONDITION    "#if " PRODUCT_DEF " && " ARCH_DEF_CPU " && " COMPRESSED_DEF

Definition at line 48 of file offsets_extractor.cc.

◆ PREPROCESSOR_CONDITION_END

#define PREPROCESSOR_CONDITION_END
Value:
"#endif // " PRODUCT_DEF " && \n // " ARCH_DEF_CPU \
" && \n // " COMPRESSED_DEF
#define PRODUCT_DEF
#define COMPRESSED_DEF

Definition at line 51 of file offsets_extractor.cc.

◆ PRINT_ARRAY_LAYOUT

#define PRINT_ARRAY_LAYOUT (   Class,
  Name 
)
Value:
std::cout << "static constexpr dart::compiler::target::word " #Class \
"_elements_start_offset = 0x" \
<< Class::ArrayTraits::elements_start_offset() << ";\n"; \
std::cout << "static constexpr dart::compiler::target::word " #Class \
"_element_size = 0x" \
<< Class::ArrayTraits::kElementSize << ";\n";

◆ PRINT_ARRAY_SIZEOF

#define PRINT_ARRAY_SIZEOF (   Class,
  Name,
  ElementOffset 
)

◆ PRINT_CONSTANT

#define PRINT_CONSTANT (   Class,
  Name 
)
Value:
std::cout << "static constexpr dart::compiler::target::word " #Class \
"_" #Name " = 0x" \
<< Class::Name << ";\n";
ImplicitString Name
Definition: DMSrcSink.h:38

◆ PRINT_FIELD_OFFSET

#define PRINT_FIELD_OFFSET (   Class,
  Name 
)
Value:
std::cout << "static constexpr dart::compiler::target::word " #Class \
"_" #Name " = 0x" \
<< Class::Name() << ";\n";

◆ PRINT_PAYLOAD_SIZEOF

#define PRINT_PAYLOAD_SIZEOF (   Class,
  Name,
  HeaderSize 
)

◆ PRINT_RANGE

#define PRINT_RANGE (   Class,
  Name,
  Type,
  First,
  Last,
  Filter 
)
Value:
{ \
auto filter = Filter; \
bool comma = false; \
std::cout << "static constexpr dart::compiler::target::word " #Class \
"_" #Name "[] = {"; \
for (intptr_t i = static_cast<intptr_t>(First); \
i <= static_cast<intptr_t>(Last); i++) { \
auto v = static_cast<Type>(i); \
std::cout << (comma ? ", " : ""); \
if (filter(v)) { \
std::cout << "0x" << Class::Name(v); \
} else { \
std::cout << "-1"; \
} \
comma = true; \
} \
std::cout << "};\n"; \
}
GrSamplerState::Filter Filter
Definition: texelsubset.cpp:39

◆ PRINT_SIZEOF

#define PRINT_SIZEOF (   Class,
  Name,
  What 
)
Value:
std::cout << "static constexpr dart::compiler::target::word " #Class \
"_" #Name " = 0x" \
<< sizeof(What) << ";\n";

◆ PRODUCT_DEF

#define PRODUCT_DEF   "!defined(PRODUCT)"

Definition at line 23 of file offsets_extractor.cc.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 192 of file offsets_extractor.cc.

192 {
193 std::cout << std::hex << PREPROCESSOR_CONDITION << std::endl;
194#if !defined(TARGET_ARCH_IA32) || !defined(DART_PRECOMPILED_RUNTIME)
196#endif
197 std::cout << PREPROCESSOR_CONDITION_END << std::endl;
198 return 0;
199}
#define PREPROCESSOR_CONDITION_END
#define PREPROCESSOR_CONDITION