5#ifndef RUNTIME_VM_HEAP_PAGE_H_
6#define RUNTIME_VM_HEAP_PAGE_H_
19class ObjectPointerVisitor;
21class UnwindingRecords;
90 flags_ &= ~kEvacuationCandidate;
98 flags_ &= ~kNeverEvacuate;
119 if (owner_ !=
nullptr)
return owner_->
top();
163 ASSERT(obj->IsHeapObject());
191#if defined(DART_COMPRESSED_POINTERS)
200 bool only_marked =
false);
217 ASSERT(owner_ ==
nullptr);
228 uword old_top = top_;
230 top_.
store(new_top, std::memory_order_release);
234#if !defined(PRODUCT) || defined(FORCE_INCLUDE_SAMPLING_HEAP_PROFILER)
237 ASSERT(new_top >= old_top);
238 return new_top - old_top;
241 if (owner_ !=
nullptr) {
247 ASSERT(owner_ ==
nullptr);
250 if (
LIKELY(new_top <= end_)) {
263 while (cursor <
end) {
277 if (card_table_ ==
nullptr) {
279 size_t size_in_bytes =
282 reinterpret_cast<uword*
>(
calloc(size_in_bytes,
sizeof(uint8_t)));
284 intptr_t
offset = slot -
reinterpret_cast<uword>(
this);
289 uword bit_mask =
static_cast<uword>(1) << bit_offset;
290 reinterpret_cast<std::atomic<uword>*
>(&card_table_[word_offset])
291 ->fetch_or(bit_mask, std::memory_order_relaxed);
295 if (card_table_ ==
nullptr) {
298 intptr_t
offset = slot -
reinterpret_cast<uword>(
this);
303 uword bit_mask =
static_cast<uword>(1) << bit_offset;
304 return (card_table_[word_offset] & bit_mask) != 0;
320 VirtualMemory* memory_;
322 ForwardingPage* forwarding_page_;
324 RelaxedAtomic<intptr_t> progress_bar_;
332 RelaxedAtomic<uword> top_;
335 RelaxedAtomic<uword> end_;
344 RelaxedAtomic<intptr_t> live_bytes_;
void HandleReleasedTLAB(Thread *thread)
uword TryAllocateGC(intptr_t size)
static constexpr intptr_t kSlotsPerCard
static constexpr intptr_t kBytesPerCardLog2
bool Contains(uword addr) const
static intptr_t CachedSize()
uword object_start() const
bool IsCardRemembered(ObjectPtr const *slot)
uword promo_candidate_words() const
void AllocateForwardingPage()
ForwardingPage * forwarding_page() const
void set_next(Page *next)
static intptr_t card_table_offset()
static constexpr intptr_t OldObjectStartOffset()
intptr_t card_table_size() const
void add_live_bytes(intptr_t value)
static Page * Of(uword addr)
static Page * Of(ObjectPtr obj)
static Page * Of(void *addr)
bool IsSurvivor(uword raw_addr) const
uword original_top() const
static constexpr intptr_t NewObjectStartOffset()
uword original_end() const
void VisitObjects(ObjectVisitor *visitor) const
void RememberCard(ObjectPtr const *slot)
void VisitRememberedCards(PredicateObjectPointerVisitor *visitor, bool only_marked=false)
void Acquire(Thread *thread)
void set_evacuation_candidate(bool value)
void UnregisterUnwindingRecords()
void VisitObjectsUnsafe(ObjectVisitor *visitor) const
static intptr_t original_top_offset()
bool is_never_evacuate() const
uword new_object_start() const
void WriteProtect(bool read_only)
void VisitObjectPointers(ObjectPointerVisitor *visitor) const
bool is_executable() const
static intptr_t original_end_offset()
intptr_t live_bytes() const
bool is_evacuation_candidate() const
void Unallocate(uword addr, intptr_t size)
void sub_live_bytes(intptr_t value)
bool is_vm_isolate() const
uword old_object_start() const
static constexpr intptr_t kSlotsPerCardLog2
void RegisterUnwindingRecords()
void set_never_evacuate(bool value)
void set_live_bytes(intptr_t value)
intptr_t Release(Thread *thread)
T load(std::memory_order order=std::memory_order_relaxed) const
void store(T arg, std::memory_order order=std::memory_order_relaxed)
static Thread * Current()
void set_true_end(uword true_end)
HeapProfileSampler & heap_sampler()
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
bool Contains(uword addr) const
FlutterSemanticsFlag flags
constexpr intptr_t kBitsPerWordLog2
static constexpr intptr_t kCardsPerInterruptCheck
constexpr intptr_t kBitsPerByteLog2
static constexpr intptr_t kOldObjectAlignmentOffset
static constexpr intptr_t kObjectStartAlignment
static constexpr intptr_t kNewObjectAlignmentOffset
static constexpr intptr_t kCompressedWordSizeLog2
static constexpr intptr_t kPageSizeInWords
constexpr intptr_t kBitsPerWord
static constexpr intptr_t kAllocationCanary
static constexpr intptr_t kPageSize
static constexpr intptr_t kBlockSize
static constexpr intptr_t kSlotsPerInterruptCheck
static constexpr intptr_t kBitVectorWordsPerBlock
static constexpr intptr_t kBlockMask
static constexpr intptr_t kObjectAlignmentMask
void * calloc(size_t n, size_t size)
static constexpr intptr_t kAllocationRedZoneSize
constexpr intptr_t kWordSize
static constexpr intptr_t kPageMask
static constexpr intptr_t kObjectAlignment
static constexpr intptr_t kBlocksPerPage
ObjectPtr CompressedObjectPtr
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 OFFSET_OF(type, field)