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

Unified Diff: vm/pages.h

Issue 10057001: - Use the unused top of old-space pages when allocating. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | vm/pages.cc » ('j') | vm/pages.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/pages.h
===================================================================
--- vm/pages.h (revision 6398)
+++ vm/pages.h (working copy)
@@ -42,6 +42,16 @@
used_ += size;
}
+ uword TryBumpAllocate(intptr_t size) {
+ uword result = top();
+ intptr_t remaining_space = end() - result;
+ if (remaining_space < size) {
+ return 0;
+ }
+ set_top(result + size);
+ return result;
+ }
+
void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
RawObject* FindObject(FindObjectVisitor* visitor) const;
@@ -122,6 +132,13 @@
HeapPage* pages_tail_;
HeapPage* large_pages_;
+ // Page being used for bump allocation.
+ // The value has different meanings:
+ // NULL: Still bump allocating from last allocated fresh page.
+ // !NULL: Last page that had enough room to bump allocate, when we reach the
+ // tail page, we give up bump allocating.
+ HeapPage* bump_page_;
+
// Various sizes being tracked for this generation.
intptr_t max_capacity_;
intptr_t capacity_;
« no previous file with comments | « no previous file | vm/pages.cc » ('j') | vm/pages.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698