Index: src/heap.h |
diff --git a/src/heap.h b/src/heap.h |
index 5eefc1cf0cd22f2105ff56a249f6be809999f60f..5bb0c6269a6957b8597c35ab7498e18265de9577 100644 |
--- a/src/heap.h |
+++ b/src/heap.h |
@@ -2339,37 +2339,40 @@ class VerifyPointersVisitor: public ObjectVisitor { |
}; |
-// Space iterator for iterating over all spaces of the heap. |
-// Returns each space in turn, and null when it is done. |
+// Space iterator for iterating over all spaces of the heap. Returns each space |
+// in turn, and null when it is done. |
class AllSpaces BASE_EMBEDDED { |
public: |
+ explicit AllSpaces(Heap* heap) : heap_(heap), counter_(FIRST_SPACE) {} |
Space* next(); |
- AllSpaces() { counter_ = FIRST_SPACE; } |
private: |
+ Heap* heap_; |
int counter_; |
}; |
// Space iterator for iterating over all old spaces of the heap: Old pointer |
-// space, old data space and code space. |
-// Returns each space in turn, and null when it is done. |
+// space, old data space and code space. Returns each space in turn, and null |
+// when it is done. |
class OldSpaces BASE_EMBEDDED { |
public: |
+ explicit OldSpaces(Heap* heap) : heap_(heap), counter_(OLD_POINTER_SPACE) {} |
OldSpace* next(); |
- OldSpaces() { counter_ = OLD_POINTER_SPACE; } |
private: |
+ Heap* heap_; |
int counter_; |
}; |
-// Space iterator for iterating over all the paged spaces of the heap: |
-// Map space, old pointer space, old data space, code space and cell space. |
-// Returns each space in turn, and null when it is done. |
+// Space iterator for iterating over all the paged spaces of the heap: Map |
+// space, old pointer space, old data space, code space and cell space. Returns |
+// each space in turn, and null when it is done. |
class PagedSpaces BASE_EMBEDDED { |
public: |
+ explicit PagedSpaces(Heap* heap) : heap_(heap), counter_(OLD_POINTER_SPACE) {} |
PagedSpace* next(); |
- PagedSpaces() { counter_ = OLD_POINTER_SPACE; } |
private: |
+ Heap* heap_; |
int counter_; |
}; |
@@ -2379,14 +2382,15 @@ class PagedSpaces BASE_EMBEDDED { |
// returned object iterators is handled by the space iterator. |
class SpaceIterator : public Malloced { |
public: |
- SpaceIterator(); |
- explicit SpaceIterator(HeapObjectCallback size_func); |
+ explicit SpaceIterator(Heap* heap); |
+ SpaceIterator(Heap* heap, HeapObjectCallback size_func); |
virtual ~SpaceIterator(); |
bool has_next(); |
ObjectIterator* next(); |
private: |
+ Heap* heap_; |
Michael Starzinger
2013/02/11 12:32:01
Move this down two lines to after the method decla
Sven Panne
2013/02/11 12:50:00
Done.
|
ObjectIterator* CreateIterator(); |
int current_space_; // from enum AllocationSpace. |
@@ -2413,8 +2417,8 @@ class HeapIterator BASE_EMBEDDED { |
kFilterUnreachable |
}; |
- HeapIterator(); |
- explicit HeapIterator(HeapObjectsFiltering filtering); |
+ explicit HeapIterator(Heap* heap); |
+ HeapIterator(Heap* heap, HeapObjectsFiltering filtering); |
~HeapIterator(); |
HeapObject* next(); |
@@ -2427,6 +2431,7 @@ class HeapIterator BASE_EMBEDDED { |
void Shutdown(); |
HeapObject* NextObject(); |
+ Heap* heap_; |
HeapObjectsFiltering filtering_; |
HeapObjectsFilter* filter_; |
// Space iterator for iterating all the spaces. |