Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
dart::Scavenger Class Reference

#include <scavenger.h>

Public Member Functions

 Scavenger (Heap *heap, intptr_t max_semi_capacity_in_words)
 
 ~Scavenger ()
 
bool Contains (uword addr) const
 
uword TryAllocate (Thread *thread, intptr_t size)
 
uword TryAllocateNoSafepoint (Thread *thread, intptr_t size)
 
intptr_t AbandonRemainingTLAB (Thread *thread)
 
void AbandonRemainingTLABForDebugging (Thread *thread)
 
void Scavenge (Thread *thread, GCType type, GCReason reason)
 
intptr_t UsedInWords () const
 
intptr_t CapacityInWords () const
 
intptr_t ExternalInWords () const
 
SpaceUsage GetCurrentUsage () const
 
intptr_t ThresholdInWords () const
 
void VisitObjects (ObjectVisitor *visitor) const
 
void VisitObjectPointers (ObjectPointerVisitor *visitor) const
 
void AddRegionsToObjectSet (ObjectSet *set) const
 
void WriteProtect (bool read_only)
 
bool ShouldPerformIdleScavenge (int64_t deadline)
 
void AddGCTime (int64_t micros)
 
int64_t gc_time_micros () const
 
void IncrementCollections ()
 
intptr_t collections () const
 
void PrintToJSONObject (JSONObject *object) const
 
bool AllocatedExternal (intptr_t size)
 
void FreedExternal (intptr_t size)
 
void set_freed_in_words (intptr_t value)
 
Pagehead () const
 
void Prune (MarkingStackBlock **from, MarkingStack *to)
 
void Forward (MarkingStack *stack)
 
void PruneWeak (GCLinkedLists *delayed)
 
template<typename Type , typename PtrType >
void PruneWeak (GCLinkedList< Type, PtrType > *list)
 

Static Public Member Functions

static intptr_t MaxMutatorThreadCount ()
 

Friends

template<bool >
class ScavengerVisitorBase
 

Detailed Description

Definition at line 124 of file scavenger.h.

Constructor & Destructor Documentation

◆ Scavenger()

dart::Scavenger::Scavenger ( Heap heap,
intptr_t  max_semi_capacity_in_words 
)

Definition at line 773 of file scavenger.cc.

774 : heap_(heap),
775 max_semi_capacity_in_words_(max_semi_capacity_in_words),
776 scavenge_words_per_micro_(kConservativeInitialScavengeSpeed) {
777 ASSERT(heap != nullptr);
778
779 // Verify assumptions about the first word in objects which the scavenger is
780 // going to use for forwarding pointers.
782
783 // Set initial semi space size in words.
784 const intptr_t initial_semi_capacity_in_words = Utils::Minimum(
785 max_semi_capacity_in_words, FLAG_new_gen_semi_initial_size * MBInWords);
786
787 to_ = new SemiSpace(initial_semi_capacity_in_words);
788 idle_scavenge_threshold_in_words_ = initial_semi_capacity_in_words;
789
790 UpdateMaxHeapCapacity();
791 UpdateMaxHeapUsage();
792}
static intptr_t tags_offset()
Definition object.h:346
static T Minimum(T x, T y)
Definition utils.h:21
#define ASSERT(E)
static constexpr intptr_t kConservativeInitialScavengeSpeed
Definition scavenger.cc:771
constexpr intptr_t MBInWords
Definition globals.h:537

◆ ~Scavenger()

dart::Scavenger::~Scavenger ( )

Definition at line 794 of file scavenger.cc.

794 {
795 ASSERT(!scavenging_);
796 delete to_;
797 ASSERT(blocks_ == nullptr);
798}

Member Function Documentation

◆ AbandonRemainingTLAB()

intptr_t dart::Scavenger::AbandonRemainingTLAB ( Thread thread)

Definition at line 1690 of file scavenger.cc.

1690 {
1691 if (thread->top() == 0) return 0;
1692
1693 Page* page = Page::Of(thread->top() - 1);
1694 intptr_t allocated;
1695 {
1696 if (thread->is_marking()) {
1697 thread->DeferredMarkLiveTemporaries();
1698 }
1699 MutexLocker ml(&space_lock_);
1700 allocated = page->Release(thread);
1701 }
1702 ASSERT(thread->top() == 0);
1703 return allocated;
1704}
static Page * Of(ObjectPtr obj)
Definition page.h:141

◆ AbandonRemainingTLABForDebugging()

void dart::Scavenger::AbandonRemainingTLABForDebugging ( Thread thread)

Definition at line 1677 of file scavenger.cc.

1677 {
1678 // Allocate any remaining space so the TLAB won't be reused. Write a filler
1679 // object so it remains iterable.
1680 uword top = thread->top();
1681 intptr_t size = thread->end() - thread->top();
1682 if (size > 0) {
1683 thread->set_top(top + size);
1685 }
1686
1687 AbandonRemainingTLAB(thread);
1688}
static ForwardingCorpse * AsForwarder(uword addr, intptr_t size)
Definition become.cc:20
intptr_t AbandonRemainingTLAB(Thread *thread)
uintptr_t uword
Definition globals.h:501
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

◆ AddGCTime()

void dart::Scavenger::AddGCTime ( int64_t  micros)
inline

Definition at line 187 of file scavenger.h.

187{ gc_time_micros_ += micros; }

◆ AddRegionsToObjectSet()

void dart::Scavenger::AddRegionsToObjectSet ( ObjectSet set) const

Definition at line 1620 of file scavenger.cc.

1620 {
1621 for (Page* page = to_->head(); page != nullptr; page = page->next()) {
1622 set->AddRegion(page->start(), page->end());
1623 }
1624}
Page * head() const
Definition scavenger.h:57
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
Definition switches.h:76

◆ AllocatedExternal()

bool dart::Scavenger::AllocatedExternal ( intptr_t  size)
inline

Definition at line 202 of file scavenger.h.

202 {
203 ASSERT(size >= 0);
204 intptr_t expected = external_size_.load();
205 intptr_t desired;
206 do {
207 intptr_t next_external_size_in_words =
208 (external_size_ >> kWordSizeLog2) + (size >> kWordSizeLog2);
209 if (next_external_size_in_words < 0 ||
210 next_external_size_in_words > kMaxAddrSpaceInWords) {
211 return false;
212 }
213 desired = expected + size;
214 ASSERT(desired >= 0);
215 } while (!external_size_.compare_exchange_weak(expected, desired));
216 return true;
217 }
T load(std::memory_order order=std::memory_order_relaxed) const
Definition atomic.h:21
bool compare_exchange_weak(T &expected, T desired, std::memory_order order=std::memory_order_relaxed)
Definition atomic.h:52
constexpr intptr_t kWordSizeLog2
Definition globals.h:507
const intptr_t kMaxAddrSpaceInWords
Definition globals.h:50

◆ CapacityInWords()

intptr_t dart::Scavenger::CapacityInWords ( ) const
inline

Definition at line 164 of file scavenger.h.

164 {
165 MutexLocker ml(&space_lock_);
166 return to_->capacity_in_words();
167 }
intptr_t capacity_in_words() const
Definition scavenger.h:54

◆ collections()

intptr_t dart::Scavenger::collections ( ) const
inline

Definition at line 193 of file scavenger.h.

193{ return collections_; }

◆ Contains()

bool dart::Scavenger::Contains ( uword  addr) const
inline

Definition at line 136 of file scavenger.h.

136{ return to_->Contains(addr); }
bool Contains(uword addr) const
Definition scavenger.cc:741

◆ ExternalInWords()

intptr_t dart::Scavenger::ExternalInWords ( ) const
inline

Definition at line 168 of file scavenger.h.

168{ return external_size_ >> kWordSizeLog2; }

◆ Forward()

void dart::Scavenger::Forward ( MarkingStack stack)

Definition at line 1465 of file scavenger.cc.

1465 {
1466 ASSERT(abort_);
1467
1468 class ReverseMarkStack : public ObjectPointerVisitor {
1469 public:
1470 explicit ReverseMarkStack(IsolateGroup* group)
1471 : ObjectPointerVisitor(group) {}
1472
1473 void VisitPointers(ObjectPtr* first, ObjectPtr* last) override {
1474 for (ObjectPtr* p = first; p <= last; p++) {
1475 ObjectPtr obj = *p;
1476#if defined(DEBUG)
1477 if (obj->IsNewObject()) {
1480 }
1481#endif
1482 if (obj->IsForwardingCorpse()) {
1483 // Promoted object was pushed to mark list but reversed.
1484 *p = reinterpret_cast<ForwardingCorpse*>(UntaggedObject::ToAddr(obj))
1485 ->target();
1486 }
1487 }
1488 }
1489#if defined(DART_COMPRESSED_POINTERS)
1490 void VisitCompressedPointers(uword heap_base,
1491 CompressedObjectPtr* first,
1492 CompressedObjectPtr* last) override {
1493 UNREACHABLE();
1494 }
1495#endif
1496 };
1497
1498 ReverseMarkStack visitor(heap_->isolate_group());
1499 marking_stack->VisitObjectPointers(&visitor);
1500}
#define UNREACHABLE()
Definition assert.h:248
IsolateGroup * isolate_group() const
Definition heap.h:273
uint32_t * target
static DART_FORCE_INLINE uword ReadHeaderRelaxed(ObjectPtr obj)
Definition scavenger.cc:118
static DART_FORCE_INLINE bool IsForwarding(uword header)
Definition scavenger.cc:66
static const char header[]
Definition skpbench.cpp:88

◆ FreedExternal()

void dart::Scavenger::FreedExternal ( intptr_t  size)
inline

Definition at line 218 of file scavenger.h.

218 {
219 ASSERT(size >= 0);
220 external_size_ -= size;
221 ASSERT(external_size_ >= 0);
222 }

◆ gc_time_micros()

int64_t dart::Scavenger::gc_time_micros ( ) const
inline

Definition at line 189 of file scavenger.h.

189{ return gc_time_micros_; }

◆ GetCurrentUsage()

SpaceUsage dart::Scavenger::GetCurrentUsage ( ) const
inline

Definition at line 169 of file scavenger.h.

169 {
170 SpaceUsage usage;
171 usage.used_in_words = UsedInWords();
172 usage.capacity_in_words = CapacityInWords();
173 usage.external_in_words = ExternalInWords();
174 return usage;
175 }
intptr_t ExternalInWords() const
Definition scavenger.h:168
intptr_t CapacityInWords() const
Definition scavenger.h:164
intptr_t UsedInWords() const
Definition scavenger.h:160
static void usage(char *argv0)

◆ head()

Page * dart::Scavenger::head ( ) const
inline

Definition at line 237 of file scavenger.h.

237{ return to_->head(); }

◆ IncrementCollections()

void dart::Scavenger::IncrementCollections ( )
inline

Definition at line 191 of file scavenger.h.

191{ collections_++; }

◆ MaxMutatorThreadCount()

static intptr_t dart::Scavenger::MaxMutatorThreadCount ( )
inlinestatic

Definition at line 228 of file scavenger.h.

228 {
229 // With a max new-space of 16 MB and 512kb TLABs we would allow up to 8
230 // mutator threads to run at the same time.
231 const intptr_t max_parallel_tlab_usage =
232 (FLAG_new_gen_semi_max_size * MB) / Scavenger::kTLABSize;
233 const intptr_t max_pool_size = max_parallel_tlab_usage / 4;
234 return max_pool_size > 0 ? max_pool_size : 1;
235 }
constexpr intptr_t MB
Definition globals.h:530

◆ PrintToJSONObject()

void dart::Scavenger::PrintToJSONObject ( JSONObject object) const

Definition at line 1955 of file scavenger.cc.

1955 {
1956 auto isolate_group = IsolateGroup::Current();
1957 ASSERT(isolate_group != nullptr);
1958 JSONObject space(object, "new");
1959 space.AddProperty("type", "HeapSpace");
1960 space.AddProperty("name", "new");
1961 space.AddProperty("vmName", "Scavenger");
1962 space.AddProperty("collections", collections());
1963 if (collections() > 0) {
1964 int64_t run_time = isolate_group->UptimeMicros();
1965 run_time = Utils::Maximum(run_time, static_cast<int64_t>(0));
1966 double run_time_millis = MicrosecondsToMilliseconds(run_time);
1967 double avg_time_between_collections =
1968 run_time_millis / static_cast<double>(collections());
1969 space.AddProperty("avgCollectionPeriodMillis",
1970 avg_time_between_collections);
1971 } else {
1972 space.AddProperty("avgCollectionPeriodMillis", 0.0);
1973 }
1974 space.AddProperty64("used", UsedInWords() * kWordSize);
1975 space.AddProperty64("capacity", CapacityInWords() * kWordSize);
1976 space.AddProperty64("external", ExternalInWords() * kWordSize);
1977 space.AddProperty("time", MicrosecondsToSeconds(gc_time_micros()));
1978}
static IsolateGroup * Current()
Definition isolate.h:534
int64_t gc_time_micros() const
Definition scavenger.h:189
intptr_t collections() const
Definition scavenger.h:193
static constexpr T Maximum(T x, T y)
Definition utils.h:26
constexpr double MicrosecondsToSeconds(int64_t micros)
Definition globals.h:571
constexpr intptr_t kWordSize
Definition globals.h:509
constexpr double MicrosecondsToMilliseconds(int64_t micros)
Definition globals.h:574

◆ Prune()

void dart::Scavenger::Prune ( MarkingStackBlock **  from,
MarkingStack to 
)

Definition at line 1502 of file scavenger.cc.

1502 {
1503 ASSERT(!abort_);
1504 TIMELINE_FUNCTION_GC_DURATION(Thread::Current(), "PruneMarkingStack");
1505 MarkingStackBlock* reading;
1506 MarkingStackBlock* writing = marking_stack->PopNonFullBlock();
1507 for (;;) {
1508 {
1509 MutexLocker ml(&space_lock_);
1510 reading = *source;
1511 if (reading == nullptr) break;
1512 *source = reading->next();
1513 }
1514 // Generated code appends to marking stacks; tell MemorySanitizer.
1515 MSAN_UNPOISON(reading, sizeof(*reading));
1516 while (!reading->IsEmpty()) {
1517 ObjectPtr obj = reading->Pop();
1518 ASSERT(obj->IsHeapObject());
1519 if (obj->IsNewObject()) {
1521 if (!IsForwarding(header)) continue;
1522 obj = ForwardedObj(header);
1523 }
1524 ASSERT(!obj->IsForwardingCorpse());
1525 ASSERT(!obj->IsFreeListElement());
1526 writing->Push(obj);
1527 if (writing->IsFull()) {
1528 marking_stack->PushBlock(writing);
1529 writing = marking_stack->PopNonFullBlock();
1530 }
1531 }
1532 reading->Reset();
1533 marking_stack->PushBlock(reading);
1534 }
1535 marking_stack->PushBlock(writing);
1536}
static Thread * Current()
Definition thread.h:361
SkBitmap source
Definition examples.cpp:28
#define MSAN_UNPOISON(ptr, len)
MarkingStack::Block MarkingStackBlock
static DART_FORCE_INLINE ObjectPtr ForwardedObj(uword header)
Definition scavenger.cc:73
#define TIMELINE_FUNCTION_GC_DURATION(thread, name)
Definition timeline.h:41

◆ PruneWeak() [1/2]

template<typename Type , typename PtrType >
void dart::Scavenger::PruneWeak ( GCLinkedList< Type, PtrType > *  list)

Definition at line 1548 of file scavenger.cc.

1548 {
1549 PtrType weak = list->Release();
1550 while (weak != Object::null()) {
1551 PtrType next;
1552 if (weak->IsOldObject()) {
1553 ASSERT(weak->GetClassId() == Type::kClassId);
1554 next = weak->untag()->next_seen_by_gc_.Decompress(weak->heap_base());
1555 weak->untag()->next_seen_by_gc_ = Type::null();
1556 list->Enqueue(weak);
1557 } else {
1559 if (IsForwarding(header)) {
1560 weak = static_cast<PtrType>(ForwardedObj(header));
1561 ASSERT(weak->GetClassId() == Type::kClassId);
1562 next = weak->untag()->next_seen_by_gc_.Decompress(weak->heap_base());
1563 weak->untag()->next_seen_by_gc_ = Type::null();
1564 list->Enqueue(weak);
1565 } else {
1566 // Collected in this scavenge.
1567 ASSERT(weak->GetClassId() == Type::kClassId);
1568 next = weak->untag()->next_seen_by_gc_.Decompress(weak->heap_base());
1569 }
1570 }
1571
1572 weak = next;
1573 }
1574}
static float next(float f)
static const ClassId kClassId
Definition object.h:606
static ObjectPtr null()
Definition object.h:433

◆ PruneWeak() [2/2]

void dart::Scavenger::PruneWeak ( GCLinkedLists delayed)

Definition at line 1538 of file scavenger.cc.

1538 {
1539 ASSERT(!abort_);
1541 PruneWeak(&deferred->weak_properties);
1542 PruneWeak(&deferred->weak_references);
1543 PruneWeak(&deferred->weak_arrays);
1544 PruneWeak(&deferred->finalizer_entries);
1545}
void PruneWeak(GCLinkedLists *delayed)

◆ Scavenge()

void dart::Scavenger::Scavenge ( Thread thread,
GCType  type,
GCReason  reason 
)

Definition at line 1728 of file scavenger.cc.

1728 {
1730
1731 ASSERT(thread->OwnsGCSafepoint());
1732
1733 // Scavenging is not reentrant. Make sure that is the case.
1734 ASSERT(!scavenging_);
1735 scavenging_ = true;
1736
1737 if (type == GCType::kEvacuate) {
1738 // Forces the next scavenge to promote all the objects in the new space.
1739 early_tenure_ = true;
1740 }
1741
1742 if (FLAG_verify_before_gc) {
1743 heap_->WaitForSweeperTasksAtSafepoint(thread);
1744 heap_->VerifyGC("Verifying before Scavenge",
1745 thread->is_marking() ? kAllowMarked : kForbidMarked);
1746 }
1747
1748 // Prepare for a scavenge.
1749 failed_to_promote_ = false;
1750 abort_ = false;
1751 root_slices_started_ = 0;
1752 weak_slices_started_ = 0;
1753 freed_in_words_ = 0;
1754 intptr_t abandoned_bytes = 0; // TODO(rmacnak): Count fragmentation?
1755 SpaceUsage usage_before = GetCurrentUsage();
1756 intptr_t promo_candidate_words = 0;
1757 for (Page* page = to_->head(); page != nullptr; page = page->next()) {
1758 page->Release();
1759 if (early_tenure_) {
1760 page->EarlyTenure();
1761 }
1762 promo_candidate_words += page->promo_candidate_words();
1763 }
1765 SemiSpace* from = Prologue(reason);
1766
1767 intptr_t bytes_promoted;
1768 if (FLAG_scavenger_tasks == 0) {
1769 bytes_promoted = SerialScavenge(from);
1770 } else {
1771 bytes_promoted = ParallelScavenge(from);
1772 }
1773 if (abort_) {
1774 ReverseScavenge(&from);
1775 bytes_promoted = 0;
1776 } else {
1777 if ((ThresholdInWords() - UsedInWords()) < KBInWords) {
1778 // Don't scavenge again until the next old-space GC has occurred. Prevents
1779 // performing one scavenge per allocation as the heap limit is approached.
1780 heap_->assume_scavenge_will_fail_ = true;
1781 }
1782 }
1783 ASSERT(promotion_stack_.IsEmpty());
1785
1786 // Scavenge finished. Run accounting.
1788 stats_history_.Add(ScavengeStats(
1789 start, end, usage_before, GetCurrentUsage(), promo_candidate_words,
1790 bytes_promoted >> kWordSizeLog2, abandoned_bytes >> kWordSizeLog2));
1791 Epilogue(from);
1792
1793 if (FLAG_verify_after_gc) {
1794 heap_->WaitForSweeperTasksAtSafepoint(thread);
1795 heap_->VerifyGC("Verifying after Scavenge...",
1796 thread->is_marking() ? kAllowMarked : kForbidMarked);
1797 }
1798
1799 // Done scavenging. Reset the marker.
1800 ASSERT(scavenging_);
1801 scavenging_ = false;
1802
1803 // It is possible for objects to stay in the new space
1804 // if the VM cannot create more pages for these objects.
1805 ASSERT((type != GCType::kEvacuate) || (UsedInWords() == 0) ||
1806 failed_to_promote_);
1807}
PageSpace * old_space()
Definition heap.h:63
void WaitForSweeperTasksAtSafepoint(Thread *thread)
Definition heap.cc:669
static int64_t GetCurrentMonotonicMicros()
void ResumeConcurrentMarking()
Definition pages.cc:446
void PauseConcurrentMarking()
Definition pages.cc:437
SpaceUsage GetCurrentUsage() const
Definition scavenger.h:169
intptr_t ThresholdInWords() const
Definition scavenger.h:176
glong glong end
@ kAllowMarked
Definition verifier.h:21
@ kForbidMarked
Definition verifier.h:21
constexpr intptr_t KBInWords
Definition globals.h:535

◆ set_freed_in_words()

void dart::Scavenger::set_freed_in_words ( intptr_t  value)
inline

Definition at line 224 of file scavenger.h.

224{ freed_in_words_ = value; }
uint8_t value

◆ ShouldPerformIdleScavenge()

bool dart::Scavenger::ShouldPerformIdleScavenge ( int64_t  deadline)

Definition at line 1111 of file scavenger.cc.

1111 {
1112 // To make a consistent decision, we should not yield for a safepoint in the
1113 // middle of deciding whether to perform an idle GC.
1114 NoSafepointScope no_safepoint;
1115
1116 // TODO(rmacnak): Investigate collecting a history of idle period durations.
1117 intptr_t used_in_words = UsedInWords() + freed_in_words_;
1118 intptr_t external_in_words = ExternalInWords();
1119 // Normal reason: new space is getting full.
1120 bool for_new_space = (used_in_words >= idle_scavenge_threshold_in_words_) ||
1121 (external_in_words >= idle_scavenge_threshold_in_words_);
1122 if (!for_new_space) {
1123 return false;
1124 }
1125
1126 int64_t estimated_scavenge_completion =
1128 used_in_words / scavenge_words_per_micro_;
1129 return estimated_scavenge_completion <= deadline;
1130}

◆ ThresholdInWords()

intptr_t dart::Scavenger::ThresholdInWords ( ) const
inline

Definition at line 176 of file scavenger.h.

176{ return to_->gc_threshold_in_words(); }
intptr_t gc_threshold_in_words() const
Definition scavenger.h:55

◆ TryAllocate()

uword dart::Scavenger::TryAllocate ( Thread thread,
intptr_t  size 
)
inline

Definition at line 138 of file scavenger.h.

138 {
139 uword addr = TryAllocateFromTLAB(thread, size);
140 if (LIKELY(addr != 0)) {
141 return addr;
142 }
143 TryAllocateNewTLAB(thread, size, true);
144 return TryAllocateFromTLAB(thread, size);
145 }
#define LIKELY(cond)
Definition globals.h:260

◆ TryAllocateNoSafepoint()

uword dart::Scavenger::TryAllocateNoSafepoint ( Thread thread,
intptr_t  size 
)
inline

Definition at line 146 of file scavenger.h.

146 {
147 uword addr = TryAllocateFromTLAB(thread, size);
148 if (LIKELY(addr != 0)) {
149 return addr;
150 }
151 TryAllocateNewTLAB(thread, size, false);
152 return TryAllocateFromTLAB(thread, size);
153 }

◆ UsedInWords()

intptr_t dart::Scavenger::UsedInWords ( ) const
inline

Definition at line 160 of file scavenger.h.

160 {
161 MutexLocker ml(&space_lock_);
162 return to_->used_in_words() - freed_in_words_;
163 }
intptr_t used_in_words() const
Definition scavenger.h:47

◆ VisitObjectPointers()

void dart::Scavenger::VisitObjectPointers ( ObjectPointerVisitor visitor) const

Definition at line 1603 of file scavenger.cc.

1603 {
1604 ASSERT(Thread::Current()->OwnsGCSafepoint() ||
1605 (Thread::Current()->task_kind() == Thread::kMarkerTask) ||
1606 (Thread::Current()->task_kind() == Thread::kCompactorTask));
1607 for (Page* page = to_->head(); page != nullptr; page = page->next()) {
1608 page->VisitObjectPointers(visitor);
1609 }
1610}
@ kCompactorTask
Definition thread.h:351

◆ VisitObjects()

void dart::Scavenger::VisitObjects ( ObjectVisitor visitor) const

Definition at line 1612 of file scavenger.cc.

1612 {
1613 ASSERT(Thread::Current()->OwnsGCSafepoint() ||
1614 (Thread::Current()->task_kind() == Thread::kMarkerTask));
1615 for (Page* page = to_->head(); page != nullptr; page = page->next()) {
1616 page->VisitObjects(visitor);
1617 }
1618}

◆ WriteProtect()

void dart::Scavenger::WriteProtect ( bool  read_only)

Definition at line 1949 of file scavenger.cc.

1949 {
1950 ASSERT(!scavenging_);
1951 to_->WriteProtect(read_only);
1952}
void WriteProtect(bool read_only)
Definition scavenger.cc:748

Friends And Related Symbol Documentation

◆ ScavengerVisitorBase

template<bool >
friend class ScavengerVisitorBase
friend

Definition at line 335 of file scavenger.h.


The documentation for this class was generated from the following files: