| 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_;
|
|
|