61Page* Page::Allocate(intptr_t size,
uword flags) {
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;
124 result->survivor_end_ = top;
125 result->resolved_top_ = top;
133void Page::Deallocate() {
146 VirtualMemory* memory = memory_;
156 intptr_t
size = memory->size();
158 if ((flags_ &
kNew) != 0) {
178 while (obj_addr < end_addr) {
183 ASSERT(obj_addr == end_addr);
189 while (obj_addr < end_addr) {
203 while (obj_addr < end_addr) {
207 ASSERT(obj_addr == end_addr);
215 if (card_table_ ==
nullptr) {
221 ASSERT(obj->IsArray() || obj->IsImmutableArray());
222 ASSERT(obj->untag()->IsCardRemembered());
229 const size_t size_in_words =
232 const size_t word_offset = progress_bar_.
fetch_add(1);
233 if (word_offset >= size_in_words)
break;
235 uword cell = card_table_[word_offset];
236 if (cell == 0)
continue;
238 for (intptr_t bit_offset = 0; bit_offset <
kBitsPerWord; bit_offset++) {
239 const uword bit_mask =
static_cast<uword>(1) << bit_offset;
240 if ((cell & bit_mask) == 0)
continue;
251 if (card_from < obj_from) {
253 card_from = obj_from;
255 if (card_to > obj_to) {
263 bool has_new_target =
false;
265 if ((*slot)->IsNewObjectMayBeSmi()) {
266 has_new_target =
true;
270 if (!has_new_target) {
274 card_table_[word_offset] = cell;
static constexpr uint8_t kZapByte
void VisitCompressedPointers(uword heap_base, CompressedObjectPtr *first, CompressedObjectPtr *last)
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 VisitObjectsUnsafe(ObjectVisitor *visitor) const
void WriteProtect(bool read_only)
void VisitObjectPointers(ObjectPointerVisitor *visitor) const
bool is_executable() const
void VisitRememberedCards(ObjectPointerVisitor *visitor)
static constexpr intptr_t kSlotsPerCardLog2
T fetch_add(T arg, std::memory_order order=std::memory_order_relaxed)
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
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
#define NOT_IN_PRODUCT(code)