Flutter Engine
The Flutter Engine
isolate.h
Go to the documentation of this file.
1// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_ISOLATE_H_
6#define RUNTIME_VM_ISOLATE_H_
7
8#if defined(SHOULD_NOT_INCLUDE_RUNTIME)
9#error "Should not include runtime"
10#endif
11
12#include <functional>
13#include <memory>
14#include <utility>
15
16#include "include/dart_api.h"
17#include "platform/assert.h"
18#include "platform/atomic.h"
19#include "vm/base_isolate.h"
20#include "vm/class_table.h"
21#include "vm/dispatch_table.h"
22#include "vm/exceptions.h"
24#include "vm/field_table.h"
25#include "vm/fixed_cache.h"
26#include "vm/growable_array.h"
27#include "vm/handles.h"
28#include "vm/heap/verifier.h"
29#include "vm/intrusive_dlist.h"
31#include "vm/metrics.h"
32#include "vm/os_thread.h"
33#include "vm/random.h"
34#include "vm/tags.h"
35#include "vm/thread.h"
36#include "vm/thread_pool.h"
38#include "vm/token_position.h"
39#include "vm/virtual_memory.h"
40
41namespace dart {
42
43// Forward declarations.
44class ApiState;
45class BackgroundCompiler;
46class Become;
47class Capability;
48class CodeIndexTable;
49class Debugger;
50class DeoptContext;
51class ExternalTypedData;
52class GroupDebugger;
53class HandleScope;
54class HandleVisitor;
55class Heap;
56class ICData;
57class IsolateGroupReloadContext;
58class IsolateMessageHandler;
59class IsolateObjectStore;
60class IsolateProfilerData;
61class Log;
62class Message;
63class MessageHandler;
64class MonitorLocker;
65class Mutex;
66class Object;
67class ObjectIdRing;
68class ObjectPointerVisitor;
69class ObjectStore;
70class PersistentHandle;
71class ProgramReloadContext;
72class RwLock;
73class SafepointHandler;
74class SafepointRwLock;
75class SampleBlock;
76class SampleBlockBuffer;
77class SampleBuffer;
78class SendPort;
79class SerializedObjectBuffer;
80class ServiceIdZone;
81class Simulator;
82class StackResource;
83class StackZone;
84class StoreBuffer;
85class StubCode;
86class ThreadRegistry;
87class UserTag;
88class WeakTable;
89
91 public:
93 virtual ~IsolateVisitor() {}
94
95 virtual void VisitIsolate(Isolate* isolate) = 0;
96
97 protected:
98 // Returns true if |isolate| is the VM or service isolate.
99 bool IsSystemIsolate(Isolate* isolate) const;
100
101 private:
102 DISALLOW_COPY_AND_ASSIGN(IsolateVisitor);
103};
104
105class Callable : public ValueObject {
106 public:
108 virtual ~Callable() {}
109
110 virtual void Call() = 0;
111
112 private:
113 DISALLOW_COPY_AND_ASSIGN(Callable);
114};
115
116template <typename T>
117class LambdaCallable : public Callable {
118 public:
119 explicit LambdaCallable(T& lambda) : lambda_(lambda) {}
120 void Call() { lambda_(); }
121
122 private:
123 T& lambda_;
124 DISALLOW_COPY_AND_ASSIGN(LambdaCallable);
125};
126
127// Fixed cache for exception handler lookup.
129// Fixed cache for catch entry state lookup.
131
132// List of Isolate group flags.
133//
134// V(when, name, bit-name, Dart_IsolateFlags-name, command-line-flag-name)
135//
136#define BOOL_ISOLATE_GROUP_FLAG_LIST(V) \
137 V(PRECOMPILER, obfuscate, Obfuscate, obfuscate, false) \
138 V(NONPRODUCT, asserts, EnableAsserts, enable_asserts, FLAG_enable_asserts) \
139 V(NONPRODUCT, use_field_guards, UseFieldGuards, use_field_guards, \
140 FLAG_use_field_guards) \
141 V(PRODUCT, should_load_vmservice_library, ShouldLoadVmService, \
142 load_vmservice_library, false) \
143 V(NONPRODUCT, use_osr, UseOsr, use_osr, FLAG_use_osr) \
144 V(NONPRODUCT, snapshot_is_dontneed_safe, SnapshotIsDontNeedSafe, \
145 snapshot_is_dontneed_safe, false) \
146 V(NONPRODUCT, branch_coverage, BranchCoverage, branch_coverage, \
147 FLAG_branch_coverage) \
148 V(NONPRODUCT, coverage, Coverage, coverage, FLAG_coverage)
149
150// List of Isolate flags with corresponding members of Dart_IsolateFlags and
151// corresponding global command line flags.
152#define BOOL_ISOLATE_FLAG_LIST(V) \
153 V(NONPRODUCT, is_system_isolate, IsSystemIsolate, is_system_isolate, false) \
154 V(NONPRODUCT, is_service_isolate, IsServiceIsolate, is_service_isolate, \
155 false) \
156 V(NONPRODUCT, is_kernel_isolate, IsKernelIsolate, is_kernel_isolate, false)
157
158// Represents the information used for spawning the first isolate within an
159// isolate group. All isolates within a group will refer to this
160// [IsolateGroupSource].
162 public:
164 const char* name,
165 const uint8_t* snapshot_data,
166 const uint8_t* snapshot_instructions,
167 const uint8_t* kernel_buffer,
168 intptr_t kernel_buffer_size,
170 : script_uri(script_uri == nullptr ? nullptr : Utils::StrDup(script_uri)),
171 name(Utils::StrDup(name)),
176 flags(flags),
177 script_kernel_buffer(nullptr),
179 loaded_blobs_(nullptr),
180 num_blob_loads_(0) {}
182 free(script_uri);
183 free(name);
184 }
185
186 void add_loaded_blob(Zone* zone_,
187 const ExternalTypedData& external_typed_data);
188
189 // The arguments used for spawning in
190 // `Dart_CreateIsolateGroupFromKernel` / `Dart_CreateIsolate`.
192 char* name;
193 const uint8_t* snapshot_data;
194 const uint8_t* snapshot_instructions;
195 const uint8_t* kernel_buffer;
196 const intptr_t kernel_buffer_size;
198
199 // The kernel buffer used in `Dart_LoadScriptFromKernel`.
200 const uint8_t* script_kernel_buffer;
202
203 // List of weak pointers to external typed data for loaded blobs.
206};
207
208// Tracks idle time and notifies heap when idle time expired.
210 public:
212
213 // Initializes the idle time handler with the given [heap], to which
214 // idle notifications will be sent.
215 void InitializeWithHeap(Heap* heap);
216
217 // Returns whether the caller should check for idle timeouts.
218 bool ShouldCheckForIdle();
219
220 // Declares that the idle time should be reset to now.
221 void UpdateStartIdleTime();
222
223 // Returns whether idle time expired and [NotifyIdle] should be called.
224 bool ShouldNotifyIdle(int64_t* expiry);
225
226 // Notifies the heap that now is a good time to do compactions and indicates
227 // we have time for the GC until [deadline].
228 void NotifyIdle(int64_t deadline);
229
230 // Calls [NotifyIdle] with the default deadline.
232
233 private:
235
236 Mutex mutex_;
237 Heap* heap_ = nullptr;
238 intptr_t disabled_counter_ = 0;
239 int64_t idle_start_time_ = 0;
240};
241
242// Disables firing of the idle timer while this object is alive.
244 public:
245 explicit DisableIdleTimerScope(IdleTimeHandler* handler);
247
248 private:
249 IdleTimeHandler* handler_;
250};
251
253 public:
254 MutatorThreadPool(IsolateGroup* isolate_group, intptr_t max_pool_size)
255 : ThreadPool(max_pool_size), isolate_group_(isolate_group) {}
257
258 protected:
259 virtual void OnEnterIdleLocked(MonitorLocker* ml);
260
261 private:
262 void NotifyIdle();
263
264 IsolateGroup* isolate_group_ = nullptr;
265};
266
267// Represents an isolate group and is shared among all isolates within a group.
268class IsolateGroup : public IntrusiveDListEntry<IsolateGroup> {
269 public:
270 IsolateGroup(std::shared_ptr<IsolateGroupSource> source,
271 void* embedder_data,
273 Dart_IsolateFlags api_flags,
274 bool is_vm_isolate);
275 IsolateGroup(std::shared_ptr<IsolateGroupSource> source,
276 void* embedder_data,
277 Dart_IsolateFlags api_flags,
278 bool is_vm_isolate);
280
282#if defined(DEBUG)
283 void ValidateClassTable();
284#endif
285
286 IsolateGroupSource* source() const { return source_.get(); }
287 std::shared_ptr<IsolateGroupSource> shareable_source() const {
288 return source_;
289 }
290 bool is_vm_isolate() const { return is_vm_isolate_; }
291 void* embedder_data() const { return embedder_data_; }
292
293 bool initial_spawn_successful() { return initial_spawn_successful_; }
294 void set_initial_spawn_successful() { initial_spawn_successful_ = true; }
295
296 Heap* heap() const { return heap_.get(); }
297
299#if defined(DART_PRECOMPILED_RUNTIME)
300 return nullptr;
301#else
302 return background_compiler_.get();
303#endif
304 }
305#if !defined(DART_PRECOMPILED_RUNTIME)
307 if (IsSystemIsolateGroup(this)) {
309 }
310 return FLAG_optimization_counter_threshold;
311 }
312#endif
313
314#if !defined(PRODUCT)
315 GroupDebugger* debugger() const { return debugger_; }
316#endif
317
318 IdleTimeHandler* idle_time_handler() { return &idle_time_handler_; }
319
320 // Returns true if this is the first isolate registered.
321 void RegisterIsolate(Isolate* isolate);
322 void UnregisterIsolate(Isolate* isolate);
323 // Returns `true` if this was the last isolate and the caller is responsible
324 // for deleting the isolate group.
326
328
329 void RunWithLockedGroup(std::function<void()> fun);
330
331 void ScheduleInterrupts(uword interrupt_bits);
332
333 ThreadRegistry* thread_registry() const { return thread_registry_.get(); }
334 SafepointHandler* safepoint_handler() { return safepoint_handler_.get(); }
335
336 void CreateHeap(bool is_vm_isolate, bool is_service_or_kernel_isolate);
337 void SetupImagePage(const uint8_t* snapshot_buffer, bool is_executable);
338 void Shutdown();
339
340#define ISOLATE_METRIC_ACCESSOR(type, variable, name, unit) \
341 type* Get##variable##Metric() { return &metric_##variable##_; }
343#undef ISOLATE_METRIC_ACCESSOR
344
345#if !defined(PRODUCT)
347 last_allocationprofile_accumulator_reset_timestamp_ =
349 }
350
352 return last_allocationprofile_accumulator_reset_timestamp_;
353 }
354
356 last_allocationprofile_gc_timestamp_ = OS::GetCurrentTimeMillis();
357 }
358
360 return last_allocationprofile_gc_timestamp_;
361 }
362#endif // !defined(PRODUCT)
363
364 DispatchTable* dispatch_table() const { return dispatch_table_.get(); }
366 dispatch_table_.reset(table);
367 }
368 const uint8_t* dispatch_table_snapshot() const {
369 return dispatch_table_snapshot_;
370 }
371 void set_dispatch_table_snapshot(const uint8_t* snapshot) {
372 dispatch_table_snapshot_ = snapshot;
373 }
375 return dispatch_table_snapshot_size_;
376 }
378 dispatch_table_snapshot_size_ = size;
379 }
380
382 return &class_table_allocator_;
383 }
384
385 static intptr_t class_table_offset() {
386 COMPILE_ASSERT(sizeof(IsolateGroup::class_table_) == kWordSize);
387 return OFFSET_OF(IsolateGroup, class_table_);
388 }
389
391 return cached_class_table_table_.load();
392 }
394 cached_class_table_table_.store(cached_class_table_table);
395 }
397 COMPILE_ASSERT(sizeof(IsolateGroup::cached_class_table_table_) ==
398 kWordSize);
399 return OFFSET_OF(IsolateGroup, cached_class_table_table_);
400 }
401
403 static intptr_t object_store_offset() {
404 COMPILE_ASSERT(sizeof(IsolateGroup::object_store_) == kWordSize);
405 return OFFSET_OF(IsolateGroup, object_store_);
406 }
407
408 void set_obfuscation_map(const char** map) { obfuscation_map_ = map; }
409 const char** obfuscation_map() const { return obfuscation_map_; }
410
411 Random* random() { return &random_; }
412
413 bool is_system_isolate_group() const { return is_system_isolate_group_; }
414
415 // IsolateGroup-specific flag handling.
416 static void FlagsInitialize(Dart_IsolateFlags* api_flags);
417 void FlagsCopyTo(Dart_IsolateFlags* api_flags);
418 void FlagsCopyFrom(const Dart_IsolateFlags& api_flags);
419
420#if defined(DART_PRECOMPILER)
421#define FLAG_FOR_PRECOMPILER(from_field, from_flag) (from_field)
422#else
423#define FLAG_FOR_PRECOMPILER(from_field, from_flag) (from_flag)
424#endif
425
426#if !defined(PRODUCT)
427#define FLAG_FOR_NONPRODUCT(from_field, from_flag) (from_field)
428#else
429#define FLAG_FOR_NONPRODUCT(from_field, from_flag) (from_flag)
430#endif
431
432#define FLAG_FOR_PRODUCT(from_field, from_flag) (from_field)
433
434#define DECLARE_GETTER(when, name, bitname, isolate_flag_name, flag_name) \
435 bool name() const { \
436 return FLAG_FOR_##when(bitname##Bit::decode(isolate_group_flags_), \
437 flag_name); \
438 }
440#undef FLAG_FOR_NONPRODUCT
441#undef FLAG_FOR_PRECOMPILER
442#undef FLAG_FOR_PRODUCT
443#undef DECLARE_GETTER
444
446 return ShouldLoadVmServiceBit::decode(isolate_group_flags_);
447 }
449 isolate_group_flags_ =
450 ShouldLoadVmServiceBit::update(value, isolate_group_flags_);
451 }
452
453 void set_asserts(bool value) {
454 isolate_group_flags_ =
455 EnableAssertsBit::update(value, isolate_group_flags_);
456 }
457
459 isolate_group_flags_ =
460 BranchCoverageBit::update(value, isolate_group_flags_);
461 }
462
463 void set_coverage(bool value) {
464 isolate_group_flags_ = CoverageBit::update(value, isolate_group_flags_);
465 }
466
467#if !defined(PRODUCT)
468#if !defined(DART_PRECOMPILED_RUNTIME)
469 bool HasAttemptedReload() const {
470 return HasAttemptedReloadBit::decode(isolate_group_flags_);
471 }
473 isolate_group_flags_ =
474 HasAttemptedReloadBit::update(value, isolate_group_flags_);
475 }
478 return reload_every_n_stack_overflow_checks_;
479 }
480#else
481 bool HasAttemptedReload() const { return false; }
482#endif // !defined(DART_PRECOMPILED_RUNTIME)
483#endif // !defined(PRODUCT)
484
485#if defined(PRODUCT)
486 void set_use_osr(bool use_osr) { ASSERT(!use_osr); }
487#else // defined(PRODUCT)
488 void set_use_osr(bool use_osr) {
489 isolate_group_flags_ = UseOsrBit::update(use_osr, isolate_group_flags_);
490 }
491#endif // defined(PRODUCT)
492
493 // Class table for the program loaded into this isolate group.
494 //
495 // This table is modified by kernel loading.
496 ClassTable* class_table() const { return class_table_; }
497
498 // Class table used for heap walks by GC visitors. Usually it
499 // is the same table as one in |class_table_|, except when in the
500 // middle of the reload.
501 //
502 // See comment for |ClassTable| class for more details.
503 ClassTable* heap_walk_class_table() const { return heap_walk_class_table_; }
504
508
509 StoreBuffer* store_buffer() const { return store_buffer_.get(); }
510 ObjectStore* object_store() const { return object_store_.get(); }
511 Mutex* symbols_mutex() { return &symbols_mutex_; }
512 Mutex* type_canonicalization_mutex() { return &type_canonicalization_mutex_; }
514 return &type_arguments_canonicalization_mutex_;
515 }
516 Mutex* subtype_test_cache_mutex() { return &subtype_test_cache_mutex_; }
517 Mutex* megamorphic_table_mutex() { return &megamorphic_table_mutex_; }
518 Mutex* type_feedback_mutex() { return &type_feedback_mutex_; }
519 Mutex* patchable_call_mutex() { return &patchable_call_mutex_; }
521 return &constant_canonicalization_mutex_;
522 }
523 Mutex* kernel_data_lib_cache_mutex() { return &kernel_data_lib_cache_mutex_; }
525 return &kernel_data_class_cache_mutex_;
526 }
527 Mutex* kernel_constants_mutex() { return &kernel_constants_mutex_; }
528
529#if defined(DART_PRECOMPILED_RUNTIME)
530 Mutex* unlinked_call_map_mutex() { return &unlinked_call_map_mutex_; }
531#endif
532
533#if !defined(DART_PRECOMPILED_RUNTIME)
534 Mutex* initializer_functions_mutex() { return &initializer_functions_mutex_; }
535#endif // !defined(DART_PRECOMPILED_RUNTIME)
536
537 SafepointRwLock* program_lock() { return program_lock_.get(); }
538
539 static inline IsolateGroup* Current() {
540 Thread* thread = Thread::Current();
541 return thread == nullptr ? nullptr : thread->isolate_group();
542 }
543
544 void IncreaseMutatorCount(Isolate* mutator, bool is_nested_reenter);
545 void DecreaseMutatorCount(Isolate* mutator, bool is_nested_exit);
546 intptr_t MutatorCount() const {
547 MonitorLocker ml(active_mutators_monitor_.get());
548 return active_mutators_;
549 }
550
551 bool HasTagHandler() const { return library_tag_handler() != nullptr; }
553 const Object& arg1,
554 const Object& arg2);
556 return library_tag_handler_;
557 }
559 library_tag_handler_ = handler;
560 }
562 return deferred_load_handler_;
563 }
565 deferred_load_handler_ = handler;
566 }
567
568 // Prepares all threads in an isolate for Garbage Collection.
569 void ReleaseStoreBuffers();
570 void FlushMarkingStacks();
575
576 MarkingStack* old_marking_stack() const { return old_marking_stack_; }
577 MarkingStack* new_marking_stack() const { return new_marking_stack_; }
579 return deferred_marking_stack_;
580 }
581
582 // Runs the given [function] on every isolate in the isolate group.
583 //
584 // During the duration of this function, no new isolates can be added or
585 // removed.
586 //
587 // If [at_safepoint] is `true`, then the entire isolate group must be in a
588 // safepoint. There is therefore no reason to guard against other threads
589 // adding/removing isolates, so no locks will be held.
590 void ForEachIsolate(std::function<void(Isolate* isolate)> function,
591 bool at_safepoint = false);
592 Isolate* FirstIsolate() const;
594
595 // Ensures mutators are stopped during execution of the provided function.
596 //
597 // If the current thread is the only mutator in the isolate group,
598 // [single_current_mutator] will be called. Otherwise [otherwise] will be
599 // called inside a [SafepointOperationsScope] (or
600 // [ForceGrowthSafepointOperationScope] if [use_force_growth_in_otherwise]
601 // is set).
602 //
603 // During the duration of this function, no new isolates can be added to the
604 // isolate group.
606 Callable* single_current_mutator,
607 Callable* otherwise,
608 bool use_force_growth_in_otherwise = false);
609
610 template <typename T, typename S>
611 void RunWithStoppedMutators(T single_current_mutator,
612 S otherwise,
613 bool use_force_growth_in_otherwise = false) {
614 LambdaCallable<T> single_callable(single_current_mutator);
615 LambdaCallable<S> otherwise_callable(otherwise);
616 RunWithStoppedMutatorsCallable(&single_callable, &otherwise_callable,
617 use_force_growth_in_otherwise);
618 }
619
620 template <typename T>
621 void RunWithStoppedMutators(T function, bool use_force_growth = false) {
622 LambdaCallable<T> callable(function);
623 RunWithStoppedMutatorsCallable(&callable, &callable, use_force_growth);
624 }
625
626#ifndef PRODUCT
627 void PrintJSON(JSONStream* stream, bool ref = true);
628 void PrintToJSONObject(JSONObject* jsobj, bool ref);
629
630 // Creates an object with the total heap memory usage statistics for this
631 // isolate group.
633#endif
634
635#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
636 // By default the reload context is deleted. This parameter allows
637 // the caller to delete is separately if it is still needed.
639 bool force_reload,
640 const char* root_script_url = nullptr,
641 const char* packages_url = nullptr,
642 bool dont_delete_reload_context = false);
643
644 // If provided, the VM takes ownership of kernel_buffer.
646 bool force_reload,
647 const uint8_t* kernel_buffer = nullptr,
648 intptr_t kernel_buffer_size = 0,
649 bool dont_delete_reload_context = false);
650
652 last_reload_timestamp_ = value;
653 }
654 int64_t last_reload_timestamp() const { return last_reload_timestamp_; }
655
657 return group_reload_context_.get();
658 }
660 return program_reload_context_;
661 }
662
663 void DeleteReloadContext();
664 bool CanReload();
665#else
666 bool CanReload() { return false; }
667#endif // !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
668
669 bool IsReloading() const {
670#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
671 return group_reload_context_ != nullptr;
672#else
673 return false;
674#endif
675 }
676
677 Become* become() const { return become_; }
678 void set_become(Become* become) { become_ = become; }
679
680 uint64_t id() const { return id_; }
681
682 static void Init();
683 static void Cleanup();
684
685 static void ForEach(std::function<void(IsolateGroup*)> action);
686 static void RunWithIsolateGroup(uint64_t id,
688 std::function<void()> not_found);
689
690 // Manage list of existing isolate groups.
691 static void RegisterIsolateGroup(IsolateGroup* isolate_group);
692 static void UnregisterIsolateGroup(IsolateGroup* isolate_group);
693
694 static bool HasApplicationIsolateGroups();
695 static bool HasOnlyVMIsolateGroup();
696 static bool IsSystemIsolateGroup(const IsolateGroup* group);
697
698 int64_t UptimeMicros() const;
699
700 ApiState* api_state() const { return api_state_.get(); }
701
702 // Visit all object pointers. Caller must ensure concurrent sweeper is not
703 // running, and the visitor must not allocate.
705 ValidationPolicy validate_frames);
708 ValidationPolicy validate_frames);
711
712 // In precompilation we finalize all regular classes before compiling.
714 return AllClassesFinalizedBit::decode(isolate_group_flags_);
715 }
717 isolate_group_flags_ =
718 AllClassesFinalizedBit::update(value, isolate_group_flags_);
719 }
721 return HasDynamicallyExtendableClassesBit::decode(isolate_group_flags_);
722 }
724 isolate_group_flags_ =
725 HasDynamicallyExtendableClassesBit::update(value, isolate_group_flags_);
726 }
727
728 bool remapping_cids() const {
729 return RemappingCidsBit::decode(isolate_group_flags_);
730 }
732 isolate_group_flags_ =
733 RemappingCidsBit::update(value, isolate_group_flags_);
734 }
735
738
739 ArrayPtr saved_unlinked_calls() const { return saved_unlinked_calls_; }
741
742 FieldTable* initial_field_table() const { return initial_field_table_.get(); }
743 std::shared_ptr<FieldTable> initial_field_table_shareable() {
744 return initial_field_table_;
745 }
746 void set_initial_field_table(std::shared_ptr<FieldTable> field_table) {
747 initial_field_table_ = field_table;
748 }
749
751 return shared_initial_field_table_.get();
752 }
753 std::shared_ptr<FieldTable> shared_initial_field_table_shareable() {
754 return shared_initial_field_table_;
755 }
756 void set_shared_initial_field_table(std::shared_ptr<FieldTable> field_table) {
757 shared_initial_field_table_ = field_table;
758 }
759
760 FieldTable* shared_field_table() const { return shared_field_table_.get(); }
761 std::shared_ptr<FieldTable> shared_field_table_shareable() {
762 return shared_field_table_;
763 }
765 shared_field_table_.reset(shared_field_table);
766 T->shared_field_table_values_ = shared_field_table->table();
767 }
768
769 MutatorThreadPool* thread_pool() { return thread_pool_.get(); }
770
771 void RegisterClass(const Class& cls);
772 void RegisterSharedStaticField(const Field& field,
773 const Object& initial_value);
774 void RegisterStaticField(const Field& field, const Object& initial_value);
775 void FreeStaticField(const Field& field);
776
778 static void ExitTemporaryIsolate();
779
781 native_assets_api_ = *native_assets_api;
782 }
783 NativeAssetsApi* native_assets_api() { return &native_assets_api_; }
784
785 private:
786 friend class Dart; // For `object_store_ = ` in Dart::Init
787 friend class Heap;
788 friend class StackFrame; // For `[isolates_].First()`.
789 // For `object_store_shared_untag()`, `class_table_shared_untag()`
790 friend class Isolate;
791
792#define ISOLATE_GROUP_FLAG_BITS(V) \
793 V(AllClassesFinalized) \
794 V(EnableAsserts) \
795 V(HasAttemptedReload) \
796 V(RemappingCids) \
797 V(ShouldLoadVmService) \
798 V(Obfuscate) \
799 V(UseFieldGuards) \
800 V(UseOsr) \
801 V(SnapshotIsDontNeedSafe) \
802 V(BranchCoverage) \
803 V(Coverage) \
804 V(HasDynamicallyExtendableClasses)
805
806 // Isolate group specific flags.
807 enum FlagBits {
808#define DECLARE_BIT(Name) k##Name##Bit,
810#undef DECLARE_BIT
811 };
812
813#define DECLARE_BITFIELD(Name) \
814 class Name##Bit : public BitField<uint32_t, bool, k##Name##Bit, 1> {};
816#undef DECLARE_BITFIELD
817
818 void set_heap(std::unique_ptr<Heap> value);
819
820 // Accessed from generated code.
821 ClassTable* class_table_;
822 AcqRelAtomic<ClassPtr*> cached_class_table_table_;
823 std::unique_ptr<ObjectStore> object_store_;
824 // End accessed from generated code.
825
826 ClassTableAllocator class_table_allocator_;
827 ClassTable* heap_walk_class_table_;
828
829 const char** obfuscation_map_ = nullptr;
830
831 bool is_vm_isolate_ = false;
832 void* embedder_data_ = nullptr;
833
834 IdleTimeHandler idle_time_handler_;
835 std::unique_ptr<MutatorThreadPool> thread_pool_;
836 std::unique_ptr<SafepointRwLock> isolates_lock_;
837 IntrusiveDList<Isolate> isolates_;
838 intptr_t isolate_count_ = 0;
839 bool initial_spawn_successful_ = false;
840 Dart_LibraryTagHandler library_tag_handler_ = nullptr;
841 Dart_DeferredLoadHandler deferred_load_handler_ = nullptr;
842 int64_t start_time_micros_;
843 bool is_system_isolate_group_;
844 Random random_;
845
846#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
847 int64_t last_reload_timestamp_;
848 std::shared_ptr<IsolateGroupReloadContext> group_reload_context_;
849 // Per-isolate-group copy of FLAG_reload_every.
850 RelaxedAtomic<intptr_t> reload_every_n_stack_overflow_checks_;
851 ProgramReloadContext* program_reload_context_ = nullptr;
852#endif
853 Become* become_ = nullptr;
854
855#define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \
856 type metric_##variable##_;
858#undef ISOLATE_METRIC_VARIABLE
859
860#if !defined(PRODUCT)
861 // Timestamps of last operation via service.
862 int64_t last_allocationprofile_accumulator_reset_timestamp_ = 0;
863 int64_t last_allocationprofile_gc_timestamp_ = 0;
864
865#endif // !defined(PRODUCT)
866
867 MarkingStack* old_marking_stack_ = nullptr;
868 MarkingStack* new_marking_stack_ = nullptr;
869 MarkingStack* deferred_marking_stack_ = nullptr;
870 std::shared_ptr<IsolateGroupSource> source_;
871 std::unique_ptr<ApiState> api_state_;
872 std::unique_ptr<ThreadRegistry> thread_registry_;
873 std::unique_ptr<SafepointHandler> safepoint_handler_;
874
875 static RwLock* isolate_groups_rwlock_;
876 static IntrusiveDList<IsolateGroup>* isolate_groups_;
877 static Random* isolate_group_random_;
878
879 uint64_t id_ = 0;
880
881 std::unique_ptr<StoreBuffer> store_buffer_;
882 std::unique_ptr<Heap> heap_;
883 std::unique_ptr<DispatchTable> dispatch_table_;
884 const uint8_t* dispatch_table_snapshot_ = nullptr;
885 intptr_t dispatch_table_snapshot_size_ = 0;
886 ArrayPtr saved_unlinked_calls_;
887 std::shared_ptr<FieldTable> initial_field_table_;
888 std::shared_ptr<FieldTable> shared_initial_field_table_;
889 std::shared_ptr<FieldTable> shared_field_table_;
890 uint32_t isolate_group_flags_ = 0;
891
892 NOT_IN_PRECOMPILED(std::unique_ptr<BackgroundCompiler> background_compiler_);
893
894 Mutex symbols_mutex_;
895 Mutex type_canonicalization_mutex_;
896 Mutex type_arguments_canonicalization_mutex_;
897 Mutex subtype_test_cache_mutex_;
898 Mutex megamorphic_table_mutex_;
899 Mutex type_feedback_mutex_;
900 Mutex patchable_call_mutex_;
901 Mutex constant_canonicalization_mutex_;
902 Mutex kernel_data_lib_cache_mutex_;
903 Mutex kernel_data_class_cache_mutex_;
904 Mutex kernel_constants_mutex_;
905
906#if defined(DART_PRECOMPILED_RUNTIME)
907 Mutex unlinked_call_map_mutex_;
908#endif
909
910#if !defined(DART_PRECOMPILED_RUNTIME)
911 Mutex initializer_functions_mutex_;
912#endif // !defined(DART_PRECOMPILED_RUNTIME)
913
914 // Protect access to boxed_field_list_.
915 Mutex field_list_mutex_;
916 // List of fields that became boxed and that trigger deoptimization.
917 GrowableObjectArrayPtr boxed_field_list_;
918
919 // Ensures synchronized access to classes functions, fields and other
920 // program structure elements to accommodate concurrent modification done
921 // by multiple isolates and background compiler.
922 std::unique_ptr<SafepointRwLock> program_lock_;
923
924 // Allow us to ensure the number of active mutators is limited by a maximum.
925 std::unique_ptr<Monitor> active_mutators_monitor_;
926 intptr_t active_mutators_ = 0;
927 intptr_t waiting_mutators_ = 0;
928 intptr_t max_active_mutators_ = 0;
929
930 NOT_IN_PRODUCT(GroupDebugger* debugger_ = nullptr);
931
932 NativeAssetsApi native_assets_api_;
933};
934
935// When an isolate sends-and-exits this class represent things that it passed
936// to the beneficiary.
937class Bequest {
938 public:
940 : handle_(handle), beneficiary_(beneficiary) {}
941 ~Bequest();
942
943 PersistentHandle* handle() { return handle_; }
945 auto handle = handle_;
946 handle_ = nullptr;
947 return handle;
948 }
949 Dart_Port beneficiary() { return beneficiary_; }
950
951 private:
952 PersistentHandle* handle_;
953 Dart_Port beneficiary_;
954};
955
956class Isolate : public BaseIsolate, public IntrusiveDListEntry<Isolate> {
957 public:
958 // Keep both these enums in sync with isolate_patch.dart.
959 // The different Isolate API message types.
960 enum LibMsgId {
970
971 // Internal message ids.
972 kInterruptMsg = 10, // Break in the debugger.
973 kInternalKillMsg = 11, // Like kill, but does not run exit listeners, etc.
974 kDrainServiceExtensionsMsg = 12, // Invoke pending service extensions
975 kCheckForReload = 13, // Participate in other isolate group reload.
976 };
977 // The different Isolate API message priorities for ping and kill messages.
982 };
983
984 ~Isolate();
985
986 static inline Isolate* Current() {
987 Thread* thread = Thread::Current();
988 return thread == nullptr ? nullptr : thread->isolate();
989 }
990
991 bool IsScheduled() { return scheduled_mutator_thread() != nullptr; }
993
995
997 return group()->safepoint_handler();
998 }
999
1000 FieldTable* field_table() const { return field_table_; }
1002 delete field_table_;
1003 field_table_ = field_table;
1004 T->field_table_values_ = field_table->table();
1005 }
1006
1008 return isolate_object_store_.get();
1009 }
1010
1012 return message_notify_callback_.load(std::memory_order_relaxed);
1013 }
1014
1016 message_notify_callback_.store(value, std::memory_order_release);
1017 }
1018
1020 on_shutdown_callback_ = value;
1021 }
1023 return on_shutdown_callback_;
1024 }
1026 on_cleanup_callback_ = value;
1027 }
1029 return on_cleanup_callback_;
1030 }
1031
1032 void bequeath(std::unique_ptr<Bequest> bequest) {
1033 bequest_ = std::move(bequest);
1034 }
1035
1036 IsolateGroupSource* source() const { return isolate_group_->source(); }
1037 IsolateGroup* group() const { return isolate_group_; }
1038
1039 bool HasPendingMessages();
1040
1041 Thread* mutator_thread() const;
1042
1043 const char* name() const { return name_; }
1044 void set_name(const char* name);
1045
1046 int64_t UptimeMicros() const;
1047
1048 Dart_Port main_port() const { return main_port_; }
1050 ASSERT(main_port_ == 0); // Only set main port once.
1051 main_port_ = port;
1052 }
1054 void set_origin_id(Dart_Port id);
1055 void set_pause_capability(uint64_t value) { pause_capability_ = value; }
1056 uint64_t pause_capability() const { return pause_capability_; }
1058 terminate_capability_ = value;
1059 }
1060 uint64_t terminate_capability() const { return terminate_capability_; }
1061
1062 void SendInternalLibMessage(LibMsgId msg_id, uint64_t capability);
1064 LibMsgId msg_id,
1065 uint64_t capability);
1066
1067 void set_init_callback_data(void* value) { init_callback_data_ = value; }
1068 void* init_callback_data() const { return init_callback_data_; }
1069
1071 static intptr_t finalizers_offset() {
1072 return OFFSET_OF(Isolate, finalizers_);
1073 }
1074
1076 return environment_callback_;
1077 }
1079 environment_callback_ = value;
1080 }
1081
1083 return group()->deferred_load_handler() != nullptr;
1084 }
1086
1087 void ScheduleInterrupts(uword interrupt_bits);
1088
1089 const char* MakeRunnable();
1090 void MakeRunnableLocked();
1091 void Run();
1092
1094
1095 bool is_runnable() const { return LoadIsolateFlagsBit<IsRunnableBit>(); }
1097 UpdateIsolateFlagsBit<IsRunnableBit>(value);
1098#if !defined(PRODUCT)
1099 if (is_runnable()) {
1101 }
1102#endif
1103 }
1104
1105 Mutex* mutex() { return &mutex_; }
1106
1107#if !defined(PRODUCT)
1108 Debugger* debugger() const { return debugger_; }
1109
1110 // Returns the current SampleBlock used to track CPU profiling samples.
1111 SampleBlock* current_sample_block() const { return current_sample_block_; }
1113 current_sample_block_ = block;
1114 }
1116
1117 // Returns the current SampleBlock used to track Dart allocation samples.
1119 return current_allocation_sample_block_;
1120 }
1122 current_allocation_sample_block_ = block;
1123 }
1124
1126 return has_completed_blocks_.exchange(0) != 0;
1127 }
1129 return has_completed_blocks_.exchange(1) == 0;
1130 }
1131
1132 void set_single_step(bool value) { single_step_ = value; }
1133 bool single_step() const { return single_step_; }
1134 static intptr_t single_step_offset() {
1135 return OFFSET_OF(Isolate, single_step_);
1136 }
1137
1139 has_resumption_breakpoints_ = value;
1140 }
1142 return has_resumption_breakpoints_;
1143 }
1145 return OFFSET_OF(Isolate, has_resumption_breakpoints_);
1146 }
1147
1148 bool ResumeRequest() const { return LoadIsolateFlagsBit<ResumeRequestBit>(); }
1149 // Lets the embedder know that a service message resulted in a resume request.
1151 UpdateIsolateFlagsBit<ResumeRequestBit>(true);
1153 }
1154
1156 last_resume_timestamp_ = OS::GetCurrentTimeMillis();
1157 }
1158
1159 int64_t last_resume_timestamp() const { return last_resume_timestamp_; }
1160
1161 // Returns whether the vm service has requested that the debugger
1162 // resume execution.
1164 return UpdateIsolateFlagsBit<ResumeRequestBit>(false);
1165 }
1166#endif
1167
1168 // Verify that the sender has the capability to pause or terminate the
1169 // isolate.
1170 bool VerifyPauseCapability(const Object& capability) const;
1171 bool VerifyTerminateCapability(const Object& capability) const;
1172
1173 // Returns true if the capability was added or removed from this isolate's
1174 // list of pause events.
1175 bool AddResumeCapability(const Capability& capability);
1176 bool RemoveResumeCapability(const Capability& capability);
1177
1178 void AddExitListener(const SendPort& listener, const Instance& response);
1179 void RemoveExitListener(const SendPort& listener);
1180 void NotifyExitListeners();
1181
1182 void AddErrorListener(const SendPort& listener);
1183 void RemoveErrorListener(const SendPort& listener);
1184 bool NotifyErrorListeners(const char* msg, const char* stacktrace);
1185
1186 bool ErrorsFatal() const { return LoadIsolateFlagsBit<ErrorsFatalBit>(); }
1188 UpdateIsolateFlagsBit<ErrorsFatalBit>(value);
1189 }
1190
1191 Random* random() { return &random_; }
1192
1193 Simulator* simulator() const { return simulator_; }
1194 void set_simulator(Simulator* value) { simulator_ = value; }
1195
1196 void IncrementSpawnCount();
1197 void DecrementSpawnCount();
1199
1201 create_group_callback_ = cb;
1202 }
1204 return create_group_callback_;
1205 }
1206
1208 initialize_callback_ = cb;
1209 }
1211 return initialize_callback_;
1212 }
1213
1215 shutdown_callback_ = cb;
1216 }
1218 return shutdown_callback_;
1219 }
1220
1222 cleanup_callback_ = cb;
1223 }
1225 return cleanup_callback_;
1226 }
1227
1229 cleanup_group_callback_ = cb;
1230 }
1232 return cleanup_group_callback_;
1233 }
1236 register_kernel_blob_callback_ = cb;
1237 }
1239 return register_kernel_blob_callback_;
1240 }
1243 unregister_kernel_blob_callback_ = cb;
1244 }
1246 return unregister_kernel_blob_callback_;
1247 }
1248
1249#if !defined(PRODUCT)
1250 ObjectIdRing* object_id_ring() const { return object_id_ring_; }
1252#endif // !defined(PRODUCT)
1253
1254 bool IsDeoptimizing() const { return deopt_context_ != nullptr; }
1255 DeoptContext* deopt_context() const { return deopt_context_; }
1257 ASSERT(value == nullptr || deopt_context_ == nullptr);
1258 deopt_context_ = value;
1259 }
1260
1262 Zone* zone,
1263 const Function& send_function,
1264 Dart_Port send_port);
1266 Zone* zone,
1267 const Function& trampoline,
1268 const Closure& target,
1269 bool keep_isolate_alive);
1273
1274 bool HasLivePorts();
1275 ReceivePortPtr CreateReceivePort(const String& debug_name);
1276 void SetReceivePortKeepAliveState(const ReceivePort& receive_port,
1277 bool keep_isolate_alive);
1278 void CloseReceivePort(const ReceivePort& receive_port);
1279
1280 // Visible for testing.
1282 return ffi_callback_list_head_;
1283 }
1284
1286 ASSERT(defer_finalization_count_ >= 0);
1287 return defer_finalization_count_++;
1288 }
1289
1291 ASSERT(defer_finalization_count_ > 0);
1292 return defer_finalization_count_--;
1293 }
1294
1296 ASSERT(defer_finalization_count_ >= 0);
1297 return defer_finalization_count_ == 0;
1298 }
1299
1300#ifndef PRODUCT
1301 void PrintJSON(JSONStream* stream, bool ref = true);
1302
1303 // Creates an object with the total heap memory usage statistics for this
1304 // isolate.
1306
1308#endif
1309
1310#if !defined(PRODUCT)
1311 VMTagCounters* vm_tag_counters() { return &vm_tag_counters_; }
1312#endif // !defined(PRODUCT)
1313
1314 bool IsPaused() const;
1315
1316#if !defined(PRODUCT)
1318 return LoadIsolateFlagsBit<ShouldPausePostServiceRequestBit>();
1319 }
1321 UpdateIsolateFlagsBit<ShouldPausePostServiceRequestBit>(value);
1322 }
1323#endif // !defined(PRODUCT)
1324
1325 ErrorPtr PausePostRequest();
1326
1327 uword user_tag() const { return user_tag_; }
1328 static intptr_t user_tag_offset() { return OFFSET_OF(Isolate, user_tag_); }
1329 static intptr_t current_tag_offset() {
1330 return OFFSET_OF(Isolate, current_tag_);
1331 }
1332 static intptr_t default_tag_offset() {
1333 return OFFSET_OF(Isolate, default_tag_);
1334 }
1335
1336#if !defined(PRODUCT)
1337#define ISOLATE_METRIC_ACCESSOR(type, variable, name, unit) \
1338 type* Get##variable##Metric() { return &metric_##variable##_; }
1340#undef ISOLATE_METRIC_ACCESSOR
1341#endif // !defined(PRODUCT)
1342
1343 static intptr_t IsolateListLength();
1344
1345 GrowableObjectArrayPtr tag_table() const { return tag_table_; }
1347
1348 UserTagPtr current_tag() const { return current_tag_; }
1349 void set_current_tag(const UserTag& tag);
1350
1351 UserTagPtr default_tag() const { return default_tag_; }
1352 void set_default_tag(const UserTag& tag);
1353
1354 // Also sends a paused at exit event over the service protocol.
1355 void SetStickyError(ErrorPtr sticky_error);
1356
1357 ErrorPtr sticky_error() const { return sticky_error_; }
1359
1360#ifndef PRODUCT
1363 const String& method_name,
1364 const Array& parameter_keys,
1365 const Array& parameter_values,
1366 const Instance& reply_port,
1367 const Instance& id);
1369 const Instance& closure);
1370 InstancePtr LookupServiceExtensionHandler(const String& name);
1371#endif
1372
1373 static void VisitIsolates(IsolateVisitor* visitor);
1374
1375#if !defined(PRODUCT)
1376 // Handle service messages until we are told to resume execution.
1377 void PauseEventHandler();
1378#endif
1379
1380 bool is_vm_isolate() const { return LoadIsolateFlagsBit<IsVMIsolateBit>(); }
1382 UpdateIsolateFlagsBit<IsVMIsolateBit>(value);
1383 }
1384
1386 return LoadIsolateFlagsBit<IsServiceRegisteredBit>();
1387 }
1389 UpdateIsolateFlagsBit<IsServiceRegisteredBit>(value);
1390 }
1391
1392 // Isolate-specific flag handling.
1393 static void FlagsInitialize(Dart_IsolateFlags* api_flags);
1394 void FlagsCopyTo(Dart_IsolateFlags* api_flags) const;
1395 void FlagsCopyFrom(const Dart_IsolateFlags& api_flags);
1396
1397#if defined(DART_PRECOMPILER)
1398#define FLAG_FOR_PRECOMPILER(from_field, from_flag) (from_field)
1399#else
1400#define FLAG_FOR_PRECOMPILER(from_field, from_flag) (from_flag)
1401#endif
1402
1403#if !defined(PRODUCT)
1404#define FLAG_FOR_NONPRODUCT(from_field, from_flag) (from_field)
1405#else
1406#define FLAG_FOR_NONPRODUCT(from_field, from_flag) (from_flag)
1407#endif
1408
1409#define FLAG_FOR_PRODUCT(from_field, from_flag) (from_field)
1410
1411#define DECLARE_GETTER(when, name, bitname, isolate_flag_name, flag_name) \
1412 bool name() const { \
1413 return FLAG_FOR_##when(LoadIsolateFlagsBit<bitname##Bit>(), flag_name); \
1414 }
1416#undef FLAG_FOR_NONPRODUCT
1417#undef FLAG_FOR_PRECOMPILER
1418#undef FLAG_FOR_PRODUCT
1419#undef DECLARE_GETTER
1420
1422 return LoadIsolateFlagsBit<HasAttemptedSteppingBit>();
1423 }
1425 UpdateIsolateFlagsBit<HasAttemptedSteppingBit>(value);
1426 }
1427
1428 // Kills all non-system isolates.
1429 static void KillAllIsolates(LibMsgId msg_id);
1430 // Kills all system isolates, excluding the kernel service and VM service.
1431 static void KillAllSystemIsolates(LibMsgId msg_id);
1432 static void KillIfExists(Isolate* isolate, LibMsgId msg_id);
1433
1434 // Lookup an isolate by its main port. Returns nullptr if no matching isolate
1435 // is found.
1437
1438 // Lookup an isolate by its main port and return a copy of its name. Returns
1439 // nullptr if not matching isolate is found.
1440 static std::unique_ptr<char[]> LookupIsolateNameByPort(Dart_Port port);
1441
1442 static void DisableIsolateCreation();
1443 static void EnableIsolateCreation();
1444 static bool IsolateCreationEnabled();
1445 static bool IsSystemIsolate(const Isolate* isolate) {
1446 return IsolateGroup::IsSystemIsolateGroup(isolate->group());
1447 }
1448 static bool IsVMInternalIsolate(const Isolate* isolate);
1449
1450 HandlerInfoCache* handler_info_cache() { return &handler_info_cache_; }
1451
1453 return &catch_entry_moves_cache_;
1454 }
1455
1456 // The weak table used in the snapshot writer for the purpose of fast message
1457 // sending.
1458 WeakTable* forward_table_new() { return forward_table_new_.get(); }
1460
1461 WeakTable* forward_table_old() { return forward_table_old_.get(); }
1463
1466
1467 std::unique_ptr<VirtualMemory> TakeRegexpBacktrackStack() {
1468 return std::move(regexp_backtracking_stack_cache_);
1469 }
1470
1471 void CacheRegexpBacktrackStack(std::unique_ptr<VirtualMemory> stack) {
1472 regexp_backtracking_stack_cache_ = std::move(stack);
1473 }
1474
1476 bool IsPrefixLoaded(const LibraryPrefix& prefix) const;
1478
1480 return &pointers_to_verify_at_exit_;
1481 }
1482
1483 private:
1484 friend class Dart; // Init, InitOnce, Shutdown.
1485 friend class IsolateKillerVisitor; // Kill().
1487 const char* n,
1488 char** e);
1489
1490 Isolate(IsolateGroup* group, const Dart_IsolateFlags& api_flags);
1491
1492 static void InitVM();
1493 static Isolate* InitIsolate(const char* name_prefix,
1494 IsolateGroup* isolate_group,
1495 const Dart_IsolateFlags& api_flags,
1496 bool is_vm_isolate = false);
1497
1498 // The isolate_creation_monitor_ should be held when calling Kill().
1499 void KillLocked(LibMsgId msg_id);
1500
1501 void Shutdown();
1502 void RunAndCleanupFinalizersOnShutdown();
1503 void LowLevelShutdown();
1504
1505 // Unregister the [isolate] from the thread, remove it from the isolate group,
1506 // invoke the cleanup function (if any), delete the isolate and possibly
1507 // delete the isolate group (if it's the last isolate in the group).
1508 static void LowLevelCleanup(Isolate* isolate);
1509
1510 void BuildName(const char* name_prefix);
1511
1512 void ProfileIdle();
1513
1514 // Visit all object pointers. Caller must ensure concurrent sweeper is not
1515 // running, and the visitor must not allocate.
1516 void VisitObjectPointers(ObjectPointerVisitor* visitor,
1517 ValidationPolicy validate_frames);
1518 void VisitStackPointers(ObjectPointerVisitor* visitor,
1519 ValidationPolicy validate_frames);
1520
1521 void set_user_tag(uword tag) { user_tag_ = tag; }
1522
1523 void set_is_system_isolate(bool is_system_isolate) {
1524 is_system_isolate_ = is_system_isolate;
1525 }
1526
1527#if !defined(PRODUCT)
1528 GrowableObjectArrayPtr GetAndClearPendingServiceExtensionCalls();
1529 GrowableObjectArrayPtr pending_service_extension_calls() const {
1530 return pending_service_extension_calls_;
1531 }
1532 void set_pending_service_extension_calls(const GrowableObjectArray& value);
1533 GrowableObjectArrayPtr registered_service_extension_handlers() const {
1534 return registered_service_extension_handlers_;
1535 }
1536 void set_registered_service_extension_handlers(
1537 const GrowableObjectArray& value);
1538#endif // !defined(PRODUCT)
1539
1540 // DEPRECATED: Use Thread's methods instead. During migration, these default
1541 // to using the mutator thread (which must also be the current thread).
1542 Zone* current_zone() const {
1544 return mutator_thread()->zone();
1545 }
1546
1547 // Accessed from generated code.
1548 // ** This block of fields must come first! **
1549 // For AOT cross-compilation, we rely on these members having the same offsets
1550 // in SIMARM(IA32) and ARM, and the same offsets in SIMARM64(X64) and ARM64.
1551 // We use only word-sized fields to avoid differences in struct packing on the
1552 // different architectures. See also CheckOffsets in dart.cc.
1553 uword user_tag_ = 0;
1554 UserTagPtr current_tag_;
1555 UserTagPtr default_tag_;
1556 FieldTable* field_table_ = nullptr;
1557 // Used to clear out `UntaggedFinalizerBase::isolate_` pointers on isolate
1558 // shutdown to prevent usage of dangling pointers.
1559 GrowableObjectArrayPtr finalizers_;
1560 bool single_step_ = false;
1561 bool has_resumption_breakpoints_ = false;
1562 bool is_system_isolate_ = false;
1563 // End accessed from generated code.
1564
1565 IsolateGroup* const isolate_group_;
1566 IdleTimeHandler idle_time_handler_;
1567 std::unique_ptr<IsolateObjectStore> isolate_object_store_;
1568
1569#define ISOLATE_FLAG_BITS(V) \
1570 V(ErrorsFatal) \
1571 V(IsRunnable) \
1572 V(IsVMIsolate) \
1573 V(IsServiceIsolate) \
1574 V(IsKernelIsolate) \
1575 V(ResumeRequest) \
1576 V(HasAttemptedStepping) \
1577 V(ShouldPausePostServiceRequest) \
1578 V(IsSystemIsolate) \
1579 V(IsServiceRegistered)
1580
1581 // Isolate specific flags.
1582 enum FlagBits {
1583#define DECLARE_BIT(Name) k##Name##Bit,
1585#undef DECLARE_BIT
1586 };
1587
1588#define DECLARE_BITFIELD(Name) \
1589 class Name##Bit : public BitField<uint32_t, bool, k##Name##Bit, 1> {};
1591#undef DECLARE_BITFIELD
1592
1593 template <class T>
1594 bool UpdateIsolateFlagsBit(bool value) {
1595 return T::decode(value ? isolate_flags_.fetch_or(T::encode(true),
1596 std::memory_order_relaxed)
1597 : isolate_flags_.fetch_and(
1598 ~T::encode(true), std::memory_order_relaxed));
1599 }
1600 template <class T>
1601 bool LoadIsolateFlagsBit() const {
1602 return T::decode(isolate_flags_.load(std::memory_order_relaxed));
1603 }
1604 std::atomic<uint32_t> isolate_flags_;
1605
1606// Fields that aren't needed in a product build go here with boolean flags at
1607// the top.
1608#if !defined(PRODUCT)
1609 Debugger* debugger_ = nullptr;
1610
1611 // SampleBlock containing CPU profiling samples.
1612 RelaxedAtomic<SampleBlock*> current_sample_block_ = nullptr;
1613
1614 // SampleBlock containing Dart allocation profiling samples.
1615 RelaxedAtomic<SampleBlock*> current_allocation_sample_block_ = nullptr;
1616
1617 RelaxedAtomic<uword> has_completed_blocks_ = {0};
1618
1619 int64_t last_resume_timestamp_;
1620
1621 VMTagCounters vm_tag_counters_;
1622
1623 // We use 6 list entries for each pending service extension calls.
1624 enum {
1625 kPendingHandlerIndex = 0,
1626 kPendingMethodNameIndex,
1627 kPendingKeysIndex,
1628 kPendingValuesIndex,
1629 kPendingReplyPortIndex,
1630 kPendingIdIndex,
1631 kPendingEntrySize
1632 };
1633 GrowableObjectArrayPtr pending_service_extension_calls_;
1634
1635 // We use 2 list entries for each registered extension handler.
1636 enum {
1637 kRegisteredNameIndex = 0,
1638 kRegisteredHandlerIndex,
1639 kRegisteredEntrySize
1640 };
1641 GrowableObjectArrayPtr registered_service_extension_handlers_;
1642
1643 // Used to wake the isolate when it is in the pause event loop.
1644 Monitor* pause_loop_monitor_ = nullptr;
1645
1646#define ISOLATE_METRIC_VARIABLE(type, variable, name, unit) \
1647 type metric_##variable##_;
1649#undef ISOLATE_METRIC_VARIABLE
1650
1651 // Ring buffer of objects assigned an id.
1652 ObjectIdRing* object_id_ring_ = nullptr;
1653#endif // !defined(PRODUCT)
1654
1655 // All other fields go here.
1656 int64_t start_time_micros_;
1657 std::atomic<Dart_MessageNotifyCallback> message_notify_callback_;
1658 Dart_IsolateShutdownCallback on_shutdown_callback_ = nullptr;
1659 Dart_IsolateCleanupCallback on_cleanup_callback_ = nullptr;
1660 char* name_ = nullptr;
1661 Dart_Port main_port_ = 0;
1662 // Isolates created by Isolate.spawn have the same origin id.
1663 Dart_Port origin_id_ = 0;
1664 Mutex origin_id_mutex_;
1665 uint64_t pause_capability_ = 0;
1666 uint64_t terminate_capability_ = 0;
1667 void* init_callback_data_ = nullptr;
1668 Dart_EnvironmentCallback environment_callback_ = nullptr;
1669 Random random_;
1670 Simulator* simulator_ = nullptr;
1671 Mutex mutex_; // Protects compiler stats.
1672 IsolateMessageHandler* message_handler_ = nullptr;
1673 intptr_t defer_finalization_count_ = 0;
1674 DeoptContext* deopt_context_ = nullptr;
1675 FfiCallbackMetadata::Metadata* ffi_callback_list_head_ = nullptr;
1676 intptr_t ffi_callback_keep_alive_counter_ = 0;
1677
1678 GrowableObjectArrayPtr tag_table_;
1679
1680 ErrorPtr sticky_error_;
1681
1682 std::unique_ptr<Bequest> bequest_;
1683 Dart_Port beneficiary_ = 0;
1684
1685 // This guards spawn_count_. An isolate cannot complete shutdown and be
1686 // destroyed while there are child isolates in the midst of a spawn.
1687 Monitor spawn_count_monitor_;
1688 intptr_t spawn_count_ = 0;
1689
1690 HandlerInfoCache handler_info_cache_;
1691 CatchEntryMovesCache catch_entry_moves_cache_;
1692
1693 DispatchTable* dispatch_table_ = nullptr;
1694
1695 // Used during message sending of messages between isolates.
1696 std::unique_ptr<WeakTable> forward_table_new_;
1697 std::unique_ptr<WeakTable> forward_table_old_;
1698
1699 // Signals whether the isolate can receive messages (e.g. KillAllIsolates can
1700 // send a kill message).
1701 // This is protected by [isolate_creation_monitor_].
1702 bool accepts_messages_ = false;
1703
1704 std::unique_ptr<VirtualMemory> regexp_backtracking_stack_cache_ = nullptr;
1705
1706 intptr_t wake_pause_event_handler_count_;
1707
1708 // The number of open [ReceivePort]s the isolate owns.
1709 intptr_t open_ports_ = 0;
1710
1711 // The number of open [ReceivePort]s that keep the isolate alive.
1712 intptr_t open_ports_keepalive_ = 0;
1713
1714 static Dart_IsolateGroupCreateCallback create_group_callback_;
1715 static Dart_InitializeIsolateCallback initialize_callback_;
1716 static Dart_IsolateShutdownCallback shutdown_callback_;
1717 static Dart_IsolateCleanupCallback cleanup_callback_;
1718 static Dart_IsolateGroupCleanupCallback cleanup_group_callback_;
1719 static Dart_RegisterKernelBlobCallback register_kernel_blob_callback_;
1720 static Dart_UnregisterKernelBlobCallback unregister_kernel_blob_callback_;
1721
1722#if !defined(PRODUCT)
1723 static void WakePauseEventHandler(Dart_Isolate isolate);
1724#endif
1725
1726 // Manage list of existing isolates.
1727 static bool TryMarkIsolateReady(Isolate* isolate);
1728 static void UnMarkIsolateReady(Isolate* isolate);
1729 static void MaybeNotifyVMShutdown();
1730 bool AcceptsMessagesLocked() {
1731 ASSERT(isolate_creation_monitor_->IsOwnedByCurrentThread());
1732 return accepts_messages_;
1733 }
1734
1735 // This monitor protects [creation_enabled_].
1736 static Monitor* isolate_creation_monitor_;
1737 static bool creation_enabled_;
1738
1739 ArrayPtr loaded_prefixes_set_storage_;
1740
1741 MallocGrowableArray<ObjectPtr> pointers_to_verify_at_exit_;
1742
1743#define REUSABLE_FRIEND_DECLARATION(name) \
1744 friend class Reusable##name##HandleScope;
1746#undef REUSABLE_FRIEND_DECLARATION
1747
1748 friend class Become; // VisitObjectPointers
1749 friend class GCCompactor; // VisitObjectPointers
1750 friend class GCMarker; // VisitObjectPointers
1751 friend class SafepointHandler;
1752 friend class ObjectGraph; // VisitObjectPointers
1753 friend class HeapSnapshotWriter; // VisitObjectPointers
1754 friend class Scavenger; // VisitObjectPointers
1755 friend class HeapIterationScope; // VisitObjectPointers
1756 friend class ServiceIsolate;
1757 friend class Thread;
1758 friend class Timeline;
1759 friend class IsolateGroup; // reload_context_
1760
1762};
1763
1764// When we need to execute code in an isolate, we use the
1765// StartIsolateScope.
1767 public:
1768 explicit StartIsolateScope(Isolate* new_isolate)
1769 : new_isolate_(new_isolate), saved_isolate_(Isolate::Current()) {
1770 if (new_isolate_ == nullptr) {
1771 ASSERT(Isolate::Current() == nullptr);
1772 // Do nothing.
1773 return;
1774 }
1775 if (saved_isolate_ != new_isolate_) {
1776 ASSERT(Isolate::Current() == nullptr);
1777 Thread::EnterIsolate(new_isolate_);
1778 // Ensure this is not a nested 'isolate enter' with prior state.
1779 ASSERT(Thread::Current()->top_exit_frame_info() == 0);
1780 }
1781 }
1782
1784 if (new_isolate_ == nullptr) {
1785 ASSERT(Isolate::Current() == nullptr);
1786 // Do nothing.
1787 return;
1788 }
1789 if (saved_isolate_ != new_isolate_) {
1790 ASSERT(saved_isolate_ == nullptr);
1791 // ASSERT that we have bottomed out of all Dart invocations.
1792 ASSERT(Thread::Current()->top_exit_frame_info() == 0);
1794 }
1795 }
1796
1797 private:
1798 Isolate* new_isolate_;
1799 Isolate* saved_isolate_;
1800
1801 DISALLOW_COPY_AND_ASSIGN(StartIsolateScope);
1802};
1803
1805 public:
1806 explicit EnterIsolateGroupScope(IsolateGroup* isolate_group)
1807 : isolate_group_(isolate_group) {
1808 ASSERT(IsolateGroup::Current() == nullptr);
1810 isolate_group_, Thread::kUnknownTask, /*bypass_safepoint=*/false);
1811 ASSERT(result);
1812 }
1813
1815 Thread::ExitIsolateGroupAsHelper(/*bypass_safepoint=*/false);
1816 }
1817
1818 private:
1819 IsolateGroup* isolate_group_;
1820
1821 DISALLOW_COPY_AND_ASSIGN(EnterIsolateGroupScope);
1822};
1823
1824// Ensure that isolate is not available for the duration of this scope.
1825//
1826// This can be used in code (e.g. GC, Kernel Loader, Compiler) that should not
1827// operate on an individual isolate.
1829 public:
1832 : StackResource(thread), thread_(thread) {
1833 outer_ = thread_->no_active_isolate_scope_;
1834 saved_isolate_ = thread_->isolate_;
1835
1836 thread_->no_active_isolate_scope_ = this;
1837 thread_->isolate_ = nullptr;
1838 }
1840 ASSERT(thread_->isolate_ == nullptr);
1841 thread_->isolate_ = saved_isolate_;
1842 thread_->no_active_isolate_scope_ = outer_;
1843 }
1844
1845 private:
1847
1848 Thread* thread_;
1849 Isolate* saved_isolate_;
1850 NoActiveIsolateScope* outer_;
1851};
1852
1854 public:
1857 thread->no_active_isolate_scope_->saved_isolate_) {}
1858
1860 : StackResource(thread), thread_(thread) {
1861 RELEASE_ASSERT(thread->isolate() == nullptr);
1862 thread_->isolate_ = isolate;
1863 }
1865 ASSERT(thread_->isolate_ != nullptr);
1866 thread_->isolate_ = nullptr;
1867 }
1868
1869 private:
1870 Thread* thread_;
1871};
1872
1873} // namespace dart
1874
1875#endif // RUNTIME_VM_ISOLATE_H_
static void encode(uint8_t output[16], const uint32_t input[4])
Definition: SkMD5.cpp:240
SI F table(const skcms_Curve *curve, F v)
#define RELEASE_ASSERT(cond)
Definition: assert.h:327
T load(std::memory_order order=std::memory_order_acquire) const
Definition: atomic.h:101
void store(T arg, std::memory_order order=std::memory_order_release)
Definition: atomic.h:104
ActiveIsolateScope(Thread *thread, Isolate *isolate)
Definition: isolate.h:1859
ActiveIsolateScope(Thread *thread)
Definition: isolate.h:1855
Thread * scheduled_mutator_thread_
Definition: base_isolate.h:34
PersistentHandle * TakeHandle()
Definition: isolate.h:944
Bequest(PersistentHandle *handle, Dart_Port beneficiary)
Definition: isolate.h:939
PersistentHandle * handle()
Definition: isolate.h:943
Dart_Port beneficiary()
Definition: isolate.h:949
virtual void Call()=0
virtual ~Callable()
Definition: isolate.h:108
DisableIdleTimerScope(IdleTimeHandler *handler)
Definition: isolate.cc:245
EnterIsolateGroupScope(IsolateGroup *isolate_group)
Definition: isolate.h:1806
ObjectPtr * table()
Definition: field_table.h:43
void InitializeWithHeap(Heap *heap)
Definition: isolate.cc:190
bool ShouldNotifyIdle(int64_t *expiry)
Definition: isolate.cc:209
bool ShouldCheckForIdle()
Definition: isolate.cc:196
void NotifyIdleUsingDefaultDeadline()
Definition: isolate.cc:240
void UpdateStartIdleTime()
Definition: isolate.cc:202
void NotifyIdle(int64_t deadline)
Definition: isolate.cc:225
intptr_t num_blob_loads_
Definition: isolate.h:205
const uint8_t * script_kernel_buffer
Definition: isolate.h:200
Dart_IsolateFlags flags
Definition: isolate.h:197
const uint8_t * kernel_buffer
Definition: isolate.h:195
intptr_t script_kernel_size
Definition: isolate.h:201
const intptr_t kernel_buffer_size
Definition: isolate.h:196
IsolateGroupSource(const char *script_uri, const char *name, const uint8_t *snapshot_data, const uint8_t *snapshot_instructions, const uint8_t *kernel_buffer, intptr_t kernel_buffer_size, Dart_IsolateFlags flags)
Definition: isolate.h:163
const uint8_t * snapshot_instructions
Definition: isolate.h:194
const uint8_t * snapshot_data
Definition: isolate.h:193
void add_loaded_blob(Zone *zone_, const ExternalTypedData &external_typed_data)
Definition: isolate.cc:133
void IncreaseMutatorCount(Isolate *mutator, bool is_nested_reenter)
Definition: isolate.cc:590
Random * random()
Definition: isolate.h:411
GroupDebugger * debugger() const
Definition: isolate.h:315
void RunWithLockedGroup(std::function< void()> fun)
Definition: isolate.cc:466
int64_t UptimeMicros() const
Definition: isolate.cc:1982
void RestoreOriginalClassTable()
Definition: isolate.cc:3823
void set_use_osr(bool use_osr)
Definition: isolate.h:488
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)
Definition: isolate.cc:2102
bool has_dynamically_extendable_classes() const
Definition: isolate.h:720
StoreBuffer * store_buffer() const
Definition: isolate.h:509
bool remapping_cids() const
Definition: isolate.h:728
void UnregisterIsolate(Isolate *isolate)
Definition: isolate.cc:471
Mutex * kernel_data_class_cache_mutex()
Definition: isolate.h:524
void ForEachIsolate(std::function< void(Isolate *isolate)> function, bool at_safepoint=false)
Definition: isolate.cc:2841
void set_cached_class_table_table(ClassPtr *cached_class_table_table)
Definition: isolate.h:393
bool UnregisterIsolateDecrementCount()
Definition: isolate.cc:476
void DeleteReloadContext()
Definition: isolate.cc:2131
void VisitStackPointers(ObjectPointerVisitor *visitor, ValidationPolicy validate_frames)
Definition: isolate.cc:2970
MutatorThreadPool * thread_pool()
Definition: isolate.h:769
bool should_load_vmservice() const
Definition: isolate.h:445
static bool IsSystemIsolateGroup(const IsolateGroup *group)
Definition: isolate.cc:3605
void ScheduleInterrupts(uword interrupt_bits)
Definition: isolate.cc:1960
intptr_t optimization_counter_threshold() const
Definition: isolate.h:306
void RegisterClass(const Class &cls)
Definition: isolate.cc:769
const char ** obfuscation_map() const
Definition: isolate.h:409
ClassTableAllocator * class_table_allocator()
Definition: isolate.h:381
Become * become() const
Definition: isolate.h:677
bool all_classes_finalized() const
Definition: isolate.h:713
void * embedder_data() const
Definition: isolate.h:291
void RehashConstants(Become *become)
Definition: isolate.cc:887
void FlagsCopyFrom(const Dart_IsolateFlags &api_flags)
Definition: isolate.cc:1622
void DropOriginalClassTable()
Definition: isolate.cc:3830
MarkingStack * deferred_marking_stack() const
Definition: isolate.h:578
void set_should_load_vmservice(bool value)
Definition: isolate.h:448
void set_all_classes_finalized(bool value)
Definition: isolate.h:716
Heap * heap() const
Definition: isolate.h:296
bool initial_spawn_successful()
Definition: isolate.h:293
void set_dispatch_table_snapshot(const uint8_t *snapshot)
Definition: isolate.h:371
bool ContainsOnlyOneIsolate()
Definition: isolate.cc:458
void FreeStaticField(const Field &field)
Definition: isolate.cc:848
ObjectStore * object_store() const
Definition: isolate.h:510
SafepointRwLock * program_lock()
Definition: isolate.h:537
ClassPtr * cached_class_table_table()
Definition: isolate.h:390
void DisableIncrementalBarrier()
Definition: isolate.cc:2831
void CloneClassTableForReload()
Definition: isolate.cc:3817
static IsolateGroup * Current()
Definition: isolate.h:539
std::shared_ptr< IsolateGroupSource > shareable_source() const
Definition: isolate.h:287
Dart_LibraryTagHandler library_tag_handler() const
Definition: isolate.h:555
void RegisterStaticField(const Field &field, const Object &initial_value)
Definition: isolate.cc:811
void set_has_dynamically_extendable_classes(bool value)
Definition: isolate.h:723
ClassTable * class_table() const
Definition: isolate.h:496
void set_last_reload_timestamp(int64_t value)
Definition: isolate.h:651
static intptr_t class_table_offset()
Definition: isolate.h:385
static bool HasOnlyVMIsolateGroup()
Definition: isolate.cc:724
bool is_system_isolate_group() const
Definition: isolate.h:413
void DecreaseMutatorCount(Isolate *mutator, bool is_nested_exit)
Definition: isolate.cc:618
void set_initial_field_table(std::shared_ptr< FieldTable > field_table)
Definition: isolate.h:746
Mutex * type_arguments_canonicalization_mutex()
Definition: isolate.h:513
void VisitObjectIdRingPointers(ObjectPointerVisitor *visitor)
Definition: isolate.cc:2987
IsolateGroupReloadContext * reload_context()
Definition: isolate.h:656
uint64_t id() const
Definition: isolate.h:680
void set_object_store(ObjectStore *object_store)
Definition: isolate.cc:1072
void SetNativeAssetsCallbacks(NativeAssetsApi *native_assets_api)
Definition: isolate.h:780
Mutex * initializer_functions_mutex()
Definition: isolate.h:534
ApiState * api_state() const
Definition: isolate.h:700
void RegisterSharedStaticField(const Field &field, const Object &initial_value)
Definition: isolate.cc:789
FieldTable * initial_field_table() const
Definition: isolate.h:742
intptr_t reload_every_n_stack_overflow_checks() const
Definition: isolate.h:477
void VisitObjectPointers(ObjectPointerVisitor *visitor, ValidationPolicy validate_frames)
Definition: isolate.cc:2912
void set_library_tag_handler(Dart_LibraryTagHandler handler)
Definition: isolate.h:558
IsolateGroupSource * source() const
Definition: isolate.h:286
bool ReloadSources(JSONStream *js, bool force_reload, const char *root_script_url=nullptr, const char *packages_url=nullptr, bool dont_delete_reload_context=false)
Definition: isolate.cc:2073
void set_saved_unlinked_calls(const Array &saved_unlinked_calls)
Definition: isolate.cc:586
void SetHasAttemptedReload(bool value)
Definition: isolate.h:472
void SetupImagePage(const uint8_t *snapshot_buffer, bool is_executable)
Definition: isolate.cc:1953
int64_t last_allocationprofile_gc_timestamp() const
Definition: isolate.h:359
ClassTable * heap_walk_class_table() const
Definition: isolate.h:503
Mutex * kernel_constants_mutex()
Definition: isolate.h:527
ArrayPtr saved_unlinked_calls() const
Definition: isolate.h:739
void set_remapping_cids(bool value)
Definition: isolate.h:731
void RunWithStoppedMutators(T single_current_mutator, S otherwise, bool use_force_growth_in_otherwise=false)
Definition: isolate.h:611
Mutex * type_feedback_mutex()
Definition: isolate.h:518
Isolate * FirstIsolateLocked() const
Definition: isolate.cc:2874
void PrintJSON(JSONStream *stream, bool ref=true)
Definition: isolate.cc:643
std::shared_ptr< FieldTable > shared_field_table_shareable()
Definition: isolate.h:761
Mutex * type_canonicalization_mutex()
Definition: isolate.h:512
NativeAssetsApi * native_assets_api()
Definition: isolate.h:783
void ReleaseStoreBuffers()
Definition: isolate.cc:2776
void set_obfuscation_map(const char **map)
Definition: isolate.h:408
static void ExitTemporaryIsolate()
Definition: isolate.cc:880
void RememberLiveTemporaries()
Definition: isolate.cc:3008
void FlagsCopyTo(Dart_IsolateFlags *api_flags)
Definition: isolate.cc:1611
MarkingStack * old_marking_stack() const
Definition: isolate.h:576
void RunWithStoppedMutatorsCallable(Callable *single_current_mutator, Callable *otherwise, bool use_force_growth_in_otherwise=false)
Definition: isolate.cc:2878
SafepointHandler * safepoint_handler()
Definition: isolate.h:334
void set_initial_spawn_successful()
Definition: isolate.h:294
Mutex * patchable_call_mutex()
Definition: isolate.h:519
intptr_t MutatorCount() const
Definition: isolate.h:546
void set_become(Become *become)
Definition: isolate.h:678
std::shared_ptr< FieldTable > initial_field_table_shareable()
Definition: isolate.h:743
void VisitWeakPersistentHandles(HandleVisitor *visitor)
Definition: isolate.cc:2998
static void RunWithIsolateGroup(uint64_t id, std::function< void(IsolateGroup *)> action, std::function< void()> not_found)
Definition: isolate.cc:690
void set_shared_initial_field_table(std::shared_ptr< FieldTable > field_table)
Definition: isolate.h:756
void set_dispatch_table_snapshot_size(intptr_t size)
Definition: isolate.h:377
void DeferredMarkLiveTemporaries()
Definition: isolate.cc:3002
Mutex * constant_canonicalization_mutex()
Definition: isolate.h:520
bool IsReloading() const
Definition: isolate.h:669
void RegisterIsolate(Isolate *isolate)
Definition: isolate.cc:451
int64_t last_reload_timestamp() const
Definition: isolate.h:654
Mutex * kernel_data_lib_cache_mutex()
Definition: isolate.h:523
void MaybeIncreaseReloadEveryNStackOverflowChecks()
Definition: isolate.cc:2532
void set_branch_coverage(bool value)
Definition: isolate.h:458
intptr_t dispatch_table_snapshot_size() const
Definition: isolate.h:374
FieldTable * shared_initial_field_table() const
Definition: isolate.h:750
DispatchTable * dispatch_table() const
Definition: isolate.h:364
ISOLATE_GROUP_METRIC_LIST(ISOLATE_METRIC_ACCESSOR)
BackgroundCompiler * background_compiler() const
Definition: isolate.h:298
void UpdateLastAllocationProfileAccumulatorResetTimestamp()
Definition: isolate.h:346
static void RegisterIsolateGroup(IsolateGroup *isolate_group)
Definition: isolate.cc:704
void set_coverage(bool value)
Definition: isolate.h:463
ThreadRegistry * thread_registry() const
Definition: isolate.h:333
Isolate * FirstIsolate() const
Definition: isolate.cc:2869
ObjectPtr CallTagHandler(Dart_LibraryTag tag, const Object &arg1, const Object &arg2)
Definition: isolate.cc:1925
Mutex * symbols_mutex()
Definition: isolate.h:511
Mutex * megamorphic_table_mutex()
Definition: isolate.h:517
static intptr_t cached_class_table_table_offset()
Definition: isolate.h:396
IdleTimeHandler * idle_time_handler()
Definition: isolate.h:318
bool HasAttemptedReload() const
Definition: isolate.h:469
bool is_vm_isolate() const
Definition: isolate.h:290
Isolate * EnterTemporaryIsolate()
Definition: isolate.cc:871
static bool HasApplicationIsolateGroups()
Definition: isolate.cc:714
static void Init()
Definition: isolate.cc:734
Dart_DeferredLoadHandler deferred_load_handler() const
Definition: isolate.h:561
void PrintToJSONObject(JSONObject *jsobj, bool ref)
Definition: isolate.cc:648
static void ForEach(std::function< void(IsolateGroup *)> action)
Definition: isolate.cc:683
void set_shared_field_table(Thread *T, FieldTable *shared_field_table)
Definition: isolate.h:764
FieldTable * shared_field_table() const
Definition: isolate.h:760
void FlushMarkingStacks()
Definition: isolate.cc:2780
const uint8_t * dispatch_table_snapshot() const
Definition: isolate.h:368
void RunWithStoppedMutators(T function, bool use_force_growth=false)
Definition: isolate.h:621
MarkingStack * new_marking_stack() const
Definition: isolate.h:577
Mutex * subtype_test_cache_mutex()
Definition: isolate.h:516
int64_t last_allocationprofile_accumulator_reset_timestamp() const
Definition: isolate.h:351
void EnableIncrementalBarrier(MarkingStack *old_marking_stack, MarkingStack *new_marking_stack, MarkingStack *deferred_marking_stack)
Definition: isolate.cc:2817
ProgramReloadContext * program_reload_context()
Definition: isolate.h:659
void VisitSharedPointers(ObjectPointerVisitor *visitor)
Definition: isolate.cc:2921
std::shared_ptr< FieldTable > shared_initial_field_table_shareable()
Definition: isolate.h:753
static void FlagsInitialize(Dart_IsolateFlags *api_flags)
Definition: isolate.cc:1600
void set_deferred_load_handler(Dart_DeferredLoadHandler handler)
Definition: isolate.h:564
void set_asserts(bool value)
Definition: isolate.h:453
void CreateHeap(bool is_vm_isolate, bool is_service_or_kernel_isolate)
Definition: isolate.cc:482
IsolateGroup(std::shared_ptr< IsolateGroupSource > source, void *embedder_data, ObjectStore *object_store, Dart_IsolateFlags api_flags, bool is_vm_isolate)
Definition: isolate.cc:325
void UpdateLastAllocationProfileGCTimestamp()
Definition: isolate.h:355
static intptr_t object_store_offset()
Definition: isolate.h:403
static void UnregisterIsolateGroup(IsolateGroup *isolate_group)
Definition: isolate.cc:709
static void Cleanup()
Definition: isolate.cc:742
bool HasTagHandler() const
Definition: isolate.h:551
void PrintMemoryUsageJSON(JSONStream *stream)
Definition: isolate.cc:668
void set_dispatch_table(DispatchTable *table)
Definition: isolate.h:365
virtual void VisitIsolate(Isolate *isolate)=0
virtual ~IsolateVisitor()
Definition: isolate.h:93
bool IsSystemIsolate(Isolate *isolate) const
Definition: isolate.cc:752
static intptr_t user_tag_offset()
Definition: isolate.h:1328
void set_forward_table_old(WeakTable *table)
Definition: isolate.cc:2552
ReceivePortPtr CreateReceivePort(const String &debug_name)
Definition: isolate.cc:3758
IsolateGroupSource * source() const
Definition: isolate.h:1036
void set_should_pause_post_service_request(bool value)
Definition: isolate.h:1320
bool AddResumeCapability(const Capability &capability)
Definition: isolate.cc:2197
bool HasLivePorts()
Definition: isolate.cc:3752
intptr_t BlockClassFinalization()
Definition: isolate.h:1285
bool single_step() const
Definition: isolate.h:1133
Thread * scheduled_mutator_thread() const
Definition: isolate.h:992
void AddExitListener(const SendPort &listener, const Instance &response)
Definition: isolate.cc:2248
bool GetAndClearResumeRequest()
Definition: isolate.h:1163
void AddErrorListener(const SendPort &listener)
Definition: isolate.cc:2316
FfiCallbackMetadata::Trampoline CreateAsyncFfiCallback(Zone *zone, const Function &send_function, Dart_Port send_port)
Definition: isolate.cc:3732
bool TrySetHasCompletedBlocks()
Definition: isolate.h:1128
Dart_EnvironmentCallback environment_callback() const
Definition: isolate.h:1075
ErrorPtr sticky_error() const
Definition: isolate.h:1357
UserTagPtr current_tag() const
Definition: isolate.h:1348
Simulator * simulator() const
Definition: isolate.h:1193
int64_t last_resume_timestamp() const
Definition: isolate.h:1159
FfiCallbackMetadata::Metadata * ffi_callback_list_head()
Definition: isolate.h:1281
void set_deopt_context(DeoptContext *value)
Definition: isolate.h:1256
static bool IsSystemIsolate(const Isolate *isolate)
Definition: isolate.h:1445
FieldTable * field_table() const
Definition: isolate.h:1000
static void DisableIsolateCreation()
Definition: isolate.cc:3590
void ScheduleInterrupts(uword interrupt_bits)
Definition: isolate.cc:1967
void RememberLiveTemporaries()
Definition: isolate.cc:2784
@ kErrorFatalMsg
Definition: isolate.h:969
@ kCheckForReload
Definition: isolate.h:975
@ kDrainServiceExtensionsMsg
Definition: isolate.h:974
@ kInternalKillMsg
Definition: isolate.h:973
uword user_tag() const
Definition: isolate.h:1327
ObjectIdRing * object_id_ring() const
Definition: isolate.h:1250
void SetResumeRequest()
Definition: isolate.h:1150
static Isolate * Current()
Definition: isolate.h:986
bool ErrorsFatal() const
Definition: isolate.h:1186
static bool IsVMInternalIsolate(const Isolate *isolate)
Definition: isolate.cc:3609
void set_on_shutdown_callback(Dart_IsolateShutdownCallback value)
Definition: isolate.h:1019
void DeferredMarkLiveTemporaries()
Definition: isolate.cc:2790
static void KillIfExists(Isolate *isolate, LibMsgId msg_id)
Definition: isolate.cc:3706
void set_has_resumption_breakpoints(bool value)
Definition: isolate.h:1138
static bool IsolateCreationEnabled()
Definition: isolate.cc:3600
IsolateObjectStore * isolate_object_store() const
Definition: isolate.h:1007
void FlagsCopyTo(Dart_IsolateFlags *api_flags) const
Definition: isolate.cc:1661
bool TakeHasCompletedBlocks()
Definition: isolate.h:1125
static intptr_t single_step_offset()
Definition: isolate.h:1134
VMTagCounters * vm_tag_counters()
Definition: isolate.h:1311
static void KillAllSystemIsolates(LibMsgId msg_id)
Definition: isolate.cc:3701
static void VisitIsolates(IsolateVisitor *visitor)
Definition: isolate.cc:3531
Debugger * debugger() const
Definition: isolate.h:1108
bool VerifyPauseCapability(const Object &capability) const
Definition: isolate.cc:2187
ISOLATE_METRIC_LIST(ISOLATE_METRIC_ACCESSOR)
void DeleteFfiCallback(FfiCallbackMetadata::Trampoline callback)
Definition: isolate.cc:3801
@ kImmediateAction
Definition: isolate.h:979
@ kBeforeNextEventAction
Definition: isolate.h:980
@ kAsEventAction
Definition: isolate.h:981
UserTagPtr default_tag() const
Definition: isolate.h:1351
MallocGrowableArray< ObjectPtr > * pointers_to_verify_at_exit()
Definition: isolate.h:1479
void NotifyExitListeners()
Definition: isolate.cc:2299
bool IsPrefixLoaded(const LibraryPrefix &prefix) const
Definition: isolate.cc:2802
void DecrementSpawnCount()
Definition: isolate.cc:3716
bool RemoveResumeCapability(const Capability &capability)
Definition: isolate.cc:2230
SafepointHandler * safepoint_handler() const
Definition: isolate.h:996
void PrintJSON(JSONStream *stream, bool ref=true)
Definition: isolate.cc:3084
bool has_attempted_stepping() const
Definition: isolate.h:1421
bool ResumeRequest() const
Definition: isolate.h:1148
void SetErrorsFatal(bool value)
Definition: isolate.h:1187
MessageHandler * message_handler() const
Definition: isolate.cc:2416
void set_field_table(Thread *T, FieldTable *field_table)
Definition: isolate.h:1001
ObjectPtr CallDeferredLoadHandler(intptr_t id)
Definition: isolate.cc:1941
intptr_t UnblockClassFinalization()
Definition: isolate.h:1290
void PrintPauseEventJSON(JSONStream *stream)
Definition: isolate.cc:3212
static Dart_IsolateShutdownCallback ShutdownCallback()
Definition: isolate.h:1217
bool is_vm_isolate() const
Definition: isolate.h:1380
friend class ObjectGraph
Definition: isolate.h:1752
void SetReceivePortKeepAliveState(const ReceivePort &receive_port, bool keep_isolate_alive)
Definition: isolate.cc:3765
FfiCallbackMetadata::Trampoline CreateIsolateLocalFfiCallback(Zone *zone, const Function &trampoline, const Closure &target, bool keep_isolate_alive)
Definition: isolate.cc:3740
void SetPrefixIsLoaded(const LibraryPrefix &prefix)
Definition: isolate.cc:2810
void RegisterServiceExtensionHandler(const String &name, const Instance &closure)
Definition: isolate.cc:3385
static void FlagsInitialize(Dart_IsolateFlags *api_flags)
Definition: isolate.cc:1648
void PrintMemoryUsageJSON(JSONStream *stream)
Definition: isolate.cc:3208
static void SetShutdownCallback(Dart_IsolateShutdownCallback cb)
Definition: isolate.h:1214
static void KillAllIsolates(LibMsgId msg_id)
Definition: isolate.cc:3696
static intptr_t finalizers_offset()
Definition: isolate.h:1071
void set_on_cleanup_callback(Dart_IsolateCleanupCallback value)
Definition: isolate.h:1025
static std::unique_ptr< char[]> LookupIsolateNameByPort(Dart_Port port)
Definition: isolate.cc:3561
bool HasPendingMessages()
Definition: isolate.cc:1356
static intptr_t IsolateListLength()
Definition: isolate.cc:3541
void set_current_sample_block(SampleBlock *block)
Definition: isolate.h:1112
void * init_callback_data() const
Definition: isolate.h:1068
uint64_t terminate_capability() const
Definition: isolate.h:1060
ThreadRegistry * thread_registry() const
Definition: isolate.h:994
void set_terminate_capability(uint64_t value)
Definition: isolate.h:1057
static intptr_t default_tag_offset()
Definition: isolate.h:1332
void set_is_runnable(bool value)
Definition: isolate.h:1096
void CloseReceivePort(const ReceivePort &receive_port)
Definition: isolate.cc:3785
void set_last_resume_timestamp()
Definition: isolate.h:1155
bool HasDeferredLoadHandler() const
Definition: isolate.h:1082
const char * MakeRunnable()
Definition: isolate.cc:2140
Dart_IsolateShutdownCallback on_shutdown_callback()
Definition: isolate.h:1022
GrowableObjectArrayPtr tag_table() const
Definition: isolate.h:1345
void set_simulator(Simulator *value)
Definition: isolate.h:1194
void SendInternalLibMessage(LibMsgId msg_id, uint64_t capability)
Definition: isolate.cc:1033
bool VerifyTerminateCapability(const Object &capability) const
Definition: isolate.cc:2192
Mutex * mutex()
Definition: isolate.h:1105
void WaitForOutstandingSpawns()
Definition: isolate.cc:3723
void set_forward_table_new(WeakTable *table)
Definition: isolate.cc:2548
int64_t UptimeMicros() const
Definition: isolate.cc:1986
void UpdateNativeCallableKeepIsolateAliveCounter(intptr_t delta)
Definition: isolate.cc:3806
ObjectIdRing * EnsureObjectIdRing()
Definition: isolate.cc:3014
static Dart_IsolateCleanupCallback CleanupCallback()
Definition: isolate.h:1224
ErrorPtr InvokePendingServiceExtensionCalls()
Definition: isolate.cc:3253
friend class HeapSnapshotWriter
Definition: isolate.h:1753
void MakeRunnableLocked()
Definition: isolate.cc:2154
SampleBlock * current_sample_block() const
Definition: isolate.h:1111
void set_environment_callback(Dart_EnvironmentCallback value)
Definition: isolate.h:1078
DART_WARN_UNUSED_RESULT ErrorPtr StealStickyError()
Definition: isolate.cc:3233
void set_main_port(Dart_Port port)
Definition: isolate.h:1049
ErrorPtr PausePostRequest()
Definition: isolate.cc:2013
bool should_pause_post_service_request() const
Definition: isolate.h:1317
static void EnableIsolateCreation()
Definition: isolate.cc:3595
void AppendServiceExtensionCall(const Instance &closure, const String &method_name, const Array &parameter_keys, const Array &parameter_values, const Instance &reply_port, const Instance &id)
Definition: isolate.cc:3332
HandlerInfoCache * handler_info_cache()
Definition: isolate.h:1450
IsolateGroup * group() const
Definition: isolate.h:1037
static void SetCleanupCallback(Dart_IsolateCleanupCallback cb)
Definition: isolate.h:1221
static intptr_t current_tag_offset()
Definition: isolate.h:1329
Random * random()
Definition: isolate.h:1191
static void SetInitializeCallback_(Dart_InitializeIsolateCallback cb)
Definition: isolate.h:1207
static Dart_IsolateGroupCreateCallback CreateGroupCallback()
Definition: isolate.h:1203
void CacheRegexpBacktrackStack(std::unique_ptr< VirtualMemory > stack)
Definition: isolate.h:1471
WeakTable * forward_table_old()
Definition: isolate.h:1461
void set_current_tag(const UserTag &tag)
Definition: isolate.cc:3222
bool IsDeoptimizing() const
Definition: isolate.h:1254
void set_has_attempted_stepping(bool value)
Definition: isolate.h:1424
void set_init_callback_data(void *value)
Definition: isolate.h:1067
Dart_MessageNotifyCallback message_notify_callback() const
Definition: isolate.h:1011
InstancePtr LookupServiceExtensionHandler(const String &name)
Definition: isolate.cc:3421
CatchEntryMovesCache * catch_entry_moves_cache()
Definition: isolate.h:1452
bool is_service_registered() const
Definition: isolate.h:1385
void set_name(const char *name)
Definition: isolate.cc:1977
static Dart_IsolateGroupCleanupCallback GroupCleanupCallback()
Definition: isolate.h:1231
static void SetGroupCleanupCallback(Dart_IsolateGroupCleanupCallback cb)
Definition: isolate.h:1228
std::unique_ptr< VirtualMemory > TakeRegexpBacktrackStack()
Definition: isolate.h:1467
WeakTable * forward_table_new()
Definition: isolate.h:1458
void FlagsCopyFrom(const Dart_IsolateFlags &api_flags)
Definition: isolate.cc:1674
void set_finalizers(const GrowableObjectArray &value)
Definition: isolate.cc:2001
void RemoveExitListener(const SendPort &listener)
Definition: isolate.cc:2283
uint64_t pause_capability() const
Definition: isolate.h:1056
static Isolate * LookupIsolateByPort(Dart_Port port)
Definition: isolate.cc:3549
static Dart_UnregisterKernelBlobCallback UnregisterKernelBlobCallback()
Definition: isolate.h:1245
bool NotifyErrorListeners(const char *msg, const char *stacktrace)
Definition: isolate.cc:2362
bool AllowClassFinalization()
Definition: isolate.h:1295
void init_loaded_prefixes_set_storage()
Definition: isolate.cc:2796
void Run()
Definition: isolate.cc:2411
void set_current_allocation_sample_block(SampleBlock *block)
Definition: isolate.h:1121
bool IsPaused() const
Definition: isolate.cc:2005
friend class Timeline
Definition: isolate.h:1758
friend Isolate * CreateWithinExistingIsolateGroup(IsolateGroup *g, const char *n, char **e)
void set_is_service_registered(bool value)
Definition: isolate.h:1388
void set_tag_table(const GrowableObjectArray &value)
Definition: isolate.cc:3218
void PauseEventHandler()
Definition: isolate.cc:3458
static Dart_InitializeIsolateCallback InitializeCallback()
Definition: isolate.h:1210
static void SetRegisterKernelBlobCallback(Dart_RegisterKernelBlobCallback cb)
Definition: isolate.h:1234
static void SetCreateGroupCallback(Dart_IsolateGroupCreateCallback cb)
Definition: isolate.h:1200
Dart_IsolateCleanupCallback on_cleanup_callback()
Definition: isolate.h:1028
friend class IsolateGroup
Definition: isolate.h:1759
DeoptContext * deopt_context() const
Definition: isolate.h:1255
Thread * mutator_thread() const
Definition: isolate.cc:1920
static intptr_t has_resumption_breakpoints_offset()
Definition: isolate.h:1144
void set_single_step(bool value)
Definition: isolate.h:1132
void set_default_tag(const UserTag &tag)
Definition: isolate.cc:3229
Dart_Port origin_id()
Definition: isolate.cc:1990
SampleBlock * current_allocation_sample_block() const
Definition: isolate.h:1118
void IncrementSpawnCount()
Definition: isolate.cc:3711
void set_origin_id(Dart_Port id)
Definition: isolate.cc:1995
bool IsScheduled()
Definition: isolate.h:991
static Dart_RegisterKernelBlobCallback RegisterKernelBlobCallback()
Definition: isolate.h:1238
void RemoveErrorListener(const SendPort &listener)
Definition: isolate.cc:2347
bool is_runnable() const
Definition: isolate.h:1095
void ProcessFreeSampleBlocks(Thread *thread)
void set_message_notify_callback(Dart_MessageNotifyCallback value)
Definition: isolate.h:1015
void set_pause_capability(uint64_t value)
Definition: isolate.h:1055
Dart_Port main_port() const
Definition: isolate.h:1048
static void SetUnregisterKernelBlobCallback(Dart_UnregisterKernelBlobCallback cb)
Definition: isolate.h:1241
bool has_resumption_breakpoints() const
Definition: isolate.h:1141
void set_is_vm_isolate(bool value)
Definition: isolate.h:1381
void SetStickyError(ErrorPtr sticky_error)
Definition: isolate.cc:2404
const char * name() const
Definition: isolate.h:1043
bool HasOpenNativeCallables()
Definition: isolate.cc:3811
void bequeath(std::unique_ptr< Bequest > bequest)
Definition: isolate.h:1032
LambdaCallable(T &lambda)
Definition: isolate.h:119
bool IsOwnedByCurrentThread() const
Definition: os_thread.h:371
MutatorThreadPool(IsolateGroup *isolate_group, intptr_t max_pool_size)
Definition: isolate.h:254
virtual ~MutatorThreadPool()
Definition: isolate.h:256
virtual void OnEnterIdleLocked(MonitorLocker *ml)
Definition: isolate.cc:278
NoActiveIsolateScope(Thread *thread)
Definition: isolate.h:1831
static int64_t GetCurrentTimeMillis()
T exchange(T arg, std::memory_order order=std::memory_order_relaxed)
Definition: atomic.h:48
ThreadState * thread() const
Definition: allocation.h:33
StartIsolateScope(Isolate *new_isolate)
Definition: isolate.h:1768
Zone * zone() const
Definition: thread_state.h:37
@ kUnknownTask
Definition: thread.h:346
static Thread * Current()
Definition: thread.h:362
static void ExitIsolateGroupAsHelper(bool bypass_safepoint)
Definition: thread.cc:499
Isolate * isolate() const
Definition: thread.h:534
IsolateGroup * isolate_group() const
Definition: thread.h:541
static void EnterIsolate(Isolate *isolate)
Definition: thread.cc:371
static void ExitIsolate(bool isolate_shutdown=false)
Definition: thread.cc:428
static bool EnterIsolateGroupAsHelper(IsolateGroup *isolate_group, TaskKind kind, bool bypass_safepoint)
Definition: thread.cc:481
void(* Dart_UnregisterKernelBlobCallback)(const char *kernel_blob_uri)
Definition: dart_api.h:894
Dart_Handle(* Dart_EnvironmentCallback)(Dart_Handle name)
Definition: dart_api.h:3278
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)
Definition: dart_api.h:654
void(* Dart_IsolateCleanupCallback)(void *isolate_group_data, void *isolate_data)
Definition: dart_api.h:729
int64_t Dart_Port
Definition: dart_api.h:1525
void(* Dart_MessageNotifyCallback)(Dart_Isolate destination_isolate)
Definition: dart_api.h:1546
const char *(* Dart_RegisterKernelBlobCallback)(const uint8_t *kernel_buffer, intptr_t kernel_buffer_size)
Definition: dart_api.h:882
#define DART_WARN_UNUSED_RESULT
Definition: dart_api.h:66
struct _Dart_Isolate * Dart_Isolate
Definition: dart_api.h:88
bool(* Dart_InitializeIsolateCallback)(void **child_isolate_data, char **error)
Definition: dart_api.h:693
void(* Dart_IsolateGroupCleanupCallback)(void *isolate_group_data)
Definition: dart_api.h:745
Dart_LibraryTag
Definition: dart_api.h:3419
void(* Dart_IsolateShutdownCallback)(void *isolate_group_data, void *isolate_data)
Definition: dart_api.h:711
Dart_Handle(* Dart_LibraryTagHandler)(Dart_LibraryTag tag, Dart_Handle library_or_package_map_url, Dart_Handle url)
Definition: dart_api.h:3456
Dart_Handle(* Dart_DeferredLoadHandler)(intptr_t loading_unit_id)
Definition: dart_api.h:3491
#define ASSERT(E)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
uint8_t value
GAsyncResult * result
uint32_t * target
constexpr intptr_t kDefaultOptimizationCounterThreshold
Definition: flag_list.h:23
Dart_NativeFunction function
Definition: fuchsia.cc:51
#define ISOLATE_METRIC_VARIABLE(type, variable, name, unit)
Definition: isolate.h:1646
#define DECLARE_BIT(Name)
Definition: isolate.h:1583
#define BOOL_ISOLATE_FLAG_LIST(V)
Definition: isolate.h:152
#define ISOLATE_METRIC_ACCESSOR(type, variable, name, unit)
Definition: isolate.h:1337
#define BOOL_ISOLATE_GROUP_FLAG_LIST(V)
Definition: isolate.h:136
#define ISOLATE_GROUP_FLAG_BITS(V)
Definition: isolate.h:792
#define DECLARE_GETTER(when, name, bitname, isolate_flag_name, flag_name)
Definition: isolate.h:1411
#define DECLARE_BITFIELD(Name)
Definition: isolate.h:1588
#define REUSABLE_FRIEND_DECLARATION(name)
Definition: isolate.h:1743
#define ISOLATE_FLAG_BITS(V)
Definition: isolate.h:1569
void Log(const char *format,...) SK_PRINTF_LIKE(1
Definition: TestRunner.cpp:137
static void Shutdown(Dart_NativeArguments args)
Definition: dart_vm.cc:33
FixedCache< intptr_t, ExceptionHandlerInfo, 16 > HandlerInfoCache
Definition: isolate.h:128
uintptr_t uword
Definition: globals.h:501
FixedCache< intptr_t, CatchEntryMovesRefPtr, 16 > CatchEntryMovesCache
Definition: isolate.h:130
ValidationPolicy
Definition: thread.h:271
constexpr intptr_t kWordSize
Definition: globals.h:509
COMPILE_ASSERT(kUnreachableReference==WeakTable::kNoValue)
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
Definition: switches.h:87
std::function< void(const T &message, const MessageReply< T > &reply)> MessageHandler
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
Definition: switches.h:259
std::function< void()> closure
Definition: closure.h:14
SI auto map(std::index_sequence< I... >, Fn &&fn, const Args &... args) -> skvx::Vec< sizeof...(I), decltype(fn(args[0]...))>
Definition: SkVx.h:680
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: globals.h:581
static DecodeResult decode(std::string path)
Definition: png_codec.cpp:124
#define T
Definition: precompiler.cc:65
#define REUSABLE_HANDLE_LIST(V)
Definition: thread.h:78
#define NOT_IN_PRECOMPILED(code)
Definition: globals.h:100
#define NOT_IN_PRODUCT(code)
Definition: globals.h:84
#define OFFSET_OF(type, field)
Definition: globals.h:138