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

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

Issue 1395493008: Revert of Oilpan: always shrink tail-allocated backing storage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/HeapPage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/HeapAllocator.cpp
diff --git a/third_party/WebKit/Source/platform/heap/HeapAllocator.cpp b/third_party/WebKit/Source/platform/heap/HeapAllocator.cpp
index 7531234ead993dd62f5872c0a72163490c5e41e3..8d27428b2d4aa8084f36731368b34a4b7d6827ac 100644
--- a/third_party/WebKit/Source/platform/heap/HeapAllocator.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapAllocator.cpp
@@ -88,6 +88,12 @@
bool HeapAllocator::backingShrink(void* address, size_t quantizedCurrentSize, size_t quantizedShrunkSize)
{
+ // We shrink the object only if the shrinking will make a non-small
+ // prompt-free block.
+ // FIXME: Optimize the threshold size.
+ if (quantizedCurrentSize <= quantizedShrunkSize + sizeof(HeapObjectHeader) + sizeof(void*) * 32)
+ return true;
+
if (!address)
return true;
@@ -106,12 +112,6 @@
HeapObjectHeader* header = HeapObjectHeader::fromPayload(address);
ASSERT(header->checkHeader());
NormalPageHeap* heap = static_cast<NormalPage*>(page)->heapForNormalPage();
- // We shrink the object only if the shrinking will make a non-small
- // prompt-free block.
- // FIXME: Optimize the threshold size.
- if (quantizedCurrentSize <= quantizedShrunkSize + sizeof(HeapObjectHeader) + sizeof(void*) * 32 && !heap->isObjectAllocatedAtAllocationPoint(header))
- return true;
-
bool succeededAtAllocationPoint = heap->shrinkObject(header, quantizedShrunkSize);
if (succeededAtAllocationPoint)
state->allocationPointAdjusted(heap->heapIndex());
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/HeapPage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698