Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(732)

Unified Diff: third_party/WebKit/Source/platform/heap/HeapPage.cpp

Issue 1670463002: [Oilpan] Unify memory usage reporters of Oilpan (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 e9dcbe158cc2575f8f7b60b7ee480973c5e0c325..ea547ff281ce9b05da2ea9953a1770c613843c89 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
@@ -545,7 +545,7 @@ bool NormalPageHeap::coalesce()
if (startOfGap != page->payloadEnd())
addToFreeList(startOfGap, page->payloadEnd() - startOfGap);
}
- Heap::decreaseAllocatedObjectSize(freedSize);
+ threadState()->decreaseAllocatedObjectSize(freedSize);
ASSERT(m_promptlyFreedSize == freedSize);
m_promptlyFreedSize = 0;
return true;
@@ -663,16 +663,16 @@ void NormalPageHeap::setRemainingAllocationSize(size_t newRemainingAllocationSiz
// - if previous alloc checkpoint is larger, allocation size has increased.
// - if smaller, a net reduction in size since last call to updateRemainingAllocationSize().
if (m_lastRemainingAllocationSize > m_remainingAllocationSize)
- Heap::increaseAllocatedObjectSize(m_lastRemainingAllocationSize - m_remainingAllocationSize);
+ threadState()->increaseAllocatedObjectSize(m_lastRemainingAllocationSize - m_remainingAllocationSize);
else if (m_lastRemainingAllocationSize != m_remainingAllocationSize)
- Heap::decreaseAllocatedObjectSize(m_remainingAllocationSize - m_lastRemainingAllocationSize);
+ threadState()->decreaseAllocatedObjectSize(m_remainingAllocationSize - m_lastRemainingAllocationSize);
m_lastRemainingAllocationSize = m_remainingAllocationSize;
}
void NormalPageHeap::updateRemainingAllocationSize()
{
if (m_lastRemainingAllocationSize > remainingAllocationSize()) {
- Heap::increaseAllocatedObjectSize(m_lastRemainingAllocationSize - remainingAllocationSize());
+ threadState()->increaseAllocatedObjectSize(m_lastRemainingAllocationSize - remainingAllocationSize());
m_lastRemainingAllocationSize = remainingAllocationSize();
}
ASSERT(m_lastRemainingAllocationSize == remainingAllocationSize());
@@ -839,7 +839,7 @@ Address LargeObjectHeap::doAllocateLargeObjectPage(size_t allocationSize, size_t
largeObject->link(&m_firstPage);
Heap::increaseAllocatedSpace(largeObject->size());
- Heap::increaseAllocatedObjectSize(largeObject->size());
+ threadState()->increaseAllocatedObjectSize(largeObject->size());
return result;
}
@@ -1125,6 +1125,7 @@ void NormalPage::sweep()
{
size_t markedObjectSize = 0;
Address startOfGap = payload();
+ NormalPageHeap* pageHeap = heapForNormalPage();
for (Address headerAddress = startOfGap; headerAddress < payloadEnd(); ) {
HeapObjectHeader* header = reinterpret_cast<HeapObjectHeader*>(headerAddress);
size_t size = header->size();
@@ -1132,7 +1133,7 @@ void NormalPage::sweep()
ASSERT(size < blinkPagePayloadSize());
if (header->isPromptlyFreed())
- heapForNormalPage()->decreasePromptlyFreedSize(size);
+ pageHeap->decreasePromptlyFreedSize(size);
if (header->isFree()) {
// Zero the memory in the free list header to maintain the
// invariant that memory on the free list is zero filled.
@@ -1163,7 +1164,7 @@ void NormalPage::sweep()
continue;
}
if (startOfGap != headerAddress) {
- heapForNormalPage()->addToFreeList(startOfGap, headerAddress - startOfGap);
+ pageHeap->addToFreeList(startOfGap, headerAddress - startOfGap);
#if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER)
// Discarding pages increases page faults and may regress performance.
// So we enable this only on low-RAM devices.
@@ -1177,7 +1178,7 @@ void NormalPage::sweep()
startOfGap = headerAddress;
}
if (startOfGap != payloadEnd()) {
- heapForNormalPage()->addToFreeList(startOfGap, payloadEnd() - startOfGap);
+ pageHeap->addToFreeList(startOfGap, payloadEnd() - startOfGap);
#if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER)
if (Heap::isLowEndDevice())
discardPages(startOfGap + sizeof(FreeListEntry), payloadEnd());
@@ -1185,7 +1186,7 @@ void NormalPage::sweep()
}
if (markedObjectSize)
- Heap::increaseMarkedObjectSize(markedObjectSize);
+ pageHeap->threadState()->increaseMarkedObjectSize(markedObjectSize);
}
void NormalPage::makeConsistentForGC()
@@ -1210,7 +1211,7 @@ void NormalPage::makeConsistentForGC()
headerAddress += header->size();
}
if (markedObjectSize)
- Heap::increaseMarkedObjectSize(markedObjectSize);
+ heapForNormalPage()->threadState()->increaseMarkedObjectSize(markedObjectSize);
}
void NormalPage::makeConsistentForMutator()
@@ -1477,7 +1478,7 @@ void LargeObjectPage::removeFromHeap()
void LargeObjectPage::sweep()
{
heapObjectHeader()->unmark();
- Heap::increaseMarkedObjectSize(size());
+ heap()->threadState()->increaseMarkedObjectSize(size());
}
void LargeObjectPage::makeConsistentForGC()
@@ -1485,7 +1486,7 @@ void LargeObjectPage::makeConsistentForGC()
HeapObjectHeader* header = heapObjectHeader();
if (header->isMarked()) {
header->unmark();
- Heap::increaseMarkedObjectSize(size());
+ heap()->threadState()->increaseMarkedObjectSize(size());
} else {
header->markDead();
}
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698