Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Unified Diff: src/heap/spaces.h

Issue 2377513007: [heap] Decouple SpaceIterator from ObjectIterator. (Closed)
Patch Set: rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index 5832cc68559a1ed5c11dd5feeed53f12e2129fad..99dd378bbe0b2b2af5c097278b14dade084ed669 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -943,6 +943,8 @@ class Space : public Malloced {
}
}
+ virtual std::unique_ptr<ObjectIterator> GetObjectIterator() = 0;
+
void AccountCommitted(intptr_t bytes) {
DCHECK_GE(bytes, 0);
committed_ += bytes;
@@ -2154,6 +2156,8 @@ class PagedSpace : public Space {
// using the high water mark.
void ShrinkImmortalImmovablePages();
+ std::unique_ptr<ObjectIterator> GetObjectIterator() override;
+
protected:
// PagedSpaces that should be included in snapshots have different, i.e.,
// smaller, initial pages.
@@ -2329,6 +2333,11 @@ class SemiSpace : public Space {
return 0;
}
+ iterator begin() { return iterator(anchor_.next_page()); }
+ iterator end() { return iterator(anchor()); }
+
+ std::unique_ptr<ObjectIterator> GetObjectIterator() override;
+
#ifdef DEBUG
void Print() override;
// Validate a range of of addresses in a SemiSpace.
@@ -2344,9 +2353,6 @@ class SemiSpace : public Space {
virtual void Verify();
#endif
- iterator begin() { return iterator(anchor_.next_page()); }
- iterator end() { return iterator(anchor()); }
-
private:
void RewindPages(Page* start, int num_pages);
@@ -2648,6 +2654,8 @@ class NewSpace : public Space {
iterator begin() { return to_space_.begin(); }
iterator end() { return to_space_.end(); }
+ std::unique_ptr<ObjectIterator> GetObjectIterator() override;
+
private:
// Update allocation info to match the current to-space page.
void UpdateAllocationInfo();
@@ -2863,6 +2871,8 @@ class LargeObjectSpace : public Space {
iterator begin() { return iterator(first_page_); }
iterator end() { return iterator(nullptr); }
+ std::unique_ptr<ObjectIterator> GetObjectIterator() override;
+
#ifdef VERIFY_HEAP
virtual void Verify();
#endif
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698