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

Unified Diff: runtime/vm/heap.h

Issue 1235433004: VM: Inline Scavenger and PageSpace objects into Heap. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
Index: runtime/vm/heap.h
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index 43858837d33cfb7ea2bf7aeddaa5614f3a84cc77..a2cc3301316ca3d12582f7fb2505e381cf8472ce 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -68,8 +68,8 @@ class Heap {
~Heap();
- Scavenger* new_space() const { return new_space_; }
- PageSpace* old_space() const { return old_space_; }
+ Scavenger* new_space() { return &new_space_; }
+ PageSpace* old_space() { return &old_space_; }
uword Allocate(intptr_t size, Space space) {
ASSERT(!read_only_);
@@ -136,7 +136,7 @@ class Heap {
// Protect access to the heap.
void WriteProtect(bool read_only);
void WriteProtectCode(bool read_only) {
- old_space_->WriteProtectCode(read_only);
+ old_space_.WriteProtectCode(read_only);
}
// Accessors for inlined allocation in generated code.
@@ -228,8 +228,8 @@ class Heap {
void PrintToJSONObject(Space space, JSONObject* object) const;
// The heap map contains the sizes and class ids for the objects in each page.
- void PrintHeapMapToJSONStream(Isolate* isolate, JSONStream* stream) const {
- return old_space_->PrintHeapMapToJSONStream(isolate, stream);
+ void PrintHeapMapToJSONStream(Isolate* isolate, JSONStream* stream) {
+ return old_space_.PrintHeapMapToJSONStream(isolate, stream);
}
Isolate* isolate() const { return isolate_; }
@@ -305,8 +305,8 @@ class Heap {
Isolate* isolate_;
// The different spaces used for allocation.
- Scavenger* new_space_;
- PageSpace* old_space_;
+ Scavenger new_space_;
+ PageSpace old_space_;
WeakTable* new_weak_tables_[kNumWeakSelectors];
WeakTable* old_weak_tables_[kNumWeakSelectors];
@@ -323,7 +323,6 @@ class Heap {
int pretenure_policy_;
friend class ServiceEvent;
- friend class GCTestHelper;
friend class PageSpace; // VerifyGC
DISALLOW_COPY_AND_ASSIGN(Heap);
};
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/heap.cc » ('j') | runtime/vm/pages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698