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

Unified Diff: src/spaces.cc

Issue 5999010: Fix numerous bugs introduced by reducing Page::kMaxHeapObjectSize. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 12 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 | « src/spaces.h ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index 739154ca55c23474685ad77457b336df08d1e774..e61e7127aa8cee04570f65011b7174893f3a0f03 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1773,7 +1773,23 @@ HeapObject* OldSpace::SlowAllocateRaw(int size_in_bytes) {
// and allocated object address.
// Memory above the allocation watermark was not swept and
// might contain garbage pointers to new space.
- ASSERT(obj->address() == p->AllocationWatermark());
+ if (obj->address() != p->AllocationWatermark()) {
+ // TODO(gc) this is waste of time. we should enable linear allocation
+ // at least from above watermark
+ HeapObject* filler =
+ HeapObject::FromAddress(p->AllocationWatermark());
+ while (filler->address() < obj->address()) {
+ Address next_filler = filler->address() + filler->Size();
+ if (filler->Size() > ByteArray::kHeaderSize) {
+ for (Address slot = filler->address() + ByteArray::kHeaderSize;
+ slot < next_filler;
+ slot += kPointerSize) {
+ Memory::Address_at(slot) = 0;
+ }
+ }
+ filler = HeapObject::FromAddress(next_filler);
+ }
+ }
p->SetAllocationWatermark(obj->address() + size_in_bytes);
}
@@ -1803,10 +1819,7 @@ void OldSpace::PutRestOfCurrentPageOnFreeList(Page* current_page) {
current_page->SetAllocationWatermark(allocation_info_.top);
int free_size =
static_cast<int>(current_page->ObjectAreaEnd() - allocation_info_.top);
- if (free_size > 0) {
- int wasted_bytes = free_list_.Free(allocation_info_.top, free_size);
- accounting_stats_.WasteBytes(wasted_bytes);
- }
+ if (free_size > 0) AddToFreeList(allocation_info_.top, free_size);
}
« no previous file with comments | « src/spaces.h ('k') | test/cctest/test-spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698