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

Unified Diff: src/serialize.cc

Issue 689663002: Fix not proper chunk sizes in serializer. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
===================================================================
--- src/serialize.cc (revision 24979)
+++ src/serialize.cc (working copy)
@@ -1915,7 +1915,13 @@
CHECK(space >= 0 && space < kNumberOfPreallocatedSpaces);
DCHECK(size > 0 && size <= Page::kMaxRegularHeapObjectSize);
uint32_t new_chunk_size = pending_chunk_[space] + size;
- if (new_chunk_size > static_cast<uint32_t>(Page::kMaxRegularHeapObjectSize)) {
+ const int kMaxChunkSize =
+ space == CODE_SPACE ?
+ // Code page has addidional guard areas at the start and at the end.
+ Page::kPageSize - (MemoryAllocator::CodePageAreaStartOffset() +
+ MemoryAllocator::CodePageGuardSize()) :
+ Page::kMaxRegularHeapObjectSize;
Yang 2014/10/30 09:36:29 Wouldn't it be easier to use MemoryAllocator::Code
+ if (new_chunk_size > static_cast<uint32_t>(kMaxChunkSize)) {
// The new chunk size would not fit onto a single page. Complete the
// current chunk and start a new one.
completed_chunks_[space].Add(pending_chunk_[space]);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698