Index: src/spaces-inl.h |
=================================================================== |
--- src/spaces-inl.h (revision 10368) |
+++ src/spaces-inl.h (working copy) |
@@ -164,12 +164,12 @@ |
Executability executable, |
PagedSpace* owner) { |
Page* page = reinterpret_cast<Page*>(chunk); |
- ASSERT(chunk->size() == static_cast<size_t>(kPageSize)); |
+ ASSERT(chunk->size() <= kPageSize); |
ASSERT(chunk->owner() == owner); |
- owner->IncreaseCapacity(Page::kObjectAreaSize); |
- owner->Free(page->ObjectAreaStart(), |
- static_cast<int>(page->ObjectAreaEnd() - |
- page->ObjectAreaStart())); |
+ intptr_t object_bytes = page->ObjectAreaEnd() - page->ObjectAreaStart(); |
+ owner->IncreaseCapacity(object_bytes); |
+ owner->AddToFreeLists(page->ObjectAreaStart(), |
+ static_cast<int>(object_bytes)); |
heap->incremental_marking()->SetOldSpacePageFlags(chunk); |
@@ -248,7 +248,7 @@ |
// Try linear allocation in the page of alloc_info's allocation top. Does |
-// not contain slow case logic (eg, move to the next page or try free list |
+// not contain slow case logic (e.g. move to the next page or try free list |
// allocation) so it can be used by all the allocation functions and for all |
// the paged spaces. |
HeapObject* PagedSpace::AllocateLinearly(int size_in_bytes) { |
@@ -257,6 +257,7 @@ |
if (new_top > allocation_info_.limit) return NULL; |
allocation_info_.top = new_top; |
+ ASSERT(new_top >= Page::FromAddress(new_top - 1)->ObjectAreaStart()); |
return HeapObject::FromAddress(current_top); |
} |