63 const bool compressed = !executable;
64 const char*
name = executable ?
"dart-code" :
"dart-heap";
66 VirtualMemory* memory =
nullptr;
80 if (memory ==
nullptr) {
84 if (memory ==
nullptr) {
93 uword* cursor =
reinterpret_cast<uword*
>(memory->address());
95 while (cursor <
end) {
104 Page*
result =
reinterpret_cast<Page*
>(memory->address());
109 result->forwarding_page_ =
nullptr;
110 result->card_table_ =
nullptr;
111 result->progress_bar_ = 0;
115 result->survivor_end_ = 0;
116 result->resolved_top_ = 0;
125 result->survivor_end_ = top;
126 result->resolved_top_ = top;
134void Page::Deallocate() {
147 VirtualMemory* memory = memory_;
157 intptr_t
size = memory->size();
159 if ((flags_ &
kNew) != 0) {
180 while (obj_addr < end_addr) {
185 ASSERT(obj_addr == end_addr);
191 while (obj_addr < end_addr) {
205 while (obj_addr < end_addr) {
209 ASSERT(obj_addr == end_addr);
219 if (card_table_ ==
nullptr) {
225 ASSERT(obj->IsArray() || obj->IsImmutableArray());
226 ASSERT(obj->untag()->IsCardRemembered());
227 if (only_marked && !obj->untag()->IsMarked())
return;
234 const size_t size_in_words =
237 const size_t word_offset = progress_bar_.
fetch_add(1);
238 if (word_offset >= size_in_words)
break;
240 uword cell = card_table_[word_offset];
241 if (cell == 0)
continue;
243 for (intptr_t bit_offset = 0; bit_offset <
kBitsPerWord; bit_offset++) {
244 const uword bit_mask =
static_cast<uword>(1) << bit_offset;
245 if ((cell & bit_mask) == 0)
continue;
256 if (card_from < obj_from) {
258 card_from = obj_from;
260 if (card_to > obj_to) {
267 heap_base, card_from, card_to);
269 if (!has_new_target) {
273 card_table_[word_offset] = cell;
static constexpr uint8_t kZapByte
UntaggedObject * untag() const
virtual void VisitObject(ObjectPtr obj)=0
static intptr_t CachedSize()
uword object_start() const
intptr_t card_table_size() const
void VisitObjects(ObjectVisitor *visitor) const
void VisitRememberedCards(PredicateObjectPointerVisitor *visitor, bool only_marked=false)
void VisitObjectsUnsafe(ObjectVisitor *visitor) const
void WriteProtect(bool read_only)
void VisitObjectPointers(ObjectPointerVisitor *visitor) const
bool is_executable() const
static constexpr intptr_t kSlotsPerCardLog2
bool PredicateVisitCompressedPointers(uword heap_base, CompressedObjectPtr *first, CompressedObjectPtr *last)
T fetch_add(T arg, std::memory_order order=std::memory_order_relaxed)
@ kIncrementalCompactorTask
static Thread * Current()
static ObjectPtr FromAddr(uword addr)
intptr_t HeapSize() const
intptr_t VisitPointers(ObjectPointerVisitor *visitor)
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
static VirtualMemory * AllocateAligned(intptr_t size, intptr_t alignment, bool is_executable, bool is_compressed, const char *name)
static void Protect(void *address, intptr_t size, Protection mode)
FlutterSemanticsFlag flags
#define LSAN_UNREGISTER_ROOT_REGION(ptr, len)
#define LSAN_REGISTER_ROOT_REGION(ptr, len)
#define MSAN_POISON(ptr, len)
#define MSAN_UNPOISON(ptr, len)
constexpr intptr_t kBitsPerWordLog2
static VirtualMemory * page_cache[kPageCacheCapacity]
static constexpr intptr_t kNewObjectAlignmentOffset
static Mutex * page_cache_mutex
constexpr intptr_t kBitsPerWord
static constexpr intptr_t kAllocationCanary
static constexpr intptr_t kPageSize
static bool CanUseCache(uword flags)
static intptr_t page_cache_size
static constexpr intptr_t kAllocationRedZoneSize
constexpr intptr_t kWordSize
static constexpr intptr_t kPageCacheCapacity
NOT_IN_PRODUCT(LibraryPtr ReloadTestScript(const char *script))
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