Commit 7e41bd38 authored by Nico Hartmann's avatar Nico Hartmann Committed by Commit Bot

Revert "[heap] Remove FreeList when sealing RO_SPACE"

This reverts commit afd9493a.

Reason for revert: Speculative revert due to https://ci.chromium.org/p/v8/builders/ci/V8%20Clusterfuzz%20Linux%20ASAN%20arm%20-%20debug%20builder/14978?

Original change's description:
> [heap] Remove FreeList when sealing RO_SPACE
> 
> This releases the FreeListCategories for each MemoryChunk when sealing
> the ReadOnlySpace and deletes the FreeList.
> 
> Additionally this also calls
> ReleaseAllocatedMemoryNeededForWritableChunk for each MemoryChunk when
> sealing when pointer compression is enabled even if no memory is to be
> shared.
> 
> Bug: v8:10454
> Change-Id: I45aec59f6d4fddedeb713e13095f58974cda279e
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2184292
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Dan Elphick <delphick@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#67598}

TBR=ulan@chromium.org,delphick@chromium.org

Change-Id: I135c1ebc2340a75a30305b84625710ef14d9cdb3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:10454
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2183921Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67603}
parent bc2bc6bf
......@@ -354,10 +354,6 @@ class MemoryChunk : public BasicMemoryChunk {
return &possibly_empty_buckets_;
}
// Release memory allocated by the chunk, except that which is needed by
// read-only space chunks.
void ReleaseAllocatedMemoryNeededForWritableChunk();
protected:
static MemoryChunk* Initialize(Heap* heap, Address base, size_t size,
Address area_start, Address area_end,
......@@ -367,6 +363,9 @@ class MemoryChunk : public BasicMemoryChunk {
// Release all memory allocated by the chunk. Should be called when memory
// chunk is about to be freed.
void ReleaseAllAllocatedMemory();
// Release memory allocated by the chunk, except that which is needed by
// read-only space chunks.
void ReleaseAllocatedMemoryNeededForWritableChunk();
// Sets the requested page permissions only if the write unprotect counter
// has reached 0.
......
......@@ -153,14 +153,8 @@ void ReadOnlySpace::Seal(SealMode ro_mode) {
memory_allocator->UnregisterMemory(p);
static_cast<ReadOnlyPage*>(p)->MakeHeaderRelocatable();
}
} else {
for (Page* p : *this) {
p->ReleaseAllocatedMemoryNeededForWritableChunk();
}
}
free_list_.reset();
SetPermissionsForPages(memory_allocator, PageAllocator::kRead);
}
......
......@@ -1248,14 +1248,14 @@ void MemoryChunk::ReleaseAllocatedMemoryNeededForWritableChunk() {
if (local_tracker_ != nullptr) ReleaseLocalTracker();
if (young_generation_bitmap_ != nullptr) ReleaseYoungGenerationBitmap();
}
void MemoryChunk::ReleaseAllAllocatedMemory() {
if (!IsLargePage()) {
Page* page = static_cast<Page*>(this);
page->ReleaseFreeListCategories();
}
}
void MemoryChunk::ReleaseAllAllocatedMemory() {
ReleaseAllocatedMemoryNeededForWritableChunk();
if (marking_bitmap_ != nullptr) ReleaseMarkingBitmap();
}
......
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