Correctly setup the freelist of the coderange on Win64

Since we have a special guard page at the beginning of the code range on
win64, we need to make sure to adjust the size of the free list
accordingly when creating it.

BUG=chromium:447555
R=hpayer@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/843973002

Cr-Commit-Position: refs/heads/master@{#26012}
This commit is contained in:
jochen 2015-01-09 05:07:29 -08:00 committed by Commit bot
parent c10c3cbf18
commit 21ce246423
2 changed files with 4 additions and 2 deletions

View File

@ -140,7 +140,8 @@ bool CodeRange::SetUp(size_t requested) {
base += kReservedCodeRangePages * base::OS::CommitPageSize();
}
Address aligned_base = RoundUp(base, MemoryChunk::kAlignment);
size_t size = code_range_->size() - (aligned_base - base);
size_t size = code_range_->size() - (aligned_base - base) -
kReservedCodeRangePages * base::OS::CommitPageSize();
allocation_list_.Add(FreeBlock(aligned_base, size));
current_allocation_block_index_ = 0;

View File

@ -198,7 +198,8 @@ TEST(CodeRange) {
const size_t code_range_size = 32*MB;
CcTest::InitializeVM();
CodeRange code_range(reinterpret_cast<Isolate*>(CcTest::isolate()));
code_range.SetUp(code_range_size);
code_range.SetUp(code_range_size +
kReservedCodeRangePages * v8::base::OS::CommitPageSize());
size_t current_allocated = 0;
size_t total_allocated = 0;
List< ::Block> blocks(1000);