Commit ace19221 authored by Hannes Payer's avatar Hannes Payer Committed by Commit Bot

Revert "[heap] Clear the memory of pooled pages when allocating from the pool."

This reverts commit c280e7d4.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [heap] Clear the memory of pooled pages when allocating from the pool.
>
> Bug: chromium:999634
> Change-Id: Ia7a0dd6ddc2477a7656a26548e9a247470d9143f
> Reviewed-on: https://chromium-review.googlesource.com/1041688
> Commit-Queue: Hannes Payer <hpayer@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#52948}

TBR=hpayer@chromium.org,mlippautz@chromium.org

Change-Id: I838d5fe1e6c6ac8b726a90a44b2eacbea9057866
Reviewed-on: https://chromium-review.googlesource.com/1054070
Commit-Queue: Hannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53119}
parent 42334363
......@@ -870,8 +870,8 @@ MemoryChunk* MemoryAllocator::AllocateChunk(size_t reserve_area_size,
}
if (Heap::ShouldZapGarbage()) {
ZapBlock(base, CodePageGuardStartOffset(), kZapValue);
ZapBlock(base + CodePageAreaStartOffset(), commit_area_size, kZapValue);
ZapBlock(base, CodePageGuardStartOffset());
ZapBlock(base + CodePageAreaStartOffset(), commit_area_size);
}
area_start = base + CodePageAreaStartOffset();
......@@ -889,7 +889,7 @@ MemoryChunk* MemoryAllocator::AllocateChunk(size_t reserve_area_size,
if (base == kNullAddress) return nullptr;
if (Heap::ShouldZapGarbage()) {
ZapBlock(base, Page::kObjectStartOffset + commit_area_size, kZapValue);
ZapBlock(base, Page::kObjectStartOffset + commit_area_size);
}
area_start = base + Page::kObjectStartOffset;
......@@ -1179,8 +1179,9 @@ MemoryChunk* MemoryAllocator::AllocatePagePooled(SpaceType* owner) {
bool MemoryAllocator::CommitBlock(Address start, size_t size) {
if (!CommitMemory(start, size)) return false;
ZapBlock(start, size,
Heap::ShouldZapGarbage() ? kZapValue : kClearedFreeMemoryValue);
if (Heap::ShouldZapGarbage()) {
ZapBlock(start, size);
}
isolate_->counters()->memory_allocated()->Increment(static_cast<int>(size));
return true;
......@@ -1193,10 +1194,10 @@ bool MemoryAllocator::UncommitBlock(Address start, size_t size) {
return true;
}
void MemoryAllocator::ZapBlock(Address start, size_t size,
uintptr_t zap_value) {
void MemoryAllocator::ZapBlock(Address start, size_t size) {
for (size_t s = 0; s + kPointerSize <= size; s += kPointerSize) {
Memory::Address_at(start + s) = static_cast<Address>(zap_value);
Memory::Address_at(start + s) = static_cast<Address>(kZapValue);
}
}
......
......@@ -1389,7 +1389,7 @@ class V8_EXPORT_PRIVATE MemoryAllocator {
// Zaps a contiguous block of memory [start..(start+size)[ thus
// filling it up with a recognizable non-nullptr bit pattern.
void ZapBlock(Address start, size_t size, uintptr_t zap_value);
void ZapBlock(Address start, size_t size);
V8_WARN_UNUSED_RESULT bool CommitExecutableMemory(VirtualMemory* vm,
Address start,
......
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