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()); |