Commit 21ce2464 authored by jochen's avatar jochen Committed by Commit bot

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}
parent c10c3cbf
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment