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

Unified Diff: runtime/vm/heap.h

Issue 251373012: Add Heap::isolate_ to simplify code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 | runtime/vm/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.h
===================================================================
--- runtime/vm/heap.h (revision 35410)
+++ runtime/vm/heap.h (working copy)
@@ -117,18 +117,18 @@
bool StubCodeContains(uword addr) const;
// Visit all pointers.
- void IteratePointers(ObjectPointerVisitor* visitor);
+ void IteratePointers(ObjectPointerVisitor* visitor) const;
// Visit all pointers in the space.
- void IterateNewPointers(ObjectPointerVisitor* visitor);
- void IterateOldPointers(ObjectPointerVisitor* visitor);
+ void IterateNewPointers(ObjectPointerVisitor* visitor) const;
+ void IterateOldPointers(ObjectPointerVisitor* visitor) const;
// Visit all objects.
- void IterateObjects(ObjectVisitor* visitor);
+ void IterateObjects(ObjectVisitor* visitor) const;
// Visit all object in the space.
- void IterateNewObjects(ObjectVisitor* visitor);
- void IterateOldObjects(ObjectVisitor* visitor);
+ void IterateNewObjects(ObjectVisitor* visitor) const;
+ void IterateOldObjects(ObjectVisitor* visitor) const;
// Find an object by visiting all pointers in the specified heap space,
// the 'visitor' is used to determine if an object is found or not.
@@ -249,6 +249,8 @@
return old_space_->PrintHeapMapToJSONStream(isolate, stream);
}
+ Isolate* isolate() const { return isolate_; }
+
private:
class GCStats : public ValueObject {
public:
@@ -282,7 +284,9 @@
static const intptr_t kNewAllocatableSize = 256 * KB;
- Heap(intptr_t max_new_gen_words, intptr_t max_old_gen_words);
+ Heap(Isolate* isolate,
+ intptr_t max_new_gen_words,
+ intptr_t max_old_gen_words);
uword AllocateNew(intptr_t size);
uword AllocateOld(intptr_t size, HeapPage::PageType type);
@@ -298,6 +302,8 @@
// of this heap.
void GetMergedAddressRange(uword* start, uword* end) const;
+ Isolate* isolate_;
+
// The different spaces used for allocation.
Scavenger* new_space_;
PageSpace* old_space_;
« no previous file with comments | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698