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

Unified Diff: vm/pages.h

Issue 11186013: - Do not bump allocate in old-space pages. Always use (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 2 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 | « vm/gc_sweeper.cc ('k') | vm/pages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/pages.h
===================================================================
--- vm/pages.h (revision 13786)
+++ vm/pages.h (working copy)
@@ -28,15 +28,12 @@
return memory_->Contains(addr);
}
- uword start() const { return reinterpret_cast<uword>(this); }
- uword end() const { return memory_->end(); }
-
- uword top() const { return top_; }
- void set_top(uword top) { top_ = top; }
-
- uword first_object_start() const {
+ uword object_start() const {
return (reinterpret_cast<uword>(this) + sizeof(HeapPage));
}
+ uword object_end() const {
+ return object_end_;
+ }
void set_used(uword used) { used_ = used; }
uword used() const { return used_; }
@@ -44,16 +41,6 @@
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 VisitObjects(ObjectVisitor* visitor) const;
void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
@@ -62,6 +49,11 @@
void WriteProtect(bool read_only);
private:
+ void set_object_end(uword val) {
+ ASSERT((val & kObjectAlignmentMask) == kOldObjectAlignmentOffset);
+ object_end_ = val;
+ }
+
static HeapPage* Initialize(VirtualMemory* memory, bool is_executable);
static HeapPage* Allocate(intptr_t size, bool is_executable);
@@ -72,7 +64,7 @@
VirtualMemory* memory_;
HeapPage* next_;
uword used_;
- uword top_;
+ uword object_end_;
friend class PageSpace;
@@ -216,7 +208,7 @@
private:
static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage);
- void AllocatePage();
+ HeapPage* AllocatePage();
void FreePage(HeapPage* page, HeapPage* previous_page);
HeapPage* AllocateLargePage(intptr_t size);
void FreeLargePage(HeapPage* page, HeapPage* previous_page);
@@ -229,8 +221,6 @@
return increase <= (max_capacity_ - capacity_);
}
- uword TryBumpAllocate(intptr_t size);
-
FreeList freelist_;
Heap* heap_;
@@ -241,13 +231,6 @@
PeerTable peer_table_;
- // 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 | « vm/gc_sweeper.cc ('k') | vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698