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

Unified Diff: runtime/vm/pages.h

Issue 2993383002: [vm] Compute per-HeapPage usage during sweeping. (Closed)
Patch Set: Created 3 years, 4 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 | « runtime/vm/gc_sweeper.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.h
diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h
index 926acd33227402b012ecba6365dfd3e4ebe24165..f11b4996b5aceb9af149221e26b827518296db68 100644
--- a/runtime/vm/pages.h
+++ b/runtime/vm/pages.h
@@ -37,6 +37,11 @@ class HeapPage {
uword object_start() const { return memory_->start() + ObjectStartOffset(); }
uword object_end() const { return object_end_; }
+ uword used_in_bytes() const { return used_in_bytes_; }
+ void set_used_in_bytes(uword value) {
+ ASSERT(Utils::IsAligned(value, kObjectAlignment));
+ used_in_bytes_ = value;
+ }
PageType type() const { return type_; }
@@ -54,9 +59,9 @@ class HeapPage {
}
private:
- void set_object_end(uword val) {
- ASSERT((val & kObjectAlignmentMask) == kOldObjectAlignmentOffset);
- object_end_ = val;
+ void set_object_end(uword value) {
+ ASSERT((value & kObjectAlignmentMask) == kOldObjectAlignmentOffset);
+ object_end_ = value;
}
// These return NULL on OOM.
@@ -74,6 +79,7 @@ class HeapPage {
VirtualMemory* memory_;
HeapPage* next_;
uword object_end_;
+ uword used_in_bytes_;
PageType type_;
friend class PageSpace;
« no previous file with comments | « runtime/vm/gc_sweeper.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698