Changeset 202827 in webkit
- Timestamp:
- Jul 5, 2016 12:49:19 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r202818 r202827 1 2016-07-05 Saam Barati <sbarati@apple.com> 2 3 reportAbandonedObjectGraph should report abandoned bytes based on capacity() so it works even if a GC has never happened 4 https://bugs.webkit.org/show_bug.cgi?id=159222 5 <rdar://problem/27001991> 6 7 Reviewed by Geoffrey Garen. 8 9 When reportAbandonedObjectGraph() was called before the first GC, it used to 10 not indicate to the GC timers that we have memory that needs to be collected 11 because the calculation was based on m_sizeAfterLastCollect (which was zero). 12 This patch makes the calculation based on capacity() which is a valid number 13 even before the first GC. 14 15 * heap/Heap.cpp: 16 (JSC::Heap::reportAbandonedObjectGraph): 17 (JSC::Heap::protect): 18 (JSC::Heap::didAbandon): Deleted. 19 * heap/Heap.h: 20 (JSC::Heap::jitStubRoutines): 21 1 22 2016-07-05 Csaba Osztrogonác <ossy@webkit.org> 2 23 -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r202394 r202827 433 433 // Our clients don't know exactly how much memory they 434 434 // are abandoning so we just guess for them. 435 double abandonedBytes = 0.1 * m_sizeAfterLastCollect;435 size_t abandonedBytes = static_cast<size_t>(0.1 * capacity()); 436 436 437 437 // We want to accelerate the next collection. Because memory has just … … 439 439 // be more profitable. Since allocation is the trigger for collection, 440 440 // we hasten the next collection by pretending that we've allocated more memory. 441 didAbandon(abandonedBytes);442 }443 444 void Heap::didAbandon(size_t bytes)445 {446 441 if (m_fullActivityCallback) { 447 442 m_fullActivityCallback->didAllocate( 448 443 m_sizeAfterLastCollect - m_sizeAfterLastFullCollect + m_bytesAllocatedThisCycle + m_bytesAbandonedSinceLastFullCollect); 449 444 } 450 m_bytesAbandonedSinceLastFullCollect += bytes;445 m_bytesAbandonedSinceLastFullCollect += abandonedBytes; 451 446 } 452 447 -
trunk/Source/JavaScriptCore/heap/Heap.h
r202402 r202827 230 230 231 231 void didAllocate(size_t); 232 void didAbandon(size_t);233 234 232 bool isPagedOut(double deadline); 235 233
Note: See TracChangeset
for help on using the changeset viewer.