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

Unified Diff: src/heap/heap.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 | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
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 b09ed98e1444117338191cdd3518a8ccb0bef35c..60c2464f5a74e1386d6fee87927b1d12c043dd2d 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -2120,6 +2120,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_;
@@ -2428,23 +2430,17 @@ class PagedSpaces BASE_EMBEDDED {
};
-// Space iterator for iterating over all spaces of the heap.
-// For each space an object iterator is provided. The deallocation of the
-// returned object iterators is handled by the space iterator.
class SpaceIterator : public Malloced {
public:
explicit SpaceIterator(Heap* heap);
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.
};
@@ -2490,7 +2486,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698