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

Unified Diff: src/heap/heap.h

Issue 2377513007: [heap] Decouple SpaceIterator from ObjectIterator. (Closed)
Patch Set: 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 | « no previous file | src/heap/heap.cc » ('j') | src/heap/spaces.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 55914d66c0169f8d49c123b4aacfae65dd123742..5596607d9f5d136725f22f57643670a7402a03d2 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -2132,6 +2132,8 @@ class Heap {
OldSpace* code_space_;
MapSpace* map_space_;
LargeObjectSpace* lo_space_;
+ // Map from the space id to the space.
+ Space* space_[LAST_SPACE + 1];
HeapState gc_state_;
int gc_post_processing_depth_;
Address new_space_top_after_last_gc_;
@@ -2464,14 +2466,11 @@ class SpaceIterator : public Malloced {
virtual ~SpaceIterator();
bool has_next();
- ObjectIterator* next();
+ Space* next();
private:
- ObjectIterator* CreateIterator();
-
Heap* heap_;
int current_space_; // from enum AllocationSpace.
- ObjectIterator* iterator_; // object iterator for the current space.
};
@@ -2517,7 +2516,7 @@ class HeapIterator BASE_EMBEDDED {
// Space iterator for iterating all the spaces.
SpaceIterator* space_iterator_;
// Object iterator for the space currently being iterated.
- ObjectIterator* object_iterator_;
+ std::unique_ptr<ObjectIterator> object_iterator_;
};
// Abstract base class for checking whether a weak object should be retained.
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | src/heap/spaces.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698