5#ifndef RUNTIME_VM_FLAGS_H_
6#define RUNTIME_VM_FLAGS_H_
14#define DECLARE_FLAG(type, name) extern type FLAG_##name
16#define DEFINE_FLAG(type, name, default_value, comment) \
18 Flags::Register_##type(&FLAG_##name, #name, default_value, comment);
20#define DEFINE_FLAG_HANDLER(handler, name, comment) \
21 bool DUMMY_##name = Flags::RegisterFlagHandler(handler, #name, comment);
23#define DEFINE_OPTION_HANDLER(handler, name, comment) \
24 bool DUMMY_##name = Flags::RegisterOptionHandler(handler, #name, comment);
50 uint64_t default_value,
55 const char* default_value,
84 static intptr_t capacity_;
85 static intptr_t num_flags_;
87 static bool initialized_;
91 static bool SetFlagFromString(
Flag*
flag,
const char* argument);
93 static void Parse(
const char* option);
95 static int CompareFlagNames(
const void* left,
const void* right);
97 static void PrintFlags();
106 DISALLOW_ALLOCATION();
107 DISALLOW_IMPLICIT_CONSTRUCTORS(
Flags);
110#define PRODUCT_FLAG_MACRO(name, type, default_value, comment) \
111 extern type FLAG_##name;
114#define DEBUG_FLAG_MACRO(name, type, default_value, comment) \
115 extern type FLAG_##name;
117#define DEBUG_FLAG_MACRO(name, type, default_value, comment) \
118 const type FLAG_##name = default_value;
121#if defined(PRODUCT) && defined(DART_PRECOMPILED_RUNTIME)
122#define RELEASE_FLAG_MACRO(name, product_value, type, default_value, comment) \
123 const type FLAG_##name = product_value;
124#define PRECOMPILE_FLAG_MACRO(name, precompiled_value, product_value, type, \
125 default_value, comment) \
126 const type FLAG_##name = precompiled_value;
128#elif defined(PRODUCT)
129#define RELEASE_FLAG_MACRO(name, product_value, type, default_value, comment) \
130 const type FLAG_##name = product_value;
131#define PRECOMPILE_FLAG_MACRO(name, precompiled_value, product_value, type, \
132 default_value, comment) \
133 const type FLAG_##name = product_value;
135#elif defined(DART_PRECOMPILED_RUNTIME)
136#define RELEASE_FLAG_MACRO(name, product_value, type, default_value, comment) \
137 extern type FLAG_##name;
138#define PRECOMPILE_FLAG_MACRO(name, precompiled_value, product_value, type, \
139 default_value, comment) \
140 const type FLAG_##name = precompiled_value;
143#define RELEASE_FLAG_MACRO(name, product_value, type, default_value, comment) \
144 extern type FLAG_##name;
145#define PRECOMPILE_FLAG_MACRO(name, precompiled_value, product_value, type, \
146 default_value, comment) \
147 extern type FLAG_##name;
157#undef RELEASE_FLAG_MACRO
158#undef DEBUG_FLAG_MACRO
159#undef PRODUCT_FLAG_MACRO
160#undef PRECOMPILE_FLAG_MACRO
162#if defined(DART_PRECOMPILER)
166#if defined(USING_THREAD_SANITIZER)
167constexpr bool FLAG_target_thread_sanitizer =
true;
169constexpr bool FLAG_target_thread_sanitizer =
false;
171#if defined(USING_MEMORY_SANITIZER)
static bool IsSet(const char *name)
static char * ProcessCommandLineFlags(int argc, const char **argv)
static uint64_t Register_uint64_t(uint64_t *addr, const char *name, uint64_t default_value, const char *comment)
static bool Register_bool(bool *addr, const char *name, bool default_value, const char *comment)
static const char * Register_charp(charp *addr, const char *name, const char *default_value, const char *comment)
static bool SetFlag(const char *name, const char *value, const char **error)
static bool RegisterFlagHandler(FlagHandler handler, const char *name, const char *comment)
static int Register_int(int *addr, const char *name, int default_value, const char *comment)
static bool RegisterOptionHandler(OptionHandler handler, const char *name, const char *comment)
friend void Dart_TestParseFlags()
static void PrintJSON(JSONStream *js)
static bool Initialized()
static Flag * Lookup(const char *name)
FlutterSemanticsFlag flag
const uint8_t uint32_t uint32_t GError ** error
#define DEBUG_FLAG_MACRO(name, type, default_value, comment)
#define PRECOMPILE_FLAG_MACRO(name, precompiled_value, product_value, type, default_value, comment)
#define RELEASE_FLAG_MACRO(name, product_value, type, default_value, comment)
#define PRODUCT_FLAG_MACRO(name, type, default_value, comment)
void(* FlagHandler)(bool value)
void(* OptionHandler)(const char *value)
FLAG_LIST(PRODUCT_FLAG_MACRO, RELEASE_FLAG_MACRO, PRECOMPILE_FLAG_MACRO, DEBUG_FLAG_MACRO) const expr bool FLAG_target_thread_sanitizer
constexpr bool FLAG_target_memory_sanitizer
DECLARE_FLAG(bool, show_invisible_frames)