59#if !defined(DART_PRECOMPILED_RUNTIME)
74#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
82 FLAG_background_compilation =
false;
83 FLAG_concurrent_mark =
false;
84 FLAG_concurrent_sweep =
false;
85 FLAG_scavenger_tasks = 0;
86 FLAG_old_gen_growth_time_ratio = 0;
87 FLAG_random_seed = 0x44617274;
93 "Enable deterministic mode.");
96 disable_thread_pool_limit,
98 "Disables the limit of the thread pool (simulates custom embedder "
99 "with custom message handler on unlimited number of threads).");
104#define IG (isolate_group())
109class VerifyOriginId :
public IsolateVisitor {
111 explicit VerifyOriginId(
Dart_Port id) : id_(
id) {}
113 void VisitIsolate(Isolate* isolate) {
ASSERT(isolate->origin_id() != id_); }
137 bool saved_external_typed_data =
false;
146 intptr_t next_entry_index = 0;
147 for (intptr_t
i = 0;
i < loaded_blobs.
Length();
i++) {
148 weak_property ^= loaded_blobs.
At(
i);
150 if (
i != next_entry_index) {
152 weak_property_tmp ^= loaded_blobs.
At(next_entry_index);
153 weak_property_tmp.
set_key(existing_entry);
158 if (next_entry_index < loaded_blobs.
Length()) {
160 weak_property ^= loaded_blobs.
At(next_entry_index);
161 weak_property.
set_key(external_typed_data);
163 saved_external_typed_data =
true;
165 if (next_entry_index < loaded_blobs.
Length()) {
168 while (next_entry_index < loaded_blobs.
Length()) {
170 weak_property ^= loaded_blobs.
At(next_entry_index);
171 weak_property.
set_key(nullExternalTypedData);
176 if (!saved_external_typed_data) {
179 weak_property.
set_key(external_typed_data);
192 ASSERT(heap_ ==
nullptr && heap !=
nullptr);
198 return idle_start_time_ > 0 && FLAG_idle_timeout_micros != 0 &&
199 disabled_counter_ == 0;
204 if (disabled_counter_ == 0) {
213 if (idle_start_time_ > 0 && disabled_counter_ == 0) {
214 const int64_t expiry_time = idle_start_time_ + FLAG_idle_timeout_micros;
215 if (expiry_time < now) {
216 idle_start_time_ = 0;
221 *expiry = now + FLAG_idle_timeout_micros;
230 if (heap_ !=
nullptr) {
236 idle_start_time_ = 0;
246 : handler_(handler) {
247 if (handler_ !=
nullptr) {
249 ++handler_->disabled_counter_;
250 handler_->idle_start_time_ = 0;
255 if (handler_ !=
nullptr) {
257 --handler_->disabled_counter_;
258 ASSERT(handler_->disabled_counter_ >= 0);
279 if (FLAG_idle_timeout_micros == 0)
return;
285 int64_t idle_expiry = 0;
320void MutatorThreadPool::NotifyIdle() {
330 : class_table_(nullptr),
331 cached_class_table_table_(nullptr),
332 object_store_(object_store),
333 class_table_allocator_(),
334 is_vm_isolate_(is_vm_isolate),
335 embedder_data_(embedder_data),
339 start_time_micros_(
OS::GetCurrentMonotonicMicros()),
340 is_system_isolate_group_(
source->
flags.is_system_isolate),
342#
if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
343 last_reload_timestamp_(
OS::GetCurrentTimeMillis()),
344 reload_every_n_stack_overflow_checks_(FLAG_reload_every),
352 saved_unlinked_calls_(
Array::null()),
353 initial_field_table_(new
FieldTable(nullptr)),
354 shared_initial_field_table_(new
FieldTable(nullptr,
356 shared_field_table_(new
FieldTable(nullptr, this)),
357#
if !defined(DART_PRECOMPILED_RUNTIME)
361 type_canonicalization_mutex_(
364 "IsolateGroup::type_arguments_canonicalization_mutex_")),
365 subtype_test_cache_mutex_(
367 megamorphic_table_mutex_(
369 type_feedback_mutex_(
371 patchable_call_mutex_(
373 constant_canonicalization_mutex_(
374 NOT_IN_PRODUCT(
"IsolateGroup::constant_canonicalization_mutex_")),
375 kernel_data_lib_cache_mutex_(
377 kernel_data_class_cache_mutex_(
379 kernel_constants_mutex_(
384 active_mutators_monitor_(new
Monitor()),
385 max_active_mutators_(
Scavenger::MaxMutatorThreadCount())
404 id_ = isolate_group_random_->
NextJSInt();
406 heap_walk_class_table_ = class_table_ =
408 cached_class_table_table_.
store(class_table_->table());
429 ASSERT(old_marking_stack_ ==
nullptr);
430 ASSERT(new_marking_stack_ ==
nullptr);
431 ASSERT(deferred_marking_stack_ ==
nullptr);
433 if (obfuscation_map_ !=
nullptr) {
434 for (intptr_t
i = 0; obfuscation_map_[
i] !=
nullptr;
i++) {
435 delete[] obfuscation_map_[
i];
437 delete[] obfuscation_map_;
440 class_table_allocator_.
Free(class_table_);
441 if (heap_walk_class_table_ != class_table_) {
442 class_table_allocator_.
Free(heap_walk_class_table_);
453 ASSERT(isolates_lock_->IsCurrentThreadWriter());
454 isolates_.Append(isolate);
463 return isolate_count_ == 0 || isolate_count_ == 1;
473 isolates_.Remove(isolate);
479 return isolate_count_ == 0;
483 bool is_service_or_kernel_isolate) {
487 : FLAG_new_gen_semi_max_size *
MBInWords,
489 : FLAG_old_gen_heap_size) *
492#define ISOLATE_GROUP_METRIC_CONSTRUCTORS(type, variable, name, unit) \
493 metric_##variable##_.InitInstance(this, name, nullptr, Metric::unit);
495#undef ISOLATE_GROUP_METRIC_CONSTRUCTORS
499 char*
name =
nullptr;
505 const bool trace_shutdown = FLAG_trace_shutdown;
507 if (trace_shutdown) {
516 if (!is_vm_isolate_) {
517 ASSERT(thread_pool_ !=
nullptr);
518 thread_pool_->Shutdown();
519 thread_pool_.reset();
528 if (heap_ !=
nullptr) {
531 PageSpace* old_space = heap_->old_space();
533 while (old_space->
tasks() > 0) {
544 if (initial_spawn_successful_ && !is_vm_isolate_) {
546 if (group_shutdown_callback !=
nullptr) {
556 if (trace_shutdown) {
558 "ms] SHUTDOWN: Notifying "
559 "isolate group shutdown (%s)\n",
563 if (!Isolate::creation_enabled_ &&
567 if (trace_shutdown) {
569 "ms] SHUTDOWN: Done Notifying "
570 "isolate group shutdown (%s)\n",
574 if (trace_shutdown) {
581void IsolateGroup::set_heap(std::unique_ptr<Heap> heap) {
583 heap_ = std::move(
heap);
591 bool is_nested_reenter) {
596 if (is_nested_reenter) {
608 ASSERT(active_mutators_ <= max_active_mutators_);
609 while (active_mutators_ == max_active_mutators_) {
624 if (is_nested_exit) {
634 ASSERT(active_mutators_ <= max_active_mutators_);
636 if (waiting_mutators_ > 0) {
649 jsobj->
AddProperty(
"type", (ref ?
"@IsolateGroup" :
"IsolateGroup"));
660 JSONArray isolate_array(jsobj,
"isolates");
661 for (
auto it = isolates_.Begin(); it != isolates_.End(); ++it) {
663 isolate_array.
AddValue(isolate,
true);
685 for (
auto isolate_group : *isolate_groups_) {
695 for (
auto isolate_group : *isolate_groups_) {
696 if (isolate_group->id() ==
id) {
706 isolate_groups_->Append(isolate_group);
711 isolate_groups_->Remove(isolate_group);
716 for (
auto group : *isolate_groups_) {
726 for (
auto group : *isolate_groups_) {
727 if (!
group->is_vm_isolate()) {
735 ASSERT(isolate_groups_rwlock_ ==
nullptr);
736 isolate_groups_rwlock_ =
new RwLock();
737 ASSERT(isolate_groups_ ==
nullptr);
739 isolate_group_random_ =
new Random();
743 delete isolate_group_random_;
744 isolate_group_random_ =
nullptr;
745 delete isolate_groups_rwlock_;
746 isolate_groups_rwlock_ =
nullptr;
747 ASSERT(isolate_groups_->IsEmpty());
748 delete isolate_groups_;
749 isolate_groups_ =
nullptr;
757 if (handle_ ==
nullptr) {
766 state->FreePersistentHandle(handle_);
770#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
784void IsolateGroup::ValidateClassTable() {
790 const Object& initial_value) {
791 const bool need_to_grow_backing_store =
793 const intptr_t field_id = field.
field_id();
796 if (need_to_grow_backing_store) {
800 const bool need_to_grow_other_backing_store =
802 ASSERT(need_to_grow_other_backing_store);
804 const bool need_to_grow_other_backing_store =
806 ASSERT(!need_to_grow_other_backing_store);
812 const Object& initial_value) {
820 const bool need_to_grow_backing_store =
822 const intptr_t field_id = field.
field_id();
826 if (need_to_grow_backing_store) {
830 for (
auto isolate : isolates_) {
831 auto field_table = isolate->field_table();
832 if (field_table->IsReadyToUse()) {
833 field_table->Register(field, field_id);
834 field_table->SetAt(field_id, initial_value.
ptr());
838 for (
auto isolate : isolates_) {
839 auto field_table = isolate->field_table();
840 if (field_table->IsReadyToUse()) {
841 field_table->Register(field, field_id);
842 field_table->SetAt(field_id, initial_value.
ptr());
849#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
854 const intptr_t field_id = field.
field_id();
864 if (field_table->IsReadyToUse()) {
865 field_table->Free(field_id);
874 Isolate*
const isolate = Isolate::InitIsolate(
"temp",
this,
flags);
875 ASSERT(isolate !=
nullptr);
882 ASSERT(thread !=
nullptr);
900 for (intptr_t
i = 0;
i < num_cids;
i++) {
901 old_constant_tables[
i] =
nullptr;
905 for (intptr_t
cid = kInstanceCid;
cid < num_cids;
cid++) {
915 if ((
cid == kMintCid) || (
cid == kDoubleCid)) {
939 for (intptr_t
cid = kInstanceCid;
cid < num_cids;
cid++) {
940 Array* old_constants = old_constant_tables[
cid];
941 if (old_constants ==
nullptr)
continue;
945 CanonicalInstancesSet::Iterator it(&
set);
946 while (it.MoveNext()) {
947 constant ^=
set.GetKey(it.Current());
956 for (intptr_t
cid = kInstanceCid;
cid < num_cids;
cid++) {
957 Array* old_constants = old_constant_tables[
cid];
958 if (old_constants ==
nullptr)
continue;
962 CanonicalInstancesSet::Iterator it(&
set);
987 while (it.MoveNext()) {
988 old_value ^=
set.GetKey(it.Current());
991 for (intptr_t j = 0; j < new_values.
Length(); j++) {
992 new_value ^= new_values.
At(j);
1000 new_value = deleted.
ptr();
1003 if (old_value.
ptr() != new_value.
ptr()) {
1011 while (it.MoveNext()) {
1012 old_value ^=
set.GetKey(it.Current());
1020 if (old_value.
ptr() != new_value.
ptr()) {
1040 uint64_t capability) {
1054 &array_entry_msg_kind,
1055 &array_entry_msg_id,
1056 &array_entry_capability,
1061 message.value.as_array.values = array_entries;
1081 const char*
name()
const;
1091 void CheckAccess()
const;
1115 : isolate_(isolate) {}
1120 return isolate_->
name();
1126ErrorPtr IsolateMessageHandler::HandleLibMessage(
const Array&
message) {
1128 Zone* zone =
T->zone();
1131 const intptr_t msg_type = Smi::Cast(
type).Value();
1137 if (!
I->VerifyPauseCapability(obj))
return Error::null();
1140 if (
I->AddResumeCapability(Capability::Cast(obj))) {
1149 if (!
I->VerifyPauseCapability(obj))
return Error::null();
1152 if (
I->RemoveResumeCapability(Capability::Cast(obj))) {
1162 const SendPort& send_port = SendPort::Cast(obj2);
1165 const intptr_t priority = Smi::Cast(obj3).Value();
1167 if (!obj4.IsInstance() && !obj4.IsNull())
return Error::null();
1168 const Instance& response =
1169 obj4.IsNull() ? Instance::null_instance() : Instance::Cast(obj4);
1193 const intptr_t priority = Smi::Cast(obj).Value();
1197 if (
I->VerifyTerminateCapability(obj)) {
1201 String::New(
"isolate terminated by Isolate.kill"));
1202 const UnwindError&
error =
1204 error.set_is_user_initiated(
true);
1235 if (!
I->VerifyPauseCapability(obj))
return Error::null();
1237#if !defined(PRODUCT)
1239 if (
I->debugger()->PauseEvent() ==
nullptr) {
1240 return I->debugger()->PauseInterrupted();
1249 const intptr_t priority = Smi::Cast(obj).Value();
1251 return I->InvokePendingServiceExtensionCalls();
1279 const SendPort& listener = SendPort::Cast(obj);
1285 if (!response.IsInstance() && !response.IsNull()) {
1288 I->AddExitListener(listener, response.IsNull()
1289 ? Instance::null_instance()
1290 : Instance::Cast(response));
1295 I->RemoveExitListener(listener);
1299 I->AddErrorListener(listener);
1303 I->RemoveErrorListener(listener);
1315 if (!
I->VerifyTerminateCapability(obj))
return Error::null();
1319 I->SetErrorsFatal(Bool::Cast(obj).
value());
1324#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
1327 T->CheckForSafepoint();
1337 FATAL(
"Unknown OOB message type: %" Pd "\n", msg_type);
1361 std::unique_ptr<Message>
message) {
1367#if defined(SUPPORT_TIMELINE)
1368 TimelineBeginEndScope tbes(
1369 thread, Timeline::GetIsolateStream(),
1370 message->IsOOB() ?
"HandleOOBMessage" :
"HandleMessage");
1371 tbes.SetNumArguments(1);
1372 tbes.CopyArgument(0,
"isolateName",
I->name());
1377 if (msg_obj.IsError()) {
1379 return ProcessUnhandledException(Error::Cast(msg_obj));
1381 if (!msg_obj.
IsNull() && !msg_obj.IsInstance()) {
1390 msg ^= msg_obj.
ptr();
1397 if (msg.IsArray()) {
1398 const Array& oob_msg = Array::Cast(msg);
1399 if (oob_msg.
Length() > 0) {
1401 if (oob_tag.IsSmi()) {
1402 switch (Smi::Cast(oob_tag).
Value()) {
1407 if (!
error.IsNull()) {
1408 status = ProcessUnhandledException(
error);
1417 if (!
error.IsNull()) {
1418 status = ProcessUnhandledException(
error);
1433 }
else if (
message->IsFinalizerInvocationRequest()) {
1437 if (msg_handler.IsError()) {
1438 status = ProcessUnhandledException(Error::Cast(msg_handler));
1446 if (msg.IsArray()) {
1447 const Array& msg_arr = Array::Cast(msg);
1448 if (msg_arr.
Length() > 0) {
1450 if (oob_tag.IsSmi() &&
1453 if (!
error.IsNull()) {
1454 status = ProcessUnhandledException(
error);
1462 if (msg_handler.IsError()) {
1463 status = ProcessUnhandledException(Error::Cast(msg_handler));
1464 }
else if (msg_handler.
IsNull()) {
1485 }
else if (FLAG_trace_service) {
1486 OS::PrintErr(
"vm-service: Dropping event of type PauseStart (%s)\n",
1501 }
else if (FLAG_trace_service) {
1502 OS::PrintErr(
"vm-service: Dropping event of type PauseExit (%s)\n",
1509void IsolateMessageHandler::CheckAccess()
const {
1521 if (
error.IsUnwindError()) {
1532 if (FLAG_trace_isolates) {
1534 "[!] Unhandled exception in %s:\n"
1536 T->isolate()->name(),
result.ToErrorCString());
1539 NoReloadScope no_reload(
T);
1541 const char* exception_cstr =
nullptr;
1542 const char* stacktrace_cstr =
nullptr;
1543 if (
result.IsUnhandledException()) {
1544 Zone* zone =
T->zone();
1545 const UnhandledException& uhe = UnhandledException::Cast(
result);
1547 if (exception.ptr() ==
IG->object_store()->out_of_memory()) {
1548 exception_cstr =
"Out of Memory";
1549 }
else if (exception.ptr() ==
IG->object_store()->stack_overflow()) {
1550 exception_cstr =
"Stack Overflow";
1552 const Object& exception_str =
1554 if (!exception_str.IsString()) {
1555 exception_cstr = exception.ToCString();
1557 exception_cstr = exception_str.ToCString();
1562 stacktrace_cstr = stacktrace.ToCString();
1564 exception_cstr =
result.ToErrorCString();
1566 if (
result.IsUnwindError()) {
1572 I->NotifyErrorListeners(exception_cstr, stacktrace_cstr);
1573 if (
I->ErrorsFatal()) {
1575 T->ClearStickyError();
1579#if !defined(PRODUCT)
1584 if (
result.IsUnhandledException()) {
1585 const UnhandledException&
error = UnhandledException::Cast(
result);
1586 InstancePtr exception =
error.exception();
1587 if ((exception ==
IG->object_store()->out_of_memory()) ||
1588 (exception ==
IG->object_store()->stack_overflow())) {
1602#define INIT_FROM_FLAG(when, name, bitname, isolate_flag, flag) \
1603 api_flags->isolate_flag = flag;
1605#undef INIT_FROM_FLAG
1613#define INIT_FROM_FIELD(when, name, bitname, isolate_flag, flag) \
1614 api_flags->isolate_flag = name();
1616#undef INIT_FROM_FIELD
1623#if defined(DART_PRECOMPILER)
1624#define FLAG_FOR_PRECOMPILER(action) action
1626#define FLAG_FOR_PRECOMPILER(action)
1629#if !defined(PRODUCT)
1630#define FLAG_FOR_NONPRODUCT(action) action
1632#define FLAG_FOR_NONPRODUCT(action)
1635#define FLAG_FOR_PRODUCT(action) action
1637#define SET_FROM_FLAG(when, name, bitname, isolate_flag, flag) \
1638 FLAG_FOR_##when(isolate_group_flags_ = bitname##Bit::update( \
1639 api_flags.isolate_flag, isolate_group_flags_));
1642#undef FLAG_FOR_NONPRODUCT
1643#undef FLAG_FOR_PRECOMPILER
1644#undef FLAG_FOR_PRODUCT
1652#define INIT_FROM_FLAG(when, name, bitname, isolate_flag, flag) \
1653 api_flags->isolate_flag = flag;
1655#undef INIT_FROM_FLAG
1665#define INIT_FROM_FIELD(when, name, bitname, isolate_flag, flag) \
1666 api_flags->isolate_flag = name();
1668#undef INIT_FROM_FIELD
1675#if defined(DART_PRECOMPILER)
1676#define FLAG_FOR_PRECOMPILER(action) action
1678#define FLAG_FOR_PRECOMPILER(action)
1681#if !defined(PRODUCT)
1682#define FLAG_FOR_NONPRODUCT(action) action
1684#define FLAG_FOR_NONPRODUCT(action)
1687#define FLAG_FOR_PRODUCT(action) action
1689#define SET_FROM_FLAG(when, name, bitname, isolate_flag, flag) \
1690 FLAG_FOR_##when(isolate_flags_ = bitname##Bit::update( \
1691 api_flags.isolate_flag, isolate_flags_));
1694#undef FLAG_FOR_NONPRODUCT
1695#undef FLAG_FOR_PRECOMPILER
1696#undef FLAG_FOR_PRODUCT
1702void BaseIsolate::AssertCurrent(
BaseIsolate* isolate) {
1708#define REUSABLE_HANDLE_SCOPE_INIT(object) \
1709 reusable_##object##_handle_scope_active_(false),
1711#define REUSABLE_HANDLE_SCOPE_INIT(object)
1714#define REUSABLE_HANDLE_INITIALIZERS(object) object##_handle_(nullptr),
1719 static const char*
Name() {
return "LibraryPrefixMapTraits"; }
1722 if (!
a.IsLibraryPrefix() || !
b.IsLibraryPrefix()) {
1725 return a.ptr() ==
b.ptr();
1729 auto&
prefix = LibraryPrefix::Cast(obj);
1736Isolate::Isolate(IsolateGroup* isolate_group,
1739 current_tag_(UserTag::null()),
1740 default_tag_(UserTag::null()),
1741 field_table_(new FieldTable(this)),
1742 finalizers_(GrowableObjectArray::null()),
1743 isolate_group_(isolate_group),
1744 isolate_object_store_(new IsolateObjectStore()),
1746#
if !defined(PRODUCT)
1747 last_resume_timestamp_(OS::GetCurrentTimeMillis()),
1749 pending_service_extension_calls_(GrowableObjectArray::null()),
1750 registered_service_extension_handlers_(GrowableObjectArray::null()),
1752 metric_##variable##_(),
1756 start_time_micros_(OS::GetCurrentMonotonicMicros()),
1757 message_notify_callback_(nullptr),
1758 on_shutdown_callback_(Isolate::ShutdownCallback()),
1759 on_cleanup_callback_(Isolate::CleanupCallback()),
1762 tag_table_(GrowableObjectArray::null()),
1763 sticky_error_(Error::null()),
1764 spawn_count_monitor_(),
1765 handler_info_cache_(),
1766 catch_entry_moves_cache_(),
1767 wake_pause_event_handler_count_(0),
1768 loaded_prefixes_set_storage_(nullptr) {
1769 FlagsCopyFrom(api_flags);
1770 SetErrorsFatal(
true);
1777#undef REUSABLE_HANDLE_SCOPE_INIT
1778#undef REUSABLE_HANDLE_INITIALIZERS
1781#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
1786#if !defined(PRODUCT)
1788 debugger_ =
nullptr;
1789 delete object_id_ring_;
1790 object_id_ring_ =
nullptr;
1791 delete pause_loop_monitor_;
1792 pause_loop_monitor_ =
nullptr;
1796 delete field_table_;
1797#if defined(USING_SIMULATOR)
1800 delete message_handler_;
1805 ASSERT(spawn_count_ == 0);
1813void Isolate::InitVM() {
1814 create_group_callback_ =
nullptr;
1815 initialize_callback_ =
nullptr;
1816 shutdown_callback_ =
nullptr;
1817 cleanup_callback_ =
nullptr;
1818 cleanup_group_callback_ =
nullptr;
1819 register_kernel_blob_callback_ =
nullptr;
1820 unregister_kernel_blob_callback_ =
nullptr;
1821 if (isolate_creation_monitor_ ==
nullptr) {
1822 isolate_creation_monitor_ =
new Monitor();
1824 ASSERT(isolate_creation_monitor_ !=
nullptr);
1828Isolate* Isolate::InitIsolate(
const char* name_prefix,
1829 IsolateGroup* isolate_group,
1831 bool is_vm_isolate) {
1832 Isolate*
result =
new Isolate(isolate_group, api_flags);
1834 result->BuildName(name_prefix);
1842 result->isolate_object_store()->Init();
1847#if !defined(PRODUCT)
1849#define ISOLATE_METRIC_INIT(type, variable, name, unit) \
1850 result->metric_##variable##_.InitInstance(result, name, nullptr, \
1853#undef ISOLATE_METRIC_INIT
1865 result->message_handler_ =
new IsolateMessageHandler(
result);
1870 VerifyOriginId id_verifier(
result->main_port());
1879 result->set_pause_capability(
result->random()->NextJSInt());
1880 result->set_terminate_capability(
result->random()->NextJSInt());
1882#if !defined(PRODUCT)
1889 isolate_group->RegisterIsolate(
result);
1894#if !defined(DART_PRECOMPILED_RUNTIME)
1901 if (FLAG_trace_isolates) {
1902 if (name_prefix ==
nullptr || strcmp(name_prefix,
"vm-isolate") != 0) {
1904 "[+] Starting isolate:\n"
1911 if (!TryMarkIsolateReady(
result)) {
1912 result->LowLevelShutdown();
1913 Isolate::LowLevelCleanup(
result);
1954 bool is_executable) {
1962 for (
Isolate* isolate : isolates_) {
1963 isolate->ScheduleInterrupts(interrupt_bits);
1972 if (mthread !=
nullptr) {
1997 ASSERT((
id == main_port_ && origin_id_ == 0) || (origin_id_ == main_port_));
2002 finalizers_ =
value.ptr();
2009 return (debugger_ !=
nullptr) && (debugger_->
PauseEvent() !=
nullptr);
2014#if !defined(PRODUCT)
2015 if (debugger_ ==
nullptr) {
2020 if (!
error.IsNull()) {
2032void Isolate::BuildName(
const char* name_prefix) {
2033 ASSERT(name_ ==
nullptr);
2034 if (name_prefix ==
nullptr) {
2041#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
2065 if (thread->no_reload_scope_depth_ != 0) {
2075 const char* root_script_url,
2076 const char* packages_url,
2077 bool dont_delete_reload_context) {
2085 std::shared_ptr<IsolateGroupReloadContext> group_reload_context(
2087 group_reload_context_ = group_reload_context;
2090 program_reload_context_ =
2092 const bool success =
2093 group_reload_context_->Reload(force_reload, root_script_url, packages_url,
2096 if (!dont_delete_reload_context) {
2104 const uint8_t* kernel_buffer,
2105 intptr_t kernel_buffer_size,
2106 bool dont_delete_reload_context) {
2114 std::shared_ptr<IsolateGroupReloadContext> group_reload_context(
2116 group_reload_context_ = group_reload_context;
2119 program_reload_context_ =
2121 const bool success = group_reload_context_->Reload(
2124 nullptr, kernel_buffer, kernel_buffer_size);
2125 if (!dont_delete_reload_context) {
2133 group_reload_context_.reset();
2135 delete program_reload_context_;
2136 program_reload_context_ =
nullptr;
2144 return "Isolate is already runnable";
2147 return "The embedder has to ensure there is a root library (e.g. by "
2148 "calling Dart_LoadScriptFromKernel ).";
2164 if (FLAG_pause_isolates_on_unhandled_exceptions) {
2169#if defined(SUPPORT_TIMELINE)
2172 TimelineEvent*
event =
stream->StartEvent();
2173 if (
event !=
nullptr) {
2174 event->Instant(
"Runnable");
2188 return !capability.
IsNull() && capability.IsCapability() &&
2193 return !capability.
IsNull() && capability.IsCapability() &&
2199 const intptr_t kMaxResumeCapabilities =
2205 intptr_t insertion_index = -1;
2206 for (intptr_t
i = 0;
i < caps.
Length();
i++) {
2207 current ^= caps.
At(
i);
2209 if (insertion_index < 0) {
2210 insertion_index =
i;
2212 }
else if (current.
Id() == capability.
Id()) {
2216 if (insertion_index < 0) {
2217 if (caps.
Length() >= kMaxResumeCapabilities) {
2223 caps.
Add(capability);
2225 caps.
SetAt(insertion_index, capability);
2234 for (intptr_t
i = 0;
i < caps.
Length();
i++) {
2235 current ^= caps.
At(
i);
2236 if (!current.
IsNull() && (current.
Id() == capability.
Id())) {
2256 intptr_t insertion_index = -1;
2257 for (intptr_t
i = 0;
i < listeners.
Length();
i += 2) {
2258 current ^= listeners.
At(
i);
2260 if (insertion_index < 0) {
2261 insertion_index =
i;
2263 }
else if (current.
Id() == listener.
Id()) {
2264 listeners.
SetAt(
i + 1, response);
2268 if (insertion_index < 0) {
2269 if (listeners.
Length() >= kMaxListeners) {
2275 listeners.
Add(listener);
2276 listeners.
Add(response);
2278 listeners.
SetAt(insertion_index, listener);
2279 listeners.
SetAt(insertion_index + 1, response);
2287 for (intptr_t
i = 0;
i < listeners.
Length();
i += 2) {
2288 current ^= listeners.
At(
i);
2289 if (!current.
IsNull() && (current.
Id() == listener.
Id())) {
2292 listeners.
SetAt(
i, current);
2293 listeners.
SetAt(
i + 1, Object::null_instance());
2302 if (listeners.
IsNull())
return;
2306 for (intptr_t
i = 0;
i < listeners.
Length();
i += 2) {
2307 listener ^= listeners.
At(
i);
2308 if (!listener.
IsNull()) {
2310 response ^= listeners.
At(
i + 1);
2323 intptr_t insertion_index = -1;
2324 for (intptr_t
i = 0;
i < listeners.
Length();
i++) {
2325 current ^= listeners.
At(
i);
2327 if (insertion_index < 0) {
2328 insertion_index =
i;
2330 }
else if (current.
Id() == listener.
Id()) {
2334 if (insertion_index < 0) {
2335 if (listeners.
Length() >= kMaxListeners) {
2341 listeners.
Add(listener);
2343 listeners.
SetAt(insertion_index, listener);
2351 for (intptr_t
i = 0;
i < listeners.
Length();
i++) {
2352 current ^= listeners.
At(
i);
2353 if (!current.
IsNull() && (current.
Id() == listener.
Id())) {
2356 listeners.
SetAt(
i, current);
2363 const char* stacktrace) {
2366 if (listeners.
IsNull())
return false;
2376 arr_values[0] = &msg;
2378 if (stacktrace ==
nullptr) {
2384 arr_values[1] = &stack;
2387 bool was_somebody_notified =
false;
2388 for (intptr_t
i = 0;
i < listeners.
Length();
i++) {
2389 listener ^= listeners.
At(
i);
2390 if (!listener.
IsNull()) {
2393 was_somebody_notified =
true;
2396 return was_somebody_notified;
2413 reinterpret_cast<uword>(
this));
2417 return message_handler_;
2420void Isolate::RunAndCleanupFinalizersOnShutdown() {
2431 const auto& finalizers =
2433 if (!finalizers.IsNull()) {
2434 const intptr_t num_finalizers = finalizers.Length();
2438 auto& all_entries =
Set::Handle(stack_zone.GetZone());
2439 for (
int i = 0;
i < num_finalizers;
i++) {
2440 weak_reference ^= finalizers.At(
i);
2441 finalizer ^= weak_reference.target();
2442 if (!finalizer.IsNull()) {
2443 if (finalizer.isolate() ==
this) {
2444 if (FLAG_trace_finalizers) {
2445 THR_Print(
"Isolate %p Setting finalizer %p isolate to null\n",
this,
2446 finalizer.ptr()->untag());
2449 finalizer.set_isolate(
nullptr);
2455 if (finalizer.IsNativeFinalizer()) {
2457 const auto& native_finalizer = NativeFinalizer::Cast(finalizer);
2458 all_entries = finalizer.all_entries();
2459 Set::Iterator iterator(all_entries);
2460 while (iterator.MoveNext()) {
2461 current_entry ^= iterator.CurrentKey();
2462 native_finalizer.RunCallback(current_entry,
"Isolate shutdown");
2470void Isolate::LowLevelShutdown() {
2474 StackZone stack_zone(thread);
2475 HandleScope handle_scope(thread);
2476 NoSafepointScope no_safepoint_scope;
2479 if (
group()->object_store() !=
nullptr) {
2481 if (
error.IsNull() || !
error.IsUnwindError() ||
2482 UnwindError::Cast(
error).is_user_initiated()) {
2491 delete message_handler_;
2492 message_handler_ =
nullptr;
2496 if (ffi_callback_list_head_ !=
nullptr) {
2498 &ffi_callback_list_head_);
2501#if !defined(PRODUCT)
2502 if (FLAG_dump_megamorphic_stats) {
2505 if (FLAG_dump_symbol_stats) {
2508 if (FLAG_trace_isolates) {
2511 "[-] Stopping isolate:\n"
2515 if (FLAG_print_metrics) {
2518#define ISOLATE_GROUP_METRIC_PRINT(type, variable, name, unit) \
2519 OS::PrintErr("%s\n", isolate_group_->Get##variable##Metric()->ToString());
2521#undef ISOLATE_GROUP_METRIC_PRINT
2522#define ISOLATE_METRIC_PRINT(type, variable, name, unit) \
2523 OS::PrintErr("%s\n", metric_##variable##_.ToString());
2525#undef ISOLATE_METRIC_PRINT
2531#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
2533 if (FLAG_reload_every_back_off) {
2534 if (reload_every_n_stack_overflow_checks_ < 5000) {
2535 reload_every_n_stack_overflow_checks_ += 99;
2537 const auto old_value = reload_every_n_stack_overflow_checks_;
2538 reload_every_n_stack_overflow_checks_ = old_value * old_value;
2541 if (reload_every_n_stack_overflow_checks_ > 1000000) {
2542 reload_every_n_stack_overflow_checks_ = 1000000;
2550 forward_table_new_ = std::move(
value);
2554 forward_table_old_ = std::move(
value);
2557void Isolate::Shutdown() {
2567#if !defined(PRODUCT)
2574#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
2576 if (!
group()->HasAttemptedReload()) {
2578 "Isolate did not reload before exiting and "
2579 "--check-reloaded is enabled.\n");
2585 Isolate::UnMarkIsolateReady(
this);
2590 RunAndCleanupFinalizersOnShutdown();
2594 if (bequest_ !=
nullptr) {
2595 auto beneficiary = bequest_->beneficiary();
2596 auto handle = bequest_->TakeHandle();
2606 Isolate::LowLevelCleanup(
this);
2609void Isolate::LowLevelCleanup(Isolate* isolate) {
2610#if !defined(DART_PRECOMPILED_RUNTIME)
2611 if (isolate->is_kernel_isolate()) {
2615 if (isolate->is_service_isolate()) {
2623 auto callback_data = isolate->init_callback_data_;
2627 isolate_group->UnregisterIsolate(isolate);
2640 if (cleanup !=
nullptr) {
2641 cleanup(isolate_group->embedder_data(), callback_data);
2645 const bool shutdown_group = isolate_group->UnregisterIsolateDecrementCount();
2646 if (shutdown_group) {
2652#if !defined(DART_PRECOMPILED_RUNTIME)
2653 BackgroundCompiler::Stop(isolate_group);
2658 FinalizeWeakPersistentHandlesVisitor visitor(isolate_group);
2659 isolate_group->api_state()->VisitWeakHandlesUnlocked(&visitor);
2667 !isolate_group->thread_pool()->CurrentThreadIsWorker()) {
2668 isolate_group->Shutdown();
2670 class ShutdownGroupTask :
public ThreadPool::Task {
2672 explicit ShutdownGroupTask(
IsolateGroup* isolate_group)
2673 : isolate_group_(isolate_group) {}
2675 virtual void Run() { isolate_group_->Shutdown(); }
2683 if (FLAG_trace_shutdown) {
2706Random* IsolateGroup::isolate_group_random_ =
nullptr;
2707Monitor* Isolate::isolate_creation_monitor_ =
nullptr;
2708bool Isolate::creation_enabled_ =
false;
2710RwLock* IsolateGroup::isolate_groups_rwlock_ =
nullptr;
2711IntrusiveDList<IsolateGroup>* IsolateGroup::isolate_groups_ =
nullptr;
2713void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
2715 ASSERT(visitor !=
nullptr);
2720 if (!visitor->trace_values_through_fields()) {
2729 visitor->clear_gc_root_type();
2731 visitor->VisitPointer(
reinterpret_cast<ObjectPtr*
>(¤t_tag_));
2732 visitor->VisitPointer(
reinterpret_cast<ObjectPtr*
>(&default_tag_));
2733 visitor->VisitPointer(
reinterpret_cast<ObjectPtr*
>(&tag_table_));
2734 visitor->VisitPointer(
reinterpret_cast<ObjectPtr*
>(&sticky_error_));
2735 visitor->VisitPointer(
reinterpret_cast<ObjectPtr*
>(&finalizers_));
2736#if !defined(PRODUCT)
2737 visitor->VisitPointer(
2738 reinterpret_cast<ObjectPtr*
>(&pending_service_extension_calls_));
2739 visitor->VisitPointer(
2740 reinterpret_cast<ObjectPtr*
>(®istered_service_extension_handlers_));
2743#if !defined(PRODUCT)
2748 if (is_service_isolate()) {
2753#if !defined(DART_PRECOMPILED_RUNTIME)
2760 visitor->VisitPointer(
2761 reinterpret_cast<ObjectPtr*
>(&loaded_prefixes_set_storage_));
2763 if (pointers_to_verify_at_exit_.length() != 0) {
2764 visitor->VisitPointers(&pointers_to_verify_at_exit_[0],
2765 pointers_to_verify_at_exit_.length());
2769void Isolate::VisitStackPointers(ObjectPointerVisitor* visitor,
2797 ASSERT(loaded_prefixes_set_storage_ ==
nullptr);
2798 loaded_prefixes_set_storage_ =
2799 HashTables::New<UnorderedHashSet<LibraryPrefixMapTraits> >(4);
2804 loaded_prefixes_set_storage_);
2806 loaded_prefixes_set.
Release();
2812 loaded_prefixes_set_storage_);
2814 loaded_prefixes_set_storage_ = loaded_prefixes_set.
Release().ptr();
2821 ASSERT(old_marking_stack_ ==
nullptr);
2823 ASSERT(new_marking_stack_ ==
nullptr);
2825 ASSERT(deferred_marking_stack_ ==
nullptr);
2833 ASSERT(old_marking_stack_ !=
nullptr);
2834 old_marking_stack_ =
nullptr;
2835 ASSERT(new_marking_stack_ !=
nullptr);
2836 new_marking_stack_ =
nullptr;
2837 ASSERT(deferred_marking_stack_ !=
nullptr);
2838 deferred_marking_stack_ =
nullptr;
2843 bool at_safepoint) {
2852 for (
Isolate* isolate : isolates_) {
2858 for (
Isolate* isolate : isolates_) {
2864 for (
Isolate* isolate : isolates_) {
2875 return isolates_.IsEmpty() ? nullptr : isolates_.First();
2881 bool use_force_growth_in_otherwise) {
2887 single_current_mutator->
Call();
2894 single_current_mutator->
Call();
2902 if (use_force_growth_in_otherwise) {
2915 for (
Isolate* isolate : isolates_) {
2916 isolate->VisitObjectPointers(visitor, validate_frames);
2945#if !defined(PRODUCT)
2951#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
2960 if (
source()->loaded_blobs_ !=
nullptr) {
2965 if (
become() !=
nullptr) {
2978 for (
Isolate* isolate : isolates_) {
2981 isolate->VisitStackPointers(visitor, validate_frames);
2988#if !defined(PRODUCT)
2989 for (
Isolate* isolate : isolates_) {
2991 if (ring !=
nullptr) {
3013#if !defined(PRODUCT)
3015 if (object_id_ring_ ==
nullptr) {
3018 return object_id_ring_;
3060 ((isolate->
debugger() ==
nullptr) ||
3063 }
else if ((isolate->
debugger() !=
nullptr) &&
3070#if !defined(DART_PRECOMPILED_RUNTIME)
3071 if (isolate->
debugger() !=
nullptr) {
3074 if (stack->
Length() > 0) {
3086 jsobj.
AddProperty(
"type", (ref ?
"@Isolate" :
"Isolate"));
3092 jsobj.
AddProperty(
"isSystemIsolate", is_system_isolate());
3112#define TO_STRING(s) STR(s)
3115#define ADD_ISOLATE_FLAGS(when, name, bitname, isolate_flag_name, flag_name) \
3117 JSONObject jsflag(&jsflags); \
3118 jsflag.AddProperty("name", TO_STRING(name)); \
3119 jsflag.AddProperty("valueAsString", name() ? "true" : "false"); \
3121 JSONArray jsflags(&jsobj,
"isolateFlags");
3123#undef ADD_ISOLATE_FLAGS
3129 jsobj.
AddProperty(
"livePorts", open_ports_keepalive_);
3131#if !defined(DART_PRECOMPILED_RUNTIME)
3143 if (FLAG_profiler) {
3144 JSONObject tagCounters(&jsobj,
"_tagCounters");
3160 intptr_t num_libs =
libs.Length();
3163 JSONArray lib_array(&jsobj,
"libraries");
3164 for (intptr_t
i = 0;
i < num_libs;
i++) {
3172 JSONArray breakpoints(&jsobj,
"breakpoints");
3192 if (!handlers.
IsNull()) {
3195 for (intptr_t
i = 0;
i < handlers.
Length();
i += kRegisteredEntrySize) {
3196 handler_name ^= handlers.
At(
i + kRegisteredNameIndex);
3203 JSONObject isolate_group(&jsobj,
"isolate_group");
3219 tag_table_ =
value.ptr();
3226 current_tag_ = tag.
ptr();
3230 default_tag_ = tag.
ptr();
3235 ErrorPtr return_value = sticky_error_;
3237 return return_value;
3240#if !defined(PRODUCT)
3241void Isolate::set_pending_service_extension_calls(
3243 pending_service_extension_calls_ =
value.ptr();
3246void Isolate::set_registered_service_extension_handlers(
3247 const GrowableObjectArray&
value) {
3248 registered_service_extension_handlers_ =
value.ptr();
3266 const Array& arguments =
3275 for (intptr_t
i = 0;
i < calls.
Length();
i += kPendingEntrySize) {
3277 closure ^= calls.
At(
i + kPendingHandlerIndex);
3280 method_name ^= calls.
At(
i + kPendingMethodNameIndex);
3282 arguments.
SetAt(kPendingMethodNameIndex, method_name);
3283 parameter_keys ^= calls.
At(
i + kPendingKeysIndex);
3285 arguments.
SetAt(kPendingKeysIndex, parameter_keys);
3286 parameter_values ^= calls.
At(
i + kPendingValuesIndex);
3288 arguments.
SetAt(kPendingValuesIndex, parameter_values);
3289 reply_port ^= calls.
At(
i + kPendingReplyPortIndex);
3291 arguments.
SetAt(kPendingReplyPortIndex, reply_port);
3292 id ^= calls.
At(
i + kPendingIdIndex);
3293 arguments.
SetAt(kPendingIdIndex,
id);
3294 arguments.
SetAt(kPendingEntrySize,
Bool::Get(FLAG_trace_service));
3296 if (FLAG_trace_service) {
3301 if (FLAG_trace_service) {
3308 if (!
result.IsUnwindError()) {
3311 reply_port,
id, Error::Cast(
result));
3313 return Error::Cast(
result).ptr();
3320 return Error::Cast(
result).ptr();
3326GrowableObjectArrayPtr Isolate::GetAndClearPendingServiceExtensionCalls() {
3327 GrowableObjectArrayPtr r = pending_service_extension_calls_;
3333 const String& method_name,
3334 const Array& parameter_keys,
3335 const Array& parameter_values,
3338 if (FLAG_trace_service) {
3340 "ms] Isolate %s ENQUEUING request for extension %s\n",
3345 bool schedule_drain =
false;
3349 set_pending_service_extension_calls(calls);
3350 schedule_drain =
true;
3352 ASSERT(kPendingHandlerIndex == 0);
3354 ASSERT(kPendingMethodNameIndex == 1);
3355 calls.
Add(method_name);
3356 ASSERT(kPendingKeysIndex == 2);
3357 calls.
Add(parameter_keys);
3358 ASSERT(kPendingValuesIndex == 3);
3359 calls.
Add(parameter_values);
3360 ASSERT(kPendingReplyPortIndex == 4);
3361 calls.
Add(reply_port);
3362 ASSERT(kPendingIdIndex == 5);
3365 if (schedule_drain) {
3369 msg.
SetAt(0, element);
3371 msg.
SetAt(1, element);
3373 msg.
SetAt(2, element);
3395 set_registered_service_extension_handlers(handlers);
3405 ASSERT(kRegisteredNameIndex == 0);
3407 ASSERT(kRegisteredHandlerIndex == 1);
3412 event.set_extension_rpc(&
name);
3428 for (intptr_t
i = 0;
i < handlers.
Length();
i += kRegisteredEntrySize) {
3429 handler_name ^= handlers.
At(
i + kRegisteredNameIndex);
3438void Isolate::WakePauseEventHandler(
Dart_Isolate isolate) {
3449 if (current_notify_callback != Isolate::WakePauseEventHandler) {
3450 if (current_notify_callback !=
nullptr) {
3451 current_notify_callback(isolate);
3454 ++iso->wake_pause_event_handler_count_;
3464 if (pause_loop_monitor_ ==
nullptr) {
3465 pause_loop_monitor_ =
new Monitor();
3471 ASSERT(wake_pause_event_handler_count_ == 0);
3474#if !defined(DART_PRECOMPILED_RUNTIME)
3475 const bool had_program_reload_context =
3477 const int64_t start_time_micros = !had_program_reload_context
3484 bool resume =
false;
3497#if !defined(DART_PRECOMPILED_RUNTIME)
3498 if (had_program_reload_context &&
3499 (
group()->program_reload_context() ==
nullptr)) {
3500 if (FLAG_trace_reload) {
3501 const int64_t reload_time_micros =
3504 OS::PrintErr(
"Reloading has finished! (%.2f ms)\n", reload_millis);
3518 if (saved_notify_callback !=
nullptr) {
3519 while (wake_pause_event_handler_count_ > 0) {
3521 --wake_pause_event_handler_count_;
3524 wake_pause_event_handler_count_ = 0;
3532 if (visitor ==
nullptr) {
3563 std::unique_ptr<char[]>
result;
3567 const size_t len = strlen(isolate->name()) + 1;
3568 result = std::unique_ptr<char[]>(new char[len]);
3569 strncpy(result.get(), isolate->name(), len);
3576bool Isolate::TryMarkIsolateReady(
Isolate* isolate) {
3578 if (!creation_enabled_) {
3581 isolate->accepts_messages_ =
true;
3585void Isolate::UnMarkIsolateReady(Isolate* isolate) {
3586 MonitorLocker ml(isolate_creation_monitor_);
3587 isolate->accepts_messages_ =
false;
3592 creation_enabled_ =
false;
3597 creation_enabled_ =
true;
3602 return creation_enabled_;
3606 return group->source()->flags.is_system_isolate;
3610 return isolate->is_kernel_isolate() || isolate->is_service_isolate() ||
3614void Isolate::KillLocked(LibMsgId msg_id) {
3624 list_values[0] = &oob;
3629 list_values[1] = &msg_type;
3634 list_values[2] = ∩
3639 list_values[3] = &imm;
3656 bool kill_system_isolates =
false)
3659 kill_system_isolates_(kill_system_isolates) {}
3662 : target_(isolate), msg_id_(msg_id), kill_system_isolates_(
false) {
3670 ASSERT(isolate !=
nullptr);
3671 if (ShouldKill(isolate)) {
3672 if (isolate->AcceptsMessagesLocked()) {
3673 isolate->KillLocked(msg_id_);
3679 bool ShouldKill(
Isolate* isolate) {
3680 if (kill_system_isolates_) {
3681 ASSERT(target_ ==
nullptr);
3687 return (((target_ !=
nullptr) && (isolate == target_)) ||
3693 bool kill_system_isolates_;
3718 ASSERT(spawn_count_ > 0);
3725 ASSERT(thread !=
nullptr);
3727 while (spawn_count_ > 0) {
3737 this, zone, send_function, send_port, &ffi_callback_list_head_);
3744 bool keep_isolate_alive) {
3745 if (keep_isolate_alive) {
3749 this, zone, trampoline,
target, &ffi_callback_list_head_);
3753 ASSERT(0 <= open_ports_ && 0 <= open_ports_keepalive_ &&
3754 open_ports_keepalive_ <= open_ports_);
3755 return open_ports_keepalive_ > 0;
3761 ++open_ports_keepalive_;
3766 bool keep_isolate_alive) {
3768 if (!receive_port.
is_open())
return;
3775 if (keep_isolate_alive) {
3776 ASSERT(open_ports_keepalive_ < open_ports_);
3777 ++open_ports_keepalive_;
3779 ASSERT(0 < open_ports_keepalive_);
3780 --open_ports_keepalive_;
3787 if (!receive_port.
is_open())
return;
3794 --open_ports_keepalive_;
3803 &ffi_callback_list_head_);
3807 ffi_callback_keep_alive_counter_ +=
delta;
3808 ASSERT(ffi_callback_keep_alive_counter_ >= 0);
3812 ASSERT(ffi_callback_keep_alive_counter_ >= 0);
3813 return ffi_callback_keep_alive_counter_ > 0;
3816#if !defined(PRODUCT)
3819 class_table_ = class_table_->
Clone();
3825 class_table_allocator_.
Free(class_table_);
3826 class_table_ = heap_walk_class_table_;
3832 class_table_allocator_.
Free(heap_walk_class_table_);
3833 heap_walk_class_table_ = class_table_;
static bool ok(int result)
#define RELEASE_ASSERT(cond)
void store(T arg, std::memory_order order=std::memory_order_release)
void VisitWeakHandlesUnlocked(HandleVisitor *visitor)
void VisitObjectPointersUnlocked(ObjectPointerVisitor *visitor)
static Dart_Handle NewHandle(Thread *thread, ObjectPtr raw)
static Dart_Isolate CastIsolate(Isolate *isolate)
static ObjectPtr UnwrapHandle(Dart_Handle object)
static ArrayPtr New(intptr_t len, Heap::Space space=Heap::kNew)
ObjectPtr At(intptr_t index) const
void SetAt(intptr_t index, const Object &value) const
static ArrayPtr Grow(const Array &source, intptr_t new_length, Heap::Space space=Heap::kNew)
Thread * scheduled_mutator_thread_
void VisitObjectPointers(ObjectPointerVisitor *visitor)
void Add(const Object &before, const Object &after)
static const Bool & Get(bool value)
void Free(ClassTable *table)
void Register(const Class &cls)
ClassPtr At(intptr_t cid) const
void VisitObjectPointers(ObjectPointerVisitor *visitor)
void RegisterTopLevel(const Class &cls)
ClassTable * Clone() const
StringPtr ScrubbedName() const
InstancePtr InsertCanonicalConstant(Zone *zone, const Instance &constant) const
ArrayPtr constants() const
FieldPtr LookupField(const String &name) const
void set_constants(const Array &value) const
bool is_enum_class() const
FieldPtr LookupStaticField(const String &name) const
static ObjectPtr InvokeFunction(const Function &function, const Array &arguments)
static ObjectPtr HandleMessage(Dart_Port port_id, const Instance &message)
static ObjectPtr HandleFinalizerMessage(const FinalizerBase &finalizer)
static ObjectPtr ToString(const Instance &receiver)
static ObjectPtr DrainMicrotaskQueue()
static ThreadPool * thread_pool()
static void ShutdownIsolate(Thread *T)
static int64_t UptimeMillis()
static Isolate * vm_isolate()
ActivationFrame * FrameAt(int i) const
Dart_ExceptionPauseInfo GetExceptionPauseInfo() const
void PrintBreakpointsToJSONArray(JSONArray *jsarr) const
void VisitObjectPointers(ObjectPointerVisitor *visitor)
void PrintSettingsToJSONObject(JSONObject *jsobj) const
DebuggerStackTrace * StackTrace()
ErrorPtr PausePostRequest()
const ServiceEvent * PauseEvent() const
void SetExceptionPauseInfo(Dart_ExceptionPauseInfo pause_info)
void VisitObjectPointers(ObjectPointerVisitor *visitor)
DisableIdleTimerScope(IdleTimeHandler *handler)
static DART_NORETURN void PropagateError(const Error &error)
bool Register(const Field &field, intptr_t expected_field_id=-1)
void Free(intptr_t index)
void SetAt(intptr_t index, ObjectPtr raw_instance, bool concurrent_use=false)
void VisitObjectPointers(ObjectPointerVisitor *visitor)
ObjectPtr StaticConstFieldValue() const
void SetStaticConstFieldValue(const Instance &value, bool assert_initializing_store=true) const
intptr_t field_id() const
void UpdateUnreachable(IsolateGroup *isolate_group)
void VisitHandle(uword addr) override
FinalizeWeakPersistentHandlesVisitor(IsolateGroup *isolate_group)
void VisitObjectPointers(ObjectPointerVisitor *visitor)
void Add(const Object &value, Heap::Space space=Heap::kNew) const
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
ObjectPtr At(intptr_t index) const
void SetAt(intptr_t index, const Object &value) const
ObjectPtr GetOrNull(const Key &key, bool *present=nullptr) const
ObjectPtr InsertOrGet(const Object &key) const
StorageTraits::ArrayHandle & Release()
void SetupImagePage(void *pointer, uword size, bool is_executable)
void PrintMemoryUsageJSON(JSONStream *stream) const
void PrintToJSONObject(Space space, JSONObject *object) const
intptr_t TotalExternalInWords() const
void NotifyIdle(int64_t deadline)
void ResetCanonicalHashTable()
intptr_t TotalCapacityInWords() const
static void Init(IsolateGroup *isolate_group, bool is_vm_isolate, intptr_t max_new_gen_words, intptr_t max_old_gen_words)
intptr_t TotalUsedInWords() const
void InitializeWithHeap(Heap *heap)
bool ShouldNotifyIdle(int64_t *expiry)
bool ShouldCheckForIdle()
void NotifyIdleUsingDefaultDeadline()
void UpdateStartIdleTime()
void NotifyIdle(int64_t deadline)
ObjectPtr GetField(const Field &field) const
InstancePtr Canonicalize(Thread *thread) const
void SetField(const Field &field, const Object &value) const
static InstancePtr New(const Class &cls, Heap::Space space=Heap::kNew)
int64_t start_time_micros() const
void add_loaded_blob(Zone *zone_, const ExternalTypedData &external_typed_data)
void IncreaseMutatorCount(Isolate *mutator, bool is_nested_reenter)
GroupDebugger * debugger() const
void RunWithLockedGroup(std::function< void()> fun)
int64_t UptimeMicros() const
void RestoreOriginalClassTable()
bool ReloadKernel(JSONStream *js, bool force_reload, const uint8_t *kernel_buffer=nullptr, intptr_t kernel_buffer_size=0, bool dont_delete_reload_context=false)
void UnregisterIsolate(Isolate *isolate)
void ForEachIsolate(std::function< void(Isolate *isolate)> function, bool at_safepoint=false)
void set_cached_class_table_table(ClassPtr *cached_class_table_table)
bool UnregisterIsolateDecrementCount()
void DeleteReloadContext()
void VisitStackPointers(ObjectPointerVisitor *visitor, ValidationPolicy validate_frames)
MutatorThreadPool * thread_pool()
static bool IsSystemIsolateGroup(const IsolateGroup *group)
void ScheduleInterrupts(uword interrupt_bits)
void RegisterClass(const Class &cls)
void * embedder_data() const
void RehashConstants(Become *become)
void FlagsCopyFrom(const Dart_IsolateFlags &api_flags)
void DropOriginalClassTable()
MarkingStack * deferred_marking_stack() const
bool initial_spawn_successful()
bool ContainsOnlyOneIsolate()
void FreeStaticField(const Field &field)
ObjectStore * object_store() const
SafepointRwLock * program_lock()
void DisableIncrementalBarrier()
void CloneClassTableForReload()
static IsolateGroup * Current()
Dart_LibraryTagHandler library_tag_handler() const
void RegisterStaticField(const Field &field, const Object &initial_value)
ClassTable * class_table() const
static bool HasOnlyVMIsolateGroup()
bool is_system_isolate_group() const
void DecreaseMutatorCount(Isolate *mutator, bool is_nested_exit)
void VisitObjectIdRingPointers(ObjectPointerVisitor *visitor)
void set_object_store(ObjectStore *object_store)
ApiState * api_state() const
void RegisterSharedStaticField(const Field &field, const Object &initial_value)
FieldTable * initial_field_table() const
void VisitObjectPointers(ObjectPointerVisitor *visitor, ValidationPolicy validate_frames)
IsolateGroupSource * source() const
bool ReloadSources(JSONStream *js, bool force_reload, const char *root_script_url=nullptr, const char *packages_url=nullptr, bool dont_delete_reload_context=false)
void set_saved_unlinked_calls(const Array &saved_unlinked_calls)
void SetHasAttemptedReload(bool value)
void SetupImagePage(const uint8_t *snapshot_buffer, bool is_executable)
ClassTable * heap_walk_class_table() const
ArrayPtr saved_unlinked_calls() const
Isolate * FirstIsolateLocked() const
void PrintJSON(JSONStream *stream, bool ref=true)
void ReleaseStoreBuffers()
static void ExitTemporaryIsolate()
void RememberLiveTemporaries()
void FlagsCopyTo(Dart_IsolateFlags *api_flags)
MarkingStack * old_marking_stack() const
void RunWithStoppedMutatorsCallable(Callable *single_current_mutator, Callable *otherwise, bool use_force_growth_in_otherwise=false)
void VisitWeakPersistentHandles(HandleVisitor *visitor)
static void RunWithIsolateGroup(uint64_t id, std::function< void(IsolateGroup *)> action, std::function< void()> not_found)
void DeferredMarkLiveTemporaries()
void RegisterIsolate(Isolate *isolate)
void MaybeIncreaseReloadEveryNStackOverflowChecks()
FieldTable * shared_initial_field_table() const
ISOLATE_GROUP_METRIC_LIST(ISOLATE_METRIC_ACCESSOR)
BackgroundCompiler * background_compiler() const
static void RegisterIsolateGroup(IsolateGroup *isolate_group)
ThreadRegistry * thread_registry() const
Isolate * FirstIsolate() const
ObjectPtr CallTagHandler(Dart_LibraryTag tag, const Object &arg1, const Object &arg2)
IdleTimeHandler * idle_time_handler()
bool is_vm_isolate() const
Isolate * EnterTemporaryIsolate()
static bool HasApplicationIsolateGroups()
Dart_DeferredLoadHandler deferred_load_handler() const
void PrintToJSONObject(JSONObject *jsobj, bool ref)
static void ForEach(std::function< void(IsolateGroup *)> action)
FieldTable * shared_field_table() const
void FlushMarkingStacks()
MarkingStack * new_marking_stack() const
void EnableIncrementalBarrier(MarkingStack *old_marking_stack, MarkingStack *new_marking_stack, MarkingStack *deferred_marking_stack)
ProgramReloadContext * program_reload_context()
void VisitSharedPointers(ObjectPointerVisitor *visitor)
static void FlagsInitialize(Dart_IsolateFlags *api_flags)
void CreateHeap(bool is_vm_isolate, bool is_service_or_kernel_isolate)
IsolateGroup(std::shared_ptr< IsolateGroupSource > source, void *embedder_data, ObjectStore *object_store, Dart_IsolateFlags api_flags, bool is_vm_isolate)
static void UnregisterIsolateGroup(IsolateGroup *isolate_group)
bool HasTagHandler() const
void PrintMemoryUsageJSON(JSONStream *stream)
virtual ~IsolateKillerVisitor()
void VisitIsolate(Isolate *isolate)
IsolateKillerVisitor(Isolate *isolate, Isolate::LibMsgId msg_id)
IsolateKillerVisitor(Isolate::LibMsgId msg_id, bool kill_system_isolates=false)
MessageStatus HandleMessage(std::unique_ptr< Message > message)
virtual Isolate * isolate() const
bool IsCurrentIsolate() const
virtual bool KeepAliveLocked()
const char * name() const
IsolateMessageHandler(Isolate *isolate)
void MessageNotify(Message::Priority priority)
virtual IsolateGroup * isolate_group() const
void NotifyPauseOnStart()
void VisitObjectPointers(ObjectPointerVisitor *visitor)
virtual void VisitIsolate(Isolate *isolate)=0
bool IsSystemIsolate(Isolate *isolate) const
void set_forward_table_old(WeakTable *table)
ReceivePortPtr CreateReceivePort(const String &debug_name)
bool AddResumeCapability(const Capability &capability)
void AddExitListener(const SendPort &listener, const Instance &response)
void AddErrorListener(const SendPort &listener)
FfiCallbackMetadata::Trampoline CreateAsyncFfiCallback(Zone *zone, const Function &send_function, Dart_Port send_port)
ErrorPtr sticky_error() const
static bool IsSystemIsolate(const Isolate *isolate)
FieldTable * field_table() const
static void DisableIsolateCreation()
void ScheduleInterrupts(uword interrupt_bits)
void RememberLiveTemporaries()
@ kDrainServiceExtensionsMsg
static Isolate * Current()
static bool IsVMInternalIsolate(const Isolate *isolate)
void DeferredMarkLiveTemporaries()
static void KillIfExists(Isolate *isolate, LibMsgId msg_id)
static bool IsolateCreationEnabled()
IsolateObjectStore * isolate_object_store() const
void FlagsCopyTo(Dart_IsolateFlags *api_flags) const
VMTagCounters * vm_tag_counters()
static void KillAllSystemIsolates(LibMsgId msg_id)
static void VisitIsolates(IsolateVisitor *visitor)
Debugger * debugger() const
bool VerifyPauseCapability(const Object &capability) const
ISOLATE_METRIC_LIST(ISOLATE_METRIC_ACCESSOR)
void DeleteFfiCallback(FfiCallbackMetadata::Trampoline callback)
void NotifyExitListeners()
bool IsPrefixLoaded(const LibraryPrefix &prefix) const
void DecrementSpawnCount()
bool RemoveResumeCapability(const Capability &capability)
void PrintJSON(JSONStream *stream, bool ref=true)
bool ResumeRequest() const
MessageHandler * message_handler() const
ObjectPtr CallDeferredLoadHandler(intptr_t id)
void PrintPauseEventJSON(JSONStream *stream)
bool is_vm_isolate() const
void SetReceivePortKeepAliveState(const ReceivePort &receive_port, bool keep_isolate_alive)
FfiCallbackMetadata::Trampoline CreateIsolateLocalFfiCallback(Zone *zone, const Function &trampoline, const Closure &target, bool keep_isolate_alive)
void SetPrefixIsLoaded(const LibraryPrefix &prefix)
void RegisterServiceExtensionHandler(const String &name, const Instance &closure)
static void FlagsInitialize(Dart_IsolateFlags *api_flags)
void PrintMemoryUsageJSON(JSONStream *stream)
static void KillAllIsolates(LibMsgId msg_id)
static std::unique_ptr< char[]> LookupIsolateNameByPort(Dart_Port port)
bool HasPendingMessages()
static intptr_t IsolateListLength()
uint64_t terminate_capability() const
ThreadRegistry * thread_registry() const
void set_is_runnable(bool value)
void CloseReceivePort(const ReceivePort &receive_port)
bool HasDeferredLoadHandler() const
const char * MakeRunnable()
void SendInternalLibMessage(LibMsgId msg_id, uint64_t capability)
bool VerifyTerminateCapability(const Object &capability) const
void WaitForOutstandingSpawns()
void set_forward_table_new(WeakTable *table)
int64_t UptimeMicros() const
void UpdateNativeCallableKeepIsolateAliveCounter(intptr_t delta)
ObjectIdRing * EnsureObjectIdRing()
ErrorPtr InvokePendingServiceExtensionCalls()
void MakeRunnableLocked()
DART_WARN_UNUSED_RESULT ErrorPtr StealStickyError()
ErrorPtr PausePostRequest()
static void EnableIsolateCreation()
void AppendServiceExtensionCall(const Instance &closure, const String &method_name, const Array ¶meter_keys, const Array ¶meter_values, const Instance &reply_port, const Instance &id)
IsolateGroup * group() const
void set_current_tag(const UserTag &tag)
Dart_MessageNotifyCallback message_notify_callback() const
InstancePtr LookupServiceExtensionHandler(const String &name)
void set_name(const char *name)
static Dart_IsolateGroupCleanupCallback GroupCleanupCallback()
void FlagsCopyFrom(const Dart_IsolateFlags &api_flags)
void set_finalizers(const GrowableObjectArray &value)
void RemoveExitListener(const SendPort &listener)
uint64_t pause_capability() const
static Isolate * LookupIsolateByPort(Dart_Port port)
bool NotifyErrorListeners(const char *msg, const char *stacktrace)
void init_loaded_prefixes_set_storage()
void set_tag_table(const GrowableObjectArray &value)
friend class IsolateGroup
DeoptContext * deopt_context() const
Thread * mutator_thread() const
void set_default_tag(const UserTag &tag)
void IncrementSpawnCount()
void set_origin_id(Dart_Port id)
void RemoveErrorListener(const SendPort &listener)
void set_message_notify_callback(Dart_MessageNotifyCallback value)
Dart_Port main_port() const
void SetStickyError(ErrorPtr sticky_error)
const char * name() const
bool HasOpenNativeCallables()
void AddValue(bool b) const
void AddProperty64(const char *name, int64_t i) const
void AddProperty(const char *name, bool b) const
void AddServiceId(const Object &o) const
void AddPropertyTimeMillis(const char *name, int64_t millis) const
void AddPropertyF(const char *name, const char *format,...) const PRINTF_ATTRIBUTE(3
static void NotifyAboutIsolateGroupShutdown(const IsolateGroup *isolate_group)
static void SetKernelIsolate(Isolate *isolate)
static uword Hash(const Object &obj)
static bool IsMatch(const Object &a, const Object &b)
static const char * Name()
static bool ReportStats()
FunctionPtr LookupFunctionAllowPrivate(const String &name) const
static LibraryPtr DeveloperLibrary()
static void PrintSizes(Thread *thread)
virtual bool KeepAliveLocked()
void PostMessage(std::unique_ptr< Message > message, bool before_events=false)
bool Run(ThreadPool *pool, StartCallback start_callback, EndCallback end_callback, CallbackData data)
bool is_paused_on_start() const
bool is_paused_on_exit() const
bool should_pause_on_start() const
static std::unique_ptr< Message > New(Args &&... args)
@ kDelayedIsolateLibOOBMsg
static const Dart_Port kIllegalPort
Monitor::WaitResult WaitMicros(int64_t micros=Monitor::kNoTimeout)
Monitor::WaitResult WaitWithSafepointCheck(Thread *thread, int64_t millis=Monitor::kNoTimeout)
Monitor::WaitResult Wait(int64_t millis=Monitor::kNoTimeout)
virtual void OnEnterIdleLocked(MonitorLocker *ml)
bool IsOwnedByCurrentThread() const
static OSThread * Current()
static int64_t GetCurrentTimeMillis()
static int64_t GetCurrentMonotonicMicros()
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static char * SCreate(Zone *zone, const char *format,...) PRINTF_ATTRIBUTE(2
void VisitPointers(ObjectPointerVisitor *visitor)
void clear_gc_root_type()
void set_gc_root_type(const char *gc_root_type)
void VisitPointer(ObjectPtr *p)
void VisitObjectPointers(ObjectPointerVisitor *visitor)
void ClearCanonical() const
intptr_t GetClassId() const
bool InVMIsolateHeap() const
static ObjectPtr RawCast(ObjectPtr obj)
void AbandonMarkingForShutdown()
Monitor * tasks_lock() const
static bool PostMessage(std::unique_ptr< Message > message, bool before_events=false)
static bool ClosePort(Dart_Port id, MessageHandler **message_handler=nullptr)
static void ClosePorts(MessageHandler *handler)
static Dart_Port CreatePort(MessageHandler *handler)
static void IsolateShutdown(Thread *thread)
IsolateGroupReloadContext * group_reload_context()
void set_keep_isolate_alive(bool value) const
void set_is_open(bool value) const
static ReceivePortPtr New(Dart_Port id, const String &debug_name, Heap::Space space=Heap::kNew)
bool keep_isolate_alive() const
static intptr_t MaxMutatorThreadCount()
void set_top_frame(ActivationFrame *frame)
void PrintJSON(JSONStream *js) const
static void SetServiceIsolate(Isolate *isolate)
static void VisitObjectPointers(ObjectPointerVisitor *visitor)
static bool SendIsolateShutdownMessage()
static StreamInfo isolate_stream
static void HandleEvent(ServiceEvent *event, bool enter_safepoint=true)
static StreamInfo debug_stream
static ErrorPtr HandleIsolateMessage(Isolate *isolate, const Array &message)
static void PostError(const String &method_name, const Array ¶meter_keys, const Array ¶meter_values, const Instance &reply_port, const Instance &id, const Error &error)
static SmiPtr New(intptr_t value)
bool Equals(const String &str) const
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
static const char * ToCString(Thread *thread, StringPtr ptr)
static StringPtr FromConcat(Thread *thread, const String &str1, const String &str2)
static void DumpStats(IsolateGroup *isolate_group)
bool ShuttingDownLocked()
bool Run(Args &&... args)
void MarkCurrentWorkerAsBlocked()
void MarkCurrentWorkerAsUnBlocked()
bool TasksWaitingToRunLocked()
void ReleaseStoreBuffers()
void FlushMarkingStacks()
void VisitObjectPointers(IsolateGroup *isolate_group_of_interest, ObjectPointerVisitor *visitor, ValidationPolicy validate_frames)
void AcquireMarkingStacks()
void ReleaseMarkingStacks()
static ThreadState * Current()
void set_execution_state(ExecutionState state)
void ScheduleInterrupts(uword interrupt_bits)
void RememberLiveTemporaries()
bool OwnsSafepoint() const
@ kIncrementalCompactorTask
static Thread * Current()
void VisitObjectPointers(ObjectPointerVisitor *visitor, ValidationPolicy validate_frames)
void set_sticky_error(const Error &value)
static void ExitIsolateGroupAsHelper(bool bypass_safepoint)
bool IsDartMutatorThread() const
Isolate * isolate() const
TaskKind task_kind() const
static void EnterIsolate(Isolate *isolate)
static void ExitIsolate(bool isolate_shutdown=false)
static bool EnterIsolateGroupAsHelper(IsolateGroup *isolate_group, TaskKind kind, bool bypass_safepoint)
void DeferredMarkLiveTemporaries()
static UnwindErrorPtr New(const String &message, Heap::Space space=Heap::kNew)
bool is_user_initiated() const
static char * StrDup(const char *s)
void PrintToJSONObject(JSONObject *obj)
static WeakPropertyPtr New(Heap::Space space=Heap::kNew)
void set_key(const Object &key) const
ElementType * Alloc(intptr_t length)
#define THR_Print(format,...)
#define DART_FLAGS_CURRENT_VERSION
void(* Dart_UnregisterKernelBlobCallback)(const char *kernel_blob_uri)
Dart_Isolate(* Dart_IsolateGroupCreateCallback)(const char *script_uri, const char *main, const char *package_root, const char *package_config, Dart_IsolateFlags *flags, void *isolate_data, char **error)
void(* Dart_IsolateCleanupCallback)(void *isolate_group_data, void *isolate_data)
void(* Dart_MessageNotifyCallback)(Dart_Isolate destination_isolate)
struct _Dart_Handle * Dart_Handle
const char *(* Dart_RegisterKernelBlobCallback)(const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
struct _Dart_Isolate * Dart_Isolate
bool(* Dart_InitializeIsolateCallback)(void **child_isolate_data, char **error)
void(* Dart_IsolateGroupCleanupCallback)(void *isolate_group_data)
void(* Dart_IsolateShutdownCallback)(void *isolate_group_data, void *isolate_data)
#define CHECK_ISOLATE_GROUP(isolate_group)
@ Dart_CObject_kCapability
FlutterSemanticsFlag flags
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const uint8_t uint32_t uint32_t GError ** error
Dart_NativeFunction function
#define BOOL_ISOLATE_FLAG_LIST(V)
#define BOOL_ISOLATE_GROUP_FLAG_LIST(V)
#define RELOAD_OPERATION_SCOPE(thread_expr)
#define ISOLATE_METRIC_LIST(V)
#define ISOLATE_GROUP_METRIC_LIST(V)
sk_sp< const SkImage > image
DART_EXPORT bool Dart_HasServiceMessages()
static const char * ExceptionPauseInfoToServiceEnum(Dart_ExceptionPauseInfo pi)
static void DeterministicModeHandler(bool value)
constexpr intptr_t kMicrosecondsPerMillisecond
ObjectPtr ReadMessage(Thread *thread, Message *message)
DART_EXPORT void Dart_EnterScope()
DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate)
static std::unique_ptr< Message > SerializeMessage(Dart_Port dest_port, const Instance &obj)
constexpr uword kUwordMax
static void ShutdownIsolate(uword parameter)
constexpr intptr_t MBInWords
AsThreadStackResource< RawReloadParticipationScope > ReloadParticipationScope
DEFINE_FLAG(bool, print_cluster_information, false, "Print information about clusters written to snapshot")
const intptr_t kDefaultMaxOldGenHeapSize
DEFINE_FLAG_HANDLER(PrecompilationModeHandler, precompilation, "Precompilation mode")
DART_EXPORT void Dart_ExitScope()
std::unique_ptr< Message > WriteMessage(bool same_group, const Object &obj, Dart_Port dest_port, Message::Priority priority)
static ServiceEvent IsolatePauseEvent(Isolate *isolate)
constexpr intptr_t kWordSize
std::unique_ptr< Message > WriteApiMessage(Zone *zone, Dart_CObject *obj, Dart_Port dest_port, Message::Priority priority)
constexpr double MicrosecondsToMilliseconds(int64_t micros)
static MessageHandler::MessageStatus StoreError(Thread *thread, const Error &error)
DART_EXPORT void Dart_ShutdownIsolate()
NOT_IN_PRODUCT(LibraryPtr ReloadTestScript(const char *script))
DART_EXPORT bool Dart_HandleServiceMessages()
@ kPauseOnUnhandledExceptions
bool IsStringClassId(intptr_t index)
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 port
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 set
std::function< void()> closure
#define ISOLATE_GROUP_SERVICE_ID_FORMAT_STRING
#define ISOLATE_SERVICE_ID_FORMAT_STRING
union _Dart_CObject::@86 value
struct _Dart_CObject::@86::@88 as_capability
struct _Dart_CObject::@86::@89 as_array
struct _Dart_CObject ** values
#define ARRAY_SIZE(array)
#define ISOLATE_METRIC_PRINT(type, variable, name, unit)
#define ISOLATE_METRIC_INIT(type, variable, name, unit)
#define ISOLATE_GROUP_METRIC_PRINT(type, variable, name, unit)
#define SET_FROM_FLAG(when, name, bitname, isolate_flag, flag)
#define ISOLATE_GROUP_METRIC_CONSTRUCTORS(type, variable, name, unit)
#define INIT_FROM_FLAG(when, name, bitname, isolate_flag, flag)
#define ISOLATE_METRIC_CONSTRUCTORS(type, variable, name, unit)
#define ADD_ISOLATE_FLAGS(when, name, bitname, isolate_flag_name, flag_name)
#define INIT_FROM_FIELD(when, name, bitname, isolate_flag, flag)