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

Unified Diff: src/serialize.cc

Issue 9233050: Reduce memory use immediately after boot. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 11 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
Index: src/serialize.cc
===================================================================
--- src/serialize.cc (revision 10555)
+++ src/serialize.cc (working copy)
@@ -612,6 +612,7 @@
pages_[LO_SPACE].Add(address);
}
last_object_address_ = address;
+ ASSERT(address >= Page::FromAddress(address)->ObjectAreaStart());
return address;
}
@@ -622,7 +623,12 @@
int offset = source_->GetInt();
ASSERT(!SpaceIsLarge(space));
offset <<= kObjectAlignmentBits;
- return HeapObject::FromAddress(high_water_[space] - offset);
+ Address address = high_water_[space] - offset;
+ // This assert will fail if kMinimumSpaceSizes is too small for a space,
+ // because we rely on the fact that all allocation is linear when the VM
+ // is very young.
+ ASSERT(address >= Page::FromAddress(address)->ObjectAreaStart());
+ return HeapObject::FromAddress(address);
}

Powered by Google App Engine
This is Rietveld 408576698