21#if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_TARGET_OS_LINUX)
61DEFINE_FLAG(
bool, trace_shutdown,
false,
"Trace VM shutdown on stderr");
63Isolate* Dart::vm_isolate_ =
nullptr;
64int64_t Dart::start_time_micros_ = 0;
66DebugInfo* Dart::pprof_symbol_generator_ =
nullptr;
105 ASSERT(in_use_count_.load() == 0);
106 uint8_t expected = kUnInitialized;
107 return state_.compare_exchange_strong(expected, kInitializing);
111 ASSERT(in_use_count_.load() == 0);
112 uint8_t expected = kInitializing;
113 bool result = state_.compare_exchange_strong(expected, kUnInitialized);
118 ASSERT(in_use_count_.load() == 0);
119 uint8_t expected = kInitializing;
120 bool result = state_.compare_exchange_strong(expected, kInitialized);
127 uint8_t expected = kInitialized;
128 return state_.compare_exchange_strong(expected, kCleaningup);
132 while (in_use_count_.load() > 0) {
135 uint8_t expected = kCleaningup;
136 bool result = state_.compare_exchange_strong(expected, kUnInitialized);
141 if (state_.load() != kInitialized) {
149 uint8_t
value = state_.load();
155 static constexpr uint8_t kUnInitialized = 0;
156 static constexpr uint8_t kInitializing = 1;
157 static constexpr uint8_t kInitialized = 2;
158 static constexpr uint8_t kCleaningup = 3;
160 static std::atomic<uint8_t> state_;
161 static std::atomic<uint64_t> in_use_count_;
163std::atomic<uint8_t> DartInitializationState::state_ = {
kUnInitialized};
164std::atomic<uint64_t> DartInitializationState::in_use_count_ = {0};
166#if defined(DART_PRECOMPILER) || defined(DART_PRECOMPILED_RUNTIME)
167static void CheckOffsets() {
168#if !defined(IS_SIMARM_HOST64)
172#define CHECK_OFFSET(expr, offset) \
173 if ((expr) != (offset)) { \
174 OS::PrintErr("%s got %" Pd ", %s expected %" Pd "\n", #expr, \
175 static_cast<intptr_t>(expr), #offset, \
176 static_cast<intptr_t>(offset)); \
181#define CHECK_ARRAY_SIZEOF(Class, Name, ElementOffset)
182#define CHECK_PAYLOAD_SIZEOF(Class, Name, HeaderSize)
184#if defined(DART_PRECOMPILED_RUNTIME)
185#define CHECK_FIELD(Class, Name) \
186 CHECK_OFFSET(Class::Name(), AOT_##Class##_##Name);
187#define CHECK_ARRAY(Class, Name) \
188 CHECK_OFFSET(Class::ArrayTraits::elements_start_offset(), \
189 AOT_##Class##_elements_start_offset); \
190 CHECK_OFFSET(Class::ArrayTraits::kElementSize, AOT_##Class##_element_size)
191#define CHECK_SIZEOF(Class, Name, What) \
192 CHECK_OFFSET(sizeof(What), AOT_##Class##_##Name);
193#define CHECK_RANGE(Class, Getter, Type, First, Last, Filter) \
194 for (intptr_t i = static_cast<intptr_t>(First); \
195 i <= static_cast<intptr_t>(Last); i++) { \
196 if (Filter(static_cast<Type>(i))) { \
197 CHECK_OFFSET(Class::Getter(static_cast<Type>(i)), \
198 AOT_##Class##_##Getter[i]); \
201#define CHECK_CONSTANT(Class, Name) \
202 CHECK_OFFSET(Class::Name, AOT_##Class##_##Name);
204#define CHECK_FIELD(Class, Name) CHECK_OFFSET(Class::Name(), Class##_##Name);
205#define CHECK_ARRAY(Class, Name) \
206 CHECK_OFFSET(Class::ArrayTraits::elements_start_offset(), \
207 Class##_elements_start_offset); \
208 CHECK_OFFSET(Class::ArrayTraits::kElementSize, Class##_element_size);
209#if defined(DART_PRECOMPILER)
214#define CHECK_SIZEOF(Class, Name, What)
216#define CHECK_SIZEOF(Class, Name, What) \
217 CHECK_OFFSET(sizeof(What), Class##_##Name);
219#define CHECK_RANGE(Class, Getter, Type, First, Last, Filter) \
220 for (intptr_t i = static_cast<intptr_t>(First); \
221 i <= static_cast<intptr_t>(Last); i++) { \
222 if (Filter(static_cast<Type>(i))) { \
223 CHECK_OFFSET(Class::Getter(static_cast<Type>(i)), Class##_##Getter[i]); \
226#define CHECK_CONSTANT(Class, Name) CHECK_OFFSET(Class::Name, Class##_##Name);
230 CHECK_ARRAY_SIZEOF, CHECK_PAYLOAD_SIZEOF, CHECK_RANGE,
234 CHECK_FIELD, CHECK_ARRAY, CHECK_SIZEOF, CHECK_ARRAY_SIZEOF,
235 CHECK_PAYLOAD_SIZEOF, CHECK_RANGE, CHECK_CONSTANT))
238 CHECK_ARRAY_SIZEOF, CHECK_PAYLOAD_SIZEOF,
239 CHECK_RANGE, CHECK_CONSTANT))
243 "CheckOffsets failed. Try updating offsets by running "
244 "./tools/run_offsets_extractor.dart");
248#undef CHECK_ARRAY_STRUCTFIELD
253#undef CHECK_PAYLOAD_SIZEOF
259#if defined(DART_PRECOMPILER) || defined(DART_PRECOMPILED_RUNTIME)
261#elif defined(ARCH_IS_64_BIT) != defined(TARGET_ARCH_IS_64_BIT)
263 "JIT cannot simulate target architecture with different word size than "
267#if defined(DART_HOST_OS_MACOS) && !defined(DART_HOST_OS_IOS)
269 if (
error !=
nullptr) {
275 return Utils::StrDup(
"VM initialization failed-VM Flags not initialized.");
277 if (vm_isolate_ !=
nullptr) {
278 return Utils::StrDup(
"VM initialization is in an inconsistent state.");
281 const Snapshot* snapshot =
nullptr;
282 if (
params->vm_snapshot_data !=
nullptr) {
284 if (snapshot ==
nullptr) {
293 if (snapshot !=
nullptr) {
296 if (
error !=
nullptr) {
310 if (
params->code_observer !=
nullptr) {
314#if defined(DART_HOST_OS_FUCHSIA)
320#if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_TARGET_OS_LINUX)
323 "Incompatible page size for AOT compiled ELF: expected at most %" Pd
332#if defined(SUPPORT_TIMELINE)
334 TimelineBeginEndScope tbes(Timeline::GetVMStream(),
"Dart::Init");
351#if defined(USING_SIMULATOR)
355 ASSERT(predefined_handles_ ==
nullptr);
356 predefined_handles_ =
new ReadOnlyHandles();
358 ASSERT(thread_pool_ ==
nullptr);
359 thread_pool_ =
new ThreadPool();
361 ASSERT(vm_isolate_ ==
nullptr);
363 const bool is_vm_isolate =
true;
373 std::unique_ptr<IsolateGroupSource>
source(
new IsolateGroupSource(
374 kVmIsolateName, kVmIsolateName,
params->vm_snapshot_data,
375 params->vm_snapshot_instructions,
nullptr, -1, api_flags));
377 auto group =
new IsolateGroup(std::move(
source),
nullptr,
380 group->CreateHeap(
true,
384 Isolate::InitIsolate(kVmIsolateName,
group, api_flags, is_vm_isolate);
385 group->set_initial_spawn_successful();
394 HandleScope handle_scope(
T);
403 if (
params->vm_snapshot_data !=
nullptr) {
404#if defined(SUPPORT_TIMELINE)
405 TimelineBeginEndScope tbes(Timeline::GetVMStream(),
"ReadVMSnapshot");
407 ASSERT(snapshot !=
nullptr);
408 vm_snapshot_kind_ = snapshot->kind();
412#if !defined(DART_PRECOMPILED_RUNTIME)
413 return Utils::StrDup(
"JIT runtime cannot run a precompiled snapshot");
416 if (
params->vm_snapshot_instructions ==
nullptr) {
420#if defined(DART_PRECOMPILED_RUNTIME)
422 "Precompiled runtime requires a precompiled snapshot");
430 FullSnapshotReader reader(snapshot,
params->vm_snapshot_instructions,
T);
432 if (!
error.IsNull()) {
438#if defined(SUPPORT_TIMELINE)
439 if (tbes.enabled()) {
440 tbes.SetNumArguments(2);
441 tbes.FormatArgument(0,
"snapshotSize",
"%" Pd, snapshot->length());
443 1,
"heapSize",
"%" Pd,
447 if (FLAG_trace_isolates) {
456 OS::PrintErr(
"VM Isolate: Symbol table capacity : %" Pd "\n", capacity);
459#if defined(DART_PRECOMPILED_RUNTIME)
461 "Precompiled runtime requires a precompiled snapshot");
471 T->InitVMConstants();
472#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
479#if defined(SUPPORT_TIMELINE)
480 TimelineBeginEndScope tbes(Timeline::GetVMStream(),
"FinalizeVMIsolate");
503 const bool support_service =
true;
506 const bool support_service =
false;
509 const bool is_dart2_aot_precompiler =
512 if (!is_dart2_aot_precompiler &&
517#ifndef DART_PRECOMPILED_RUNTIME
518 if (
params->start_kernel_isolate) {
529 "Bad VM initialization state, "
530 "already initialized or "
531 "multiple threads initializing the VM.");
533 char* retval = DartInit(
params);
534 if (retval !=
nullptr) {
543 bool only_application_isolates) {
547 OS::PrintErr(
"Attempt:%" Pd " waiting for isolate %s to check in\n",
548 num_attempts, isolate->
name());
556 bool found_vm_isolate =
false;
561 found_vm_isolate =
true;
565 return count == 1 && found_vm_isolate;
569void Dart::WaitForApplicationIsolateShutdown() {
570 ASSERT(!Isolate::creation_enabled_);
571 MonitorLocker ml(Isolate::isolate_creation_monitor_);
572 intptr_t num_attempts = 0;
577 if (num_attempts > 10) {
585void Dart::WaitForIsolateShutdown() {
586 int64_t start_time = 0;
587 if (FLAG_trace_shutdown) {
590 "ms] SHUTDOWN: Waiting for service "
591 "and kernel isolates to shutdown\n",
594 ASSERT(!Isolate::creation_enabled_);
595 MonitorLocker ml(Isolate::isolate_creation_monitor_);
596 intptr_t num_attempts = 0;
601 if (num_attempts > 10) {
604 if (FLAG_trace_shutdown) {
606 " time out waiting for "
607 "service and kernel isolates to shutdown\n",
612 if (FLAG_trace_shutdown) {
615 "ms] SHUTDOWN: Done waiting for service "
616 "and kernel isolates to shutdown\n",
618 if ((stop_time - start_time) > 500) {
620 "ms] SHUTDOWN: waited too long for service "
621 "and kernel isolates to shutdown\n",
622 (stop_time - start_time));
634 ASSERT(vm_isolate_ !=
nullptr);
636 if (FLAG_trace_shutdown) {
642 if (FLAG_trace_shutdown) {
652 if (FLAG_trace_shutdown) {
659 if (FLAG_trace_shutdown) {
668 if (FLAG_trace_shutdown) {
672 WaitForApplicationIsolateShutdown();
673 if (FLAG_trace_shutdown) {
682 if (FLAG_trace_shutdown) {
689 if (FLAG_trace_shutdown) {
697 WaitForIsolateShutdown();
700 if (FLAG_trace_shutdown) {
707 thread_pool_ =
nullptr;
708 if (FLAG_trace_shutdown) {
714 delete predefined_handles_;
715 predefined_handles_ =
nullptr;
718 if (FLAG_trace_shutdown) {
738 if (FLAG_trace_shutdown) {
745 vm_isolate_ =
nullptr;
761#if defined(SUPPORT_TIMELINE)
762 if (FLAG_trace_shutdown) {
776 if (FLAG_trace_shutdown) {
781 if (FLAG_trace_shutdown) {
787 if (FLAG_trace_shutdown) {
791#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
816 Isolate::InitIsolate(name_prefix, isolate_group, api_flags);
822 const uint8_t* snapshot_data,
823 const uint8_t* snapshot_instructions,
824 const uint8_t* kernel_buffer,
825 intptr_t kernel_buffer_size) {
826 auto IG =
T->isolate_group();
829 if (!
error.IsNull()) {
832 if (snapshot_data !=
nullptr && kernel_buffer ==
nullptr) {
834#if defined(SUPPORT_TIMELINE)
835 TimelineBeginEndScope tbes(
T, Timeline::GetIsolateStream(),
836 "ReadProgramSnapshot");
839 if (snapshot ==
nullptr) {
845 "Incompatible snapshot kinds: vm '%s', isolate '%s'",
850 if (FLAG_trace_isolates) {
855 if (!
error.IsNull()) {
859 T->SetupDartMutatorStateDependingOnSnapshot(
IG);
861#if defined(SUPPORT_TIMELINE)
862 if (tbes.enabled()) {
863 tbes.SetNumArguments(2);
864 tbes.FormatArgument(0,
"snapshotSize",
"%" Pd, snapshot->
length());
865 tbes.FormatArgument(1,
"heapSize",
"%" Pd,
869 if (FLAG_trace_isolates) {
870 IG->heap()->PrintSizes();
874 if ((vm_snapshot_kind_ !=
Snapshot::kNone) && kernel_buffer ==
nullptr) {
880#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
881 IG->class_table()->PopulateUserVisibleNames();
887#if !defined(DART_PRECOMPILED_RUNTIME)
900 if (class_table->HasValidClassAt(
cid)) {
901 cls = class_table->At(
cid);
909 const uint8_t* snapshot_data,
910 const uint8_t* snapshot_instructions,
911 const uint8_t* kernel_buffer,
912 intptr_t kernel_buffer_size) {
915 kernel_buffer, kernel_buffer_size));
916 if (!
error.IsNull()) {
922 auto IG =
T->isolate_group();
925 IG->set_shared_field_table(
T,
IG->shared_initial_field_table()->Clone(
931#if !defined(DART_PRECOMPILED_RUNTIME)
935 if (snapshot_data ==
nullptr || kernel_buffer !=
nullptr) {
936 auto object_store =
IG->object_store();
937 error ^= object_store->PreallocateObjects();
938 if (!
error.IsNull()) {
943 if (FLAG_print_class_table) {
944 IG->class_table()->Print();
951 bool is_first_isolate_in_group,
952 void* isolate_data) {
953 auto I =
T->isolate();
954 auto IG =
T->isolate_group();
964 I->set_field_table(
T,
IG->initial_field_table()->Clone(
I));
965 I->field_table()->MarkReadyToUse();
968 const auto& out_of_memory =
971 Z,
I->isolate_object_store()->PreallocateObjects(out_of_memory));
972 if (!
error.IsNull()) {
976 I->set_init_callback_data(isolate_data);
982 I->message_handler()->set_should_pause_on_start(
983 FLAG_pause_isolates_on_start);
984 I->message_handler()->set_should_pause_on_exit(FLAG_pause_isolates_on_exit);
990 I->debugger()->NotifyIsolateCreated();
997 I->set_current_tag(default_tag);
999 I->init_loaded_prefixes_set_storage();
1011 buffer.AddString(
"debug");
1012#elif defined(PRODUCT)
1013 buffer.AddString(
"product");
1015 buffer.AddString(
"release");
1018#define ADD_FLAG(name, value) \
1020 buffer.AddString(value ? (" " #name) : (" no-" #name)); \
1022#define ADD_P(name, T, DV, C) ADD_FLAG(name, FLAG_##name)
1023#define ADD_R(name, PV, T, DV, C) ADD_FLAG(name, FLAG_##name)
1024#define ADD_C(name, PCV, PV, T, DV, C) ADD_FLAG(name, FLAG_##name)
1025#define ADD_D(name, T, DV, C) ADD_FLAG(name, FLAG_##name)
1027#define ADD_ISOLATE_GROUP_FLAG(name, isolate_flag, flag) \
1029 const bool value = \
1030 isolate_group != nullptr ? isolate_group->name() : flag; \
1031 ADD_FLAG(name, value); \
1037 ADD_FLAG(tsan, FLAG_target_thread_sanitizer)
1049 FLAG_use_field_guards);
1052 FLAG_branch_coverage);
1059#if defined(TARGET_ARCH_IA32)
1060 buffer.AddString(
" ia32");
1061#elif defined(TARGET_ARCH_X64)
1062 buffer.AddString(
" x64");
1063#elif defined(TARGET_ARCH_ARM)
1064 buffer.AddString(
" arm");
1065#elif defined(TARGET_ARCH_ARM64)
1066 buffer.AddString(
" arm64");
1067#elif defined(TARGET_ARCH_RISCV32)
1068 buffer.AddString(
" riscv32");
1069#elif defined(TARGET_ARCH_RISCV64)
1070 buffer.AddString(
" riscv64");
1072#error What architecture?
1075#if defined(DART_TARGET_OS_ANDROID)
1076 buffer.AddString(
" android");
1077#elif defined(DART_TARGET_OS_FUCHSIA)
1078 buffer.AddString(
" fuchsia");
1079#elif defined(DART_TARGET_OS_MACOS)
1080#if defined(DART_TARGET_OS_MACOS_IOS)
1081 buffer.AddString(
" ios");
1083 buffer.AddString(
" macos");
1085#elif defined(DART_TARGET_OS_LINUX)
1086 buffer.AddString(
" linux");
1087#elif defined(DART_TARGET_OS_WINDOWS)
1088 buffer.AddString(
" windows");
1090#error What operating system?
1093#if defined(DART_COMPRESSED_POINTERS)
1094 buffer.AddString(
" compressed-pointers");
1096 buffer.AddString(
" no-compressed-pointers");
1100#undef ADD_ISOLATE_FLAG
1119 (
callback)(isolate_group_data, isolate_data);
1124 T->isolate()->Shutdown();
1133 ASSERT(predefined_handles_ !=
nullptr);
1136 *
reinterpret_cast<uword*
>(handle + kOffsetOfIsZoneHandle *
kWordSize) = 0;
1143 ASSERT(predefined_handles_ !=
nullptr);
1148 ASSERT(predefined_handles_ !=
nullptr);
1153 ASSERT(predefined_handles_ !=
nullptr);
1154 return predefined_handles_->api_handles_.
IsValidHandle(handle);
static bool ok(int result)
#define RELEASE_ASSERT(cond)
static void InitHandles()
ErrorPtr EnsureIsFinalized(Thread *thread) const
static void RegisterExternal(Dart_CodeObserver observer)
static bool SetInitializing()
static void ResetInitializing()
static bool SetCleaningup()
static bool IsInitialized()
static void SetUnInitialized()
static void SetInitialized()
static ErrorPtr InitializeIsolateGroup(Thread *T, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
static bool IsReadOnlyHandle(uword address)
static void set_thread_start_callback(Dart_ThreadStartCallback cback)
static bool IsInitialized()
static void ShutdownIsolate(Thread *T)
static IsolateGroup * vm_isolate_group()
static void set_entropy_source_callback(Dart_EntropySource entropy_source)
static bool SetActiveApiCall()
static int64_t UptimeMillis()
static Isolate * vm_isolate()
static char * Init(const Dart_InitializeParams *params)
static void SetFileCallbacks(Dart_FileOpenCallback file_open, Dart_FileReadCallback file_read, Dart_FileWriteCallback file_write, Dart_FileCloseCallback file_close)
static int64_t UptimeMicros()
static char * FeaturesString(IsolateGroup *isolate_group, bool is_vm_snapshot, Snapshot::Kind kind)
static Isolate * CreateIsolate(const char *name_prefix, const Dart_IsolateFlags &api_flags, IsolateGroup *isolate_group)
static bool IsReadOnlyApiHandle(Dart_Handle handle)
static uword AllocateReadOnlyHandle()
static void ResetActiveApiCall()
static void RunShutdownCallback()
static LocalHandle * AllocateReadOnlyApiHandle()
static ErrorPtr InitializeIsolate(Thread *T, bool is_first_isolate_in_group, void *isolate_data)
static void set_thread_exit_callback(Dart_ThreadExitCallback cback)
static ErrorPtr InitIsolateGroupFromSnapshot(Thread *T, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
static bool Initialized()
ApiErrorPtr ReadProgramSnapshot()
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
uword AllocateScopedHandle()
bool IsValidScopedHandle(uword handle) const
bool Verify(const char *msg, MarkExpectation mark_expectation=kForbidMarked)
static void SetFileModifiedCallback(Dart_FileModifiedCallback callback)
void * embedder_data() const
ClassTable * class_table() const
static bool HasOnlyVMIsolateGroup()
void set_object_store(ObjectStore *object_store)
static void RegisterIsolateGroup(IsolateGroup *isolate_group)
static bool HasApplicationIsolateGroups()
static void ForEach(std::function< void(IsolateGroup *)> action)
static bool IsSystemIsolate(const Isolate *isolate)
static void DisableIsolateCreation()
static Isolate * Current()
IsolateObjectStore * isolate_object_store() const
static void KillAllSystemIsolates(LibMsgId msg_id)
static void FlagsInitialize(Dart_IsolateFlags *api_flags)
static void SetShutdownCallback(Dart_IsolateShutdownCallback cb)
static void KillAllIsolates(LibMsgId msg_id)
static intptr_t IsolateListLength()
void * init_callback_data() const
Dart_IsolateShutdownCallback on_shutdown_callback()
IsolateGroup * group() const
static void SetCleanupCallback(Dart_IsolateCleanupCallback cb)
static void SetInitializeCallback_(Dart_InitializeIsolateCallback cb)
static void SetGroupCleanupCallback(Dart_IsolateGroupCleanupCallback cb)
static void SetRegisterKernelBlobCallback(Dart_RegisterKernelBlobCallback cb)
static void SetCreateGroupCallback(Dart_IsolateGroupCreateCallback cb)
static void SetUnregisterKernelBlobCallback(Dart_UnregisterKernelBlobCallback cb)
const char * name() const
static void InitializeState()
LocalHandle * AllocateHandle()
bool IsValidHandle(Dart_Handle object) const
static void PrintSizes(Thread *thread)
static void SetCurrent(OSThread *current)
static OSThread * Current()
static void DisableOSThreadCreation()
static int64_t GetCurrentMonotonicMicros()
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static void Sleep(int64_t millis)
static void InitNullAndBool(IsolateGroup *isolate_group)
static void FinishInit(IsolateGroup *isolate_group)
static void FinalizeVMIsolate(IsolateGroup *isolate_group)
static void Init(IsolateGroup *isolate_group)
static void VerifyBuiltinVtables()
static bool SendIsolateStartupMessage()
static void MaybeMakeServiceIsolate(Isolate *isolate)
static void SetGetServiceAssetsCallback(Dart_GetVMServiceAssetsArchive get_service_assets)
static void SetEmbedderStreamCallbacks(Dart_ServiceStreamListenCallback listen_callback, Dart_ServiceStreamCancelCallback cancel_callback)
static bool IsFull(Kind kind)
static const Snapshot * SetupFromBuffer(const void *raw_memory)
static const char * KindToCString(Kind kind)
static bool IncludesCode(Kind kind)
static StringPtr NewFormatted(const char *format,...) PRINTF_ATTRIBUTE(1
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
static void GetStats(IsolateGroup *isolate_group, intptr_t *size, intptr_t *capacity)
static void Init(IsolateGroup *isolate_group)
static bool sse2_supported()
static Thread * Current()
ExecutionState execution_state() const
Isolate * isolate() const
IsolateGroup * isolate_group() const
static void EnterIsolate(Isolate *isolate)
static void ExitIsolate(bool isolate_shutdown=false)
static UserTagPtr DefaultTag()
static char * StrDup(const char *s)
static char * SCreate(const char *format,...) PRINTF_ATTRIBUTE(1
static intptr_t PageSize()
#define ADD_ISOLATE_GROUP_FLAG(name, isolate_flag, flag)
#define ADD_P(name, T, DV, C)
#define ADD_D(name, T, DV, C)
#define ADD_FLAG(name, value)
#define ADD_R(name, PV, T, DV, C)
#define ADD_C(name, PCV, PV, T, DV, C)
void(* Dart_FileWriteCallback)(const void *data, intptr_t length, void *stream)
void(* Dart_FileCloseCallback)(void *stream)
void(* Dart_FileReadCallback)(uint8_t **data, intptr_t *file_length, void *stream)
struct _Dart_Handle * Dart_Handle
bool(* Dart_EntropySource)(uint8_t *buffer, intptr_t length)
void(* Dart_ThreadStartCallback)(void)
void *(* Dart_FileOpenCallback)(const char *name, bool write)
void(* Dart_IsolateShutdownCallback)(void *isolate_group_data, void *isolate_data)
void(* Dart_ThreadExitCallback)(void)
char *(* Dart_DwarfStackTraceFootnoteCallback)(void *addresses[], intptr_t count)
const EmbeddedViewParams * params
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const uint8_t uint32_t uint32_t GError ** error
#define VM_GLOBAL_FLAG_LIST(P, R, C, D)
constexpr bool kDartPrecompiledRuntime
static void DumpAliveIsolates(intptr_t num_attempts, bool only_application_isolates)
static constexpr uint8_t kUnInitialized
static void FinalizeBuiltinClasses(Thread *thread)
DEFINE_FLAG(bool, print_cluster_information, false, "Print information about clusters written to snapshot")
char * CheckIsAtLeastMinRequiredMacOSVersion()
constexpr intptr_t kWordSize
static bool IsSnapshotCompatible(Snapshot::Kind vm_kind, Snapshot::Kind isolate_kind)
constexpr bool FLAG_target_memory_sanitizer
static bool OnlyVmIsolateLeft()
NOT_IN_PRODUCT(LibraryPtr ReloadTestScript(const char *script))
static constexpr intptr_t kElfPageSize
DECLARE_FLAG(bool, show_invisible_frames)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
#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)
#define NOT_IN_PRECOMPILED_RUNTIME(code)
#define ONLY_IN_PRECOMPILED(code)