| Index: third_party/WebKit/Source/platform/heap/HeapPage.cpp
|
| diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.cpp b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
|
| index 36a6325f85fa1ffef7272fdc71ca254cf8934d86..064b8260258a7f90e985858d7a939042104c5a32 100644
|
| --- a/third_party/WebKit/Source/platform/heap/HeapPage.cpp
|
| +++ b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
|
| @@ -63,7 +63,7 @@
|
| do { \
|
| BasePage* page = pageFromObject(object); \
|
| ASSERT(page); \
|
| - bool isContainer = ThreadState::isVectorHeapIndex(page->heap()->heapIndex()); \
|
| + bool isContainer = ThreadState::isVectorArenaIndex(page->arena()->arenaIndex()); \
|
| if (!isContainer && page->isLargeObjectPage()) \
|
| isContainer = static_cast<LargeObjectPage*>(page)->isVectorBackingPage(); \
|
| if (isContainer) \
|
| @@ -74,7 +74,7 @@
|
| // so that when it is finalized, its ASan annotation will be
|
| // correctly retired.
|
| #define ASAN_MARK_LARGE_VECTOR_CONTAINER(heap, largeObject) \
|
| - if (ThreadState::isVectorHeapIndex(heap->heapIndex())) { \
|
| + if (ThreadState::isVectorArenaIndex(heap->arenaIndex())) { \
|
| BasePage* largePage = pageFromObject(largeObject); \
|
| ASSERT(largePage->isLargeObjectPage()); \
|
| static_cast<LargeObjectPage*>(largePage)->setIsVectorBackingPage(); \
|
| @@ -106,7 +106,7 @@ void HeapObjectHeader::finalize(Address object, size_t objectSize)
|
| ASAN_RETIRE_CONTAINER_ANNOTATION(object, objectSize);
|
| }
|
|
|
| -BaseHeap::BaseHeap(ThreadState* state, int index)
|
| +BaseArena::BaseArena(ThreadState* state, int index)
|
| : m_firstPage(nullptr)
|
| , m_firstUnsweptPage(nullptr)
|
| , m_threadState(state)
|
| @@ -114,26 +114,26 @@ BaseHeap::BaseHeap(ThreadState* state, int index)
|
| {
|
| }
|
|
|
| -BaseHeap::~BaseHeap()
|
| +BaseArena::~BaseArena()
|
| {
|
| ASSERT(!m_firstPage);
|
| ASSERT(!m_firstUnsweptPage);
|
| }
|
|
|
| -void BaseHeap::cleanupPages()
|
| +void BaseArena::cleanupPages()
|
| {
|
| clearFreeLists();
|
|
|
| ASSERT(!m_firstUnsweptPage);
|
| - // Add the BaseHeap's pages to the orphanedPagePool.
|
| + // Add the BaseArena's pages to the orphanedPagePool.
|
| for (BasePage* page = m_firstPage; page; page = page->next()) {
|
| - Heap::decreaseAllocatedSpace(page->size());
|
| - Heap::orphanedPagePool()->addOrphanedPage(heapIndex(), page);
|
| + threadState()->heap().heapStats().decreaseAllocatedSpace(page->size());
|
| + threadState()->heap().orphanedPagePool()->addOrphanedPage(arenaIndex(), page);
|
| }
|
| m_firstPage = nullptr;
|
| }
|
|
|
| -void BaseHeap::takeSnapshot(const String& dumpBaseName, ThreadState::GCSnapshotInfo& info)
|
| +void BaseArena::takeSnapshot(const String& dumpBaseName, ThreadState::GCSnapshotInfo& info)
|
| {
|
| // |dumpBaseName| at this point is "blink_gc/thread_X/heaps/HeapName"
|
| WebMemoryAllocatorDump* allocatorDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpBaseName);
|
| @@ -156,7 +156,7 @@ void BaseHeap::takeSnapshot(const String& dumpBaseName, ThreadState::GCSnapshotI
|
| }
|
|
|
| #if ENABLE(ASSERT)
|
| -BasePage* BaseHeap::findPageFromAddress(Address address)
|
| +BasePage* BaseArena::findPageFromAddress(Address address)
|
| {
|
| for (BasePage* page = m_firstPage; page; page = page->next()) {
|
| if (page->contains(address))
|
| @@ -170,7 +170,7 @@ BasePage* BaseHeap::findPageFromAddress(Address address)
|
| }
|
| #endif
|
|
|
| -void BaseHeap::makeConsistentForGC()
|
| +void BaseArena::makeConsistentForGC()
|
| {
|
| clearFreeLists();
|
| ASSERT(isConsistentForGC());
|
| @@ -201,7 +201,7 @@ void BaseHeap::makeConsistentForGC()
|
| ASSERT(!m_firstUnsweptPage);
|
| }
|
|
|
| -void BaseHeap::makeConsistentForMutator()
|
| +void BaseArena::makeConsistentForMutator()
|
| {
|
| clearFreeLists();
|
| ASSERT(isConsistentForGC());
|
| @@ -224,7 +224,7 @@ void BaseHeap::makeConsistentForMutator()
|
| ASSERT(!m_firstUnsweptPage);
|
| }
|
|
|
| -size_t BaseHeap::objectPayloadSizeForTesting()
|
| +size_t BaseArena::objectPayloadSizeForTesting()
|
| {
|
| ASSERT(isConsistentForGC());
|
| ASSERT(!m_firstUnsweptPage);
|
| @@ -235,7 +235,7 @@ size_t BaseHeap::objectPayloadSizeForTesting()
|
| return objectPayloadSize;
|
| }
|
|
|
| -void BaseHeap::prepareHeapForTermination()
|
| +void BaseArena::prepareHeapForTermination()
|
| {
|
| ASSERT(!m_firstUnsweptPage);
|
| for (BasePage* page = m_firstPage; page; page = page->next()) {
|
| @@ -243,7 +243,7 @@ void BaseHeap::prepareHeapForTermination()
|
| }
|
| }
|
|
|
| -void BaseHeap::prepareForSweep()
|
| +void BaseArena::prepareForSweep()
|
| {
|
| ASSERT(threadState()->isInGC());
|
| ASSERT(!m_firstUnsweptPage);
|
| @@ -254,10 +254,10 @@ void BaseHeap::prepareForSweep()
|
| }
|
|
|
| #if defined(ADDRESS_SANITIZER)
|
| -void BaseHeap::poisonHeap(BlinkGC::ObjectsToPoison objectsToPoison, BlinkGC::Poisoning poisoning)
|
| +void BaseArena::poisonHeap(BlinkGC::ObjectsToPoison objectsToPoison, BlinkGC::Poisoning poisoning)
|
| {
|
| // TODO(sof): support complete poisoning of all heaps.
|
| - ASSERT(objectsToPoison != BlinkGC::MarkedAndUnmarked || heapIndex() == BlinkGC::EagerSweepHeapIndex);
|
| + ASSERT(objectsToPoison != BlinkGC::MarkedAndUnmarked || arenaIndex() == BlinkGC::EagerSweepArenaIndex);
|
|
|
| // This method may either be called to poison (SetPoison) heap
|
| // object payloads prior to sweeping, or it may be called at
|
| @@ -279,7 +279,7 @@ void BaseHeap::poisonHeap(BlinkGC::ObjectsToPoison objectsToPoison, BlinkGC::Poi
|
| }
|
| #endif
|
|
|
| -Address BaseHeap::lazySweep(size_t allocationSize, size_t gcInfoIndex)
|
| +Address BaseArena::lazySweep(size_t allocationSize, size_t gcInfoIndex)
|
| {
|
| // If there are no pages to be swept, return immediately.
|
| if (!m_firstUnsweptPage)
|
| @@ -294,7 +294,7 @@ Address BaseHeap::lazySweep(size_t allocationSize, size_t gcInfoIndex)
|
| if (threadState()->sweepForbidden())
|
| return nullptr;
|
|
|
| - TRACE_EVENT0("blink_gc", "BaseHeap::lazySweepPages");
|
| + TRACE_EVENT0("blink_gc", "BaseArena::lazySweepPages");
|
| ThreadState::SweepForbiddenScope sweepForbidden(threadState());
|
| ScriptForbiddenIfMainThreadScope scriptForbidden;
|
|
|
| @@ -306,7 +306,7 @@ Address BaseHeap::lazySweep(size_t allocationSize, size_t gcInfoIndex)
|
| return result;
|
| }
|
|
|
| -void BaseHeap::sweepUnsweptPage()
|
| +void BaseArena::sweepUnsweptPage()
|
| {
|
| BasePage* page = m_firstUnsweptPage;
|
| if (page->isEmpty()) {
|
| @@ -322,7 +322,7 @@ void BaseHeap::sweepUnsweptPage()
|
| }
|
| }
|
|
|
| -bool BaseHeap::lazySweepWithDeadline(double deadlineSeconds)
|
| +bool BaseArena::lazySweepWithDeadline(double deadlineSeconds)
|
| {
|
| // It might be heavy to call Platform::current()->monotonicallyIncreasingTimeSeconds()
|
| // per page (i.e., 128 KB sweep or one LargeObject sweep), so we check
|
| @@ -349,7 +349,7 @@ bool BaseHeap::lazySweepWithDeadline(double deadlineSeconds)
|
| return true;
|
| }
|
|
|
| -void BaseHeap::completeSweep()
|
| +void BaseArena::completeSweep()
|
| {
|
| RELEASE_ASSERT(threadState()->isSweepingInProgress());
|
| ASSERT(threadState()->sweepForbidden());
|
| @@ -361,8 +361,8 @@ void BaseHeap::completeSweep()
|
| Heap::reportMemoryUsageForTracing();
|
| }
|
|
|
| -NormalPageHeap::NormalPageHeap(ThreadState* state, int index)
|
| - : BaseHeap(state, index)
|
| +NormalPageArena::NormalPageArena(ThreadState* state, int index)
|
| + : BaseArena(state, index)
|
| , m_currentAllocationPoint(nullptr)
|
| , m_remainingAllocationSize(0)
|
| , m_lastRemainingAllocationSize(0)
|
| @@ -371,14 +371,14 @@ NormalPageHeap::NormalPageHeap(ThreadState* state, int index)
|
| clearFreeLists();
|
| }
|
|
|
| -void NormalPageHeap::clearFreeLists()
|
| +void NormalPageArena::clearFreeLists()
|
| {
|
| setAllocationPoint(nullptr, 0);
|
| m_freeList.clear();
|
| }
|
|
|
| #if ENABLE(ASSERT)
|
| -bool NormalPageHeap::isConsistentForGC()
|
| +bool NormalPageArena::isConsistentForGC()
|
| {
|
| // A thread heap is consistent for sweeping if none of the pages to be swept
|
| // contain a freelist block or the current allocation point.
|
| @@ -395,7 +395,7 @@ bool NormalPageHeap::isConsistentForGC()
|
| return true;
|
| }
|
|
|
| -bool NormalPageHeap::pagesToBeSweptContains(Address address)
|
| +bool NormalPageArena::pagesToBeSweptContains(Address address)
|
| {
|
| for (BasePage* page = m_firstUnsweptPage; page; page = page->next()) {
|
| if (page->contains(address))
|
| @@ -405,7 +405,7 @@ bool NormalPageHeap::pagesToBeSweptContains(Address address)
|
| }
|
| #endif
|
|
|
| -void NormalPageHeap::takeFreelistSnapshot(const String& dumpName)
|
| +void NormalPageArena::takeFreelistSnapshot(const String& dumpName)
|
| {
|
| if (m_freeList.takeSnapshot(dumpName)) {
|
| WebMemoryAllocatorDump* bucketsDump = BlinkGCMemoryDumpProvider::instance()->createMemoryAllocatorDumpForCurrentGC(dumpName + "/buckets");
|
| @@ -414,10 +414,10 @@ void NormalPageHeap::takeFreelistSnapshot(const String& dumpName)
|
| }
|
| }
|
|
|
| -void NormalPageHeap::allocatePage()
|
| +void NormalPageArena::allocatePage()
|
| {
|
| threadState()->shouldFlushHeapDoesNotContainCache();
|
| - PageMemory* pageMemory = Heap::freePagePool()->takeFreePage(heapIndex());
|
| + PageMemory* pageMemory = threadState()->heap().freePagePool()->takeFreePage(arenaIndex());
|
|
|
| if (!pageMemory) {
|
| // Allocate a memory region for blinkPagesPerRegion pages that
|
| @@ -425,7 +425,7 @@ void NormalPageHeap::allocatePage()
|
| //
|
| // [ guard os page | ... payload ... | guard os page ]
|
| // ^---{ aligned to blink page size }
|
| - PageMemoryRegion* region = PageMemoryRegion::allocateNormalPages();
|
| + PageMemoryRegion* region = PageMemoryRegion::allocateNormalPages(&threadState()->heap());
|
|
|
| // Setup the PageMemory object for each of the pages in the region.
|
| for (size_t i = 0; i < blinkPagesPerRegion; ++i) {
|
| @@ -440,7 +440,7 @@ void NormalPageHeap::allocatePage()
|
| RELEASE_ASSERT(result);
|
| pageMemory = memory;
|
| } else {
|
| - Heap::freePagePool()->addFreePage(heapIndex(), memory);
|
| + threadState()->heap().freePagePool()->addFreePage(arenaIndex(), memory);
|
| }
|
| }
|
| }
|
| @@ -448,7 +448,7 @@ void NormalPageHeap::allocatePage()
|
| NormalPage* page = new (pageMemory->writableStart()) NormalPage(pageMemory, this);
|
| page->link(&m_firstPage);
|
|
|
| - Heap::increaseAllocatedSpace(page->size());
|
| + threadState()->heap().heapStats().increaseAllocatedSpace(page->size());
|
| #if ENABLE(ASSERT) || defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER)
|
| // Allow the following addToFreeList() to add the newly allocated memory
|
| // to the free list.
|
| @@ -461,9 +461,9 @@ void NormalPageHeap::allocatePage()
|
| addToFreeList(page->payload(), page->payloadSize());
|
| }
|
|
|
| -void NormalPageHeap::freePage(NormalPage* page)
|
| +void NormalPageArena::freePage(NormalPage* page)
|
| {
|
| - Heap::decreaseAllocatedSpace(page->size());
|
| + threadState()->heap().heapStats().decreaseAllocatedSpace(page->size());
|
|
|
| if (page->terminating()) {
|
| // The thread is shutting down and this page is being removed as a part
|
| @@ -474,15 +474,15 @@ void NormalPageHeap::freePage(NormalPage* page)
|
| // ensures that tracing the dangling pointer in the next global GC just
|
| // crashes instead of causing use-after-frees. After the next global
|
| // GC, the orphaned pages are removed.
|
| - Heap::orphanedPagePool()->addOrphanedPage(heapIndex(), page);
|
| + threadState()->heap().orphanedPagePool()->addOrphanedPage(arenaIndex(), page);
|
| } else {
|
| PageMemory* memory = page->storage();
|
| page->~NormalPage();
|
| - Heap::freePagePool()->addFreePage(heapIndex(), memory);
|
| + threadState()->heap().freePagePool()->addFreePage(arenaIndex(), memory);
|
| }
|
| }
|
|
|
| -bool NormalPageHeap::coalesce()
|
| +bool NormalPageArena::coalesce()
|
| {
|
| // Don't coalesce heaps if there are not enough promptly freed entries
|
| // to be coalesced.
|
| @@ -497,7 +497,7 @@ bool NormalPageHeap::coalesce()
|
| return false;
|
|
|
| ASSERT(!hasCurrentAllocationArea());
|
| - TRACE_EVENT0("blink_gc", "BaseHeap::coalesce");
|
| + TRACE_EVENT0("blink_gc", "BaseArena::coalesce");
|
|
|
| // Rebuild free lists.
|
| m_freeList.clear();
|
| @@ -549,7 +549,7 @@ bool NormalPageHeap::coalesce()
|
| return true;
|
| }
|
|
|
| -void NormalPageHeap::promptlyFreeObject(HeapObjectHeader* header)
|
| +void NormalPageArena::promptlyFreeObject(HeapObjectHeader* header)
|
| {
|
| ASSERT(!threadState()->sweepForbidden());
|
| ASSERT(header->checkHeader());
|
| @@ -576,7 +576,7 @@ void NormalPageHeap::promptlyFreeObject(HeapObjectHeader* header)
|
| m_promptlyFreedSize += size;
|
| }
|
|
|
| -bool NormalPageHeap::expandObject(HeapObjectHeader* header, size_t newSize)
|
| +bool NormalPageArena::expandObject(HeapObjectHeader* header, size_t newSize)
|
| {
|
| // It's possible that Vector requests a smaller expanded size because
|
| // Vector::shrinkCapacity can set a capacity smaller than the actual payload
|
| @@ -600,7 +600,7 @@ bool NormalPageHeap::expandObject(HeapObjectHeader* header, size_t newSize)
|
| return false;
|
| }
|
|
|
| -bool NormalPageHeap::shrinkObject(HeapObjectHeader* header, size_t newSize)
|
| +bool NormalPageArena::shrinkObject(HeapObjectHeader* header, size_t newSize)
|
| {
|
| ASSERT(header->checkHeader());
|
| ASSERT(header->payloadSize() > newSize);
|
| @@ -626,7 +626,7 @@ bool NormalPageHeap::shrinkObject(HeapObjectHeader* header, size_t newSize)
|
| return false;
|
| }
|
|
|
| -Address NormalPageHeap::lazySweepPages(size_t allocationSize, size_t gcInfoIndex)
|
| +Address NormalPageArena::lazySweepPages(size_t allocationSize, size_t gcInfoIndex)
|
| {
|
| ASSERT(!hasCurrentAllocationArea());
|
| Address result = nullptr;
|
| @@ -653,7 +653,7 @@ Address NormalPageHeap::lazySweepPages(size_t allocationSize, size_t gcInfoIndex
|
| return result;
|
| }
|
|
|
| -void NormalPageHeap::setRemainingAllocationSize(size_t newRemainingAllocationSize)
|
| +void NormalPageArena::setRemainingAllocationSize(size_t newRemainingAllocationSize)
|
| {
|
| m_remainingAllocationSize = newRemainingAllocationSize;
|
|
|
| @@ -667,7 +667,7 @@ void NormalPageHeap::setRemainingAllocationSize(size_t newRemainingAllocationSiz
|
| m_lastRemainingAllocationSize = m_remainingAllocationSize;
|
| }
|
|
|
| -void NormalPageHeap::updateRemainingAllocationSize()
|
| +void NormalPageArena::updateRemainingAllocationSize()
|
| {
|
| if (m_lastRemainingAllocationSize > remainingAllocationSize()) {
|
| threadState()->increaseAllocatedObjectSize(m_lastRemainingAllocationSize - remainingAllocationSize());
|
| @@ -676,7 +676,7 @@ void NormalPageHeap::updateRemainingAllocationSize()
|
| ASSERT(m_lastRemainingAllocationSize == remainingAllocationSize());
|
| }
|
|
|
| -void NormalPageHeap::setAllocationPoint(Address point, size_t size)
|
| +void NormalPageArena::setAllocationPoint(Address point, size_t size)
|
| {
|
| #if ENABLE(ASSERT)
|
| if (point) {
|
| @@ -694,7 +694,7 @@ void NormalPageHeap::setAllocationPoint(Address point, size_t size)
|
| m_lastRemainingAllocationSize = m_remainingAllocationSize = size;
|
| }
|
|
|
| -Address NormalPageHeap::outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex)
|
| +Address NormalPageArena::outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex)
|
| {
|
| ASSERT(allocationSize > remainingAllocationSize());
|
| ASSERT(allocationSize >= allocationGranularity);
|
| @@ -702,8 +702,8 @@ Address NormalPageHeap::outOfLineAllocate(size_t allocationSize, size_t gcInfoIn
|
| // 1. If this allocation is big enough, allocate a large object.
|
| if (allocationSize >= largeObjectSizeThreshold) {
|
| // TODO(sof): support eagerly finalized large objects, if ever needed.
|
| - RELEASE_ASSERT(heapIndex() != BlinkGC::EagerSweepHeapIndex);
|
| - LargeObjectHeap* largeObjectHeap = static_cast<LargeObjectHeap*>(threadState()->heap(BlinkGC::LargeObjectHeapIndex));
|
| + RELEASE_ASSERT(arenaIndex() != BlinkGC::EagerSweepArenaIndex);
|
| + LargeObjectArena* largeObjectHeap = static_cast<LargeObjectArena*>(threadState()->arena(BlinkGC::LargeObjectArenaIndex));
|
| Address largeObject = largeObjectHeap->allocateLargeObjectPage(allocationSize, gcInfoIndex);
|
| ASAN_MARK_LARGE_VECTOR_CONTAINER(this, largeObject);
|
| return largeObject;
|
| @@ -747,7 +747,7 @@ Address NormalPageHeap::outOfLineAllocate(size_t allocationSize, size_t gcInfoIn
|
| return result;
|
| }
|
|
|
| -Address NormalPageHeap::allocateFromFreeList(size_t allocationSize, size_t gcInfoIndex)
|
| +Address NormalPageArena::allocateFromFreeList(size_t allocationSize, size_t gcInfoIndex)
|
| {
|
| // Try reusing a block from the largest bin. The underlying reasoning
|
| // being that we want to amortize this slow allocation call by carving
|
| @@ -778,12 +778,12 @@ Address NormalPageHeap::allocateFromFreeList(size_t allocationSize, size_t gcInf
|
| return nullptr;
|
| }
|
|
|
| -LargeObjectHeap::LargeObjectHeap(ThreadState* state, int index)
|
| - : BaseHeap(state, index)
|
| +LargeObjectArena::LargeObjectArena(ThreadState* state, int index)
|
| + : BaseArena(state, index)
|
| {
|
| }
|
|
|
| -Address LargeObjectHeap::allocateLargeObjectPage(size_t allocationSize, size_t gcInfoIndex)
|
| +Address LargeObjectArena::allocateLargeObjectPage(size_t allocationSize, size_t gcInfoIndex)
|
| {
|
| // Caller already added space for object header and rounded up to allocation
|
| // alignment
|
| @@ -805,7 +805,7 @@ Address LargeObjectHeap::allocateLargeObjectPage(size_t allocationSize, size_t g
|
| return doAllocateLargeObjectPage(allocationSize, gcInfoIndex);
|
| }
|
|
|
| -Address LargeObjectHeap::doAllocateLargeObjectPage(size_t allocationSize, size_t gcInfoIndex)
|
| +Address LargeObjectArena::doAllocateLargeObjectPage(size_t allocationSize, size_t gcInfoIndex)
|
| {
|
| size_t largeObjectSize = LargeObjectPage::pageHeaderSize() + allocationSize;
|
| // If ASan is supported we add allocationGranularity bytes to the allocated
|
| @@ -815,7 +815,7 @@ Address LargeObjectHeap::doAllocateLargeObjectPage(size_t allocationSize, size_t
|
| #endif
|
|
|
| threadState()->shouldFlushHeapDoesNotContainCache();
|
| - PageMemory* pageMemory = PageMemory::allocate(largeObjectSize);
|
| + PageMemory* pageMemory = PageMemory::allocate(largeObjectSize, &threadState()->heap());
|
| Address largeObjectAddress = pageMemory->writableStart();
|
| Address headerAddress = largeObjectAddress + LargeObjectPage::pageHeaderSize();
|
| #if ENABLE(ASSERT)
|
| @@ -836,16 +836,16 @@ Address LargeObjectHeap::doAllocateLargeObjectPage(size_t allocationSize, size_t
|
|
|
| largeObject->link(&m_firstPage);
|
|
|
| - Heap::increaseAllocatedSpace(largeObject->size());
|
| + threadState()->heap().heapStats().increaseAllocatedSpace(largeObject->size());
|
| threadState()->increaseAllocatedObjectSize(largeObject->size());
|
| return result;
|
| }
|
|
|
| -void LargeObjectHeap::freeLargeObjectPage(LargeObjectPage* object)
|
| +void LargeObjectArena::freeLargeObjectPage(LargeObjectPage* object)
|
| {
|
| ASAN_UNPOISON_MEMORY_REGION(object->payload(), object->payloadSize());
|
| object->heapObjectHeader()->finalize(object->payload(), object->payloadSize());
|
| - Heap::decreaseAllocatedSpace(object->size());
|
| + threadState()->heap().heapStats().decreaseAllocatedSpace(object->size());
|
|
|
| // Unpoison the object header and allocationGranularity bytes after the
|
| // object before freeing.
|
| @@ -862,7 +862,7 @@ void LargeObjectHeap::freeLargeObjectPage(LargeObjectPage* object)
|
| // ensures that tracing the dangling pointer in the next global GC just
|
| // crashes instead of causing use-after-frees. After the next global
|
| // GC, the orphaned pages are removed.
|
| - Heap::orphanedPagePool()->addOrphanedPage(heapIndex(), object);
|
| + threadState()->heap().orphanedPagePool()->addOrphanedPage(arenaIndex(), object);
|
| } else {
|
| ASSERT(!ThreadState::current()->isTerminating());
|
| PageMemory* memory = object->storage();
|
| @@ -871,7 +871,7 @@ void LargeObjectHeap::freeLargeObjectPage(LargeObjectPage* object)
|
| }
|
| }
|
|
|
| -Address LargeObjectHeap::lazySweepPages(size_t allocationSize, size_t gcInfoIndex)
|
| +Address LargeObjectArena::lazySweepPages(size_t allocationSize, size_t gcInfoIndex)
|
| {
|
| Address result = nullptr;
|
| size_t sweptSize = 0;
|
| @@ -1046,9 +1046,9 @@ bool FreeList::takeSnapshot(const String& dumpBaseName)
|
| return didDumpBucketStats;
|
| }
|
|
|
| -BasePage::BasePage(PageMemory* storage, BaseHeap* heap)
|
| +BasePage::BasePage(PageMemory* storage, BaseArena* arena)
|
| : m_storage(storage)
|
| - , m_heap(heap)
|
| + , m_arena(arena)
|
| , m_next(nullptr)
|
| , m_terminating(false)
|
| , m_swept(true)
|
| @@ -1058,14 +1058,14 @@ BasePage::BasePage(PageMemory* storage, BaseHeap* heap)
|
|
|
| void BasePage::markOrphaned()
|
| {
|
| - m_heap = nullptr;
|
| + m_arena = nullptr;
|
| m_terminating = false;
|
| // Since we zap the page payload for orphaned pages we need to mark it as
|
| // unused so a conservative pointer won't interpret the object headers.
|
| storage()->markUnused();
|
| }
|
|
|
| -NormalPage::NormalPage(PageMemory* storage, BaseHeap* heap)
|
| +NormalPage::NormalPage(PageMemory* storage, BaseArena* heap)
|
| : BasePage(storage, heap)
|
| , m_objectStartBitMapComputed(false)
|
| {
|
| @@ -1116,7 +1116,7 @@ void NormalPage::sweep()
|
| {
|
| size_t markedObjectSize = 0;
|
| Address startOfGap = payload();
|
| - NormalPageHeap* pageHeap = heapForNormalPage();
|
| + NormalPageArena* pageHeap = heapForNormalPage();
|
| for (Address headerAddress = startOfGap; headerAddress < payloadEnd(); ) {
|
| HeapObjectHeader* header = reinterpret_cast<HeapObjectHeader*>(headerAddress);
|
| size_t size = header->size();
|
| @@ -1433,12 +1433,12 @@ bool NormalPage::contains(Address addr)
|
| }
|
| #endif
|
|
|
| -NormalPageHeap* NormalPage::heapForNormalPage()
|
| +NormalPageArena* NormalPage::heapForNormalPage()
|
| {
|
| - return static_cast<NormalPageHeap*>(heap());
|
| + return static_cast<NormalPageArena*>(arena());
|
| }
|
|
|
| -LargeObjectPage::LargeObjectPage(PageMemory* storage, BaseHeap* heap, size_t payloadSize)
|
| +LargeObjectPage::LargeObjectPage(PageMemory* storage, BaseArena* heap, size_t payloadSize)
|
| : BasePage(storage, heap)
|
| , m_payloadSize(payloadSize)
|
| #if ENABLE(ASAN_CONTAINER_ANNOTATIONS)
|
| @@ -1460,13 +1460,13 @@ bool LargeObjectPage::isEmpty()
|
|
|
| void LargeObjectPage::removeFromHeap()
|
| {
|
| - static_cast<LargeObjectHeap*>(heap())->freeLargeObjectPage(this);
|
| + static_cast<LargeObjectArena*>(arena())->freeLargeObjectPage(this);
|
| }
|
|
|
| void LargeObjectPage::sweep()
|
| {
|
| heapObjectHeader()->unmark();
|
| - heap()->threadState()->increaseMarkedObjectSize(size());
|
| + arena()->threadState()->increaseMarkedObjectSize(size());
|
| }
|
|
|
| void LargeObjectPage::makeConsistentForGC()
|
| @@ -1474,7 +1474,7 @@ void LargeObjectPage::makeConsistentForGC()
|
| HeapObjectHeader* header = heapObjectHeader();
|
| if (header->isMarked()) {
|
| header->unmark();
|
| - heap()->threadState()->increaseMarkedObjectSize(size());
|
| + arena()->threadState()->increaseMarkedObjectSize(size());
|
| } else {
|
| header->markDead();
|
| }
|
|
|