Currently our copying collection occurs simultaneously with the marking phase. We'd like to be able to reuse CopiedBlocks as soon as they become fully evacuated, but this is not currently possible because we don't know the liveness statistics of each old CopiedBlock until marking/copying has already finished. Instead, we have to allocate additional memory from the OS to use as our working set of CopiedBlocks while copying. We then return the fully evacuated old CopiedBlocks back to the block allocator, thus giving our copying phase an O(live bytes) overhead. To fix this, we should instead split the copying phase apart from the marking phase. This way we have full liveness data for each CopiedBlock during the copying phase so that we can reuse them the instant they become fully evacuated. With the additional liveness data that each CopiedBlock accumulates, we can add some additional heuristics to the collector. For example, we can calculate our global Heap fragmentation and only choose to do a copying phase if that fragmentation exceeds some limit. As another example, we can skip copying blocks that are already above a particular fragmentation limit, which allows older objects to coalesce into blocks that are rarely copied.
Created attachment 167822 [details] Patch
Attachment 167822 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/runtime/JSCell.h:40: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 28 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 167822 [details] Patch Attachment 167822 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/14250022
Created attachment 167825 [details] Patch
Attachment 167825 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'S..." exit_code: 1 Source/JavaScriptCore/runtime/JSCell.h:40: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 32 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 167825 [details] Patch Attachment 167825 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/14223828
Created attachment 167831 [details] Patch
Attachment 167831 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'S..." exit_code: 1 Source/JavaScriptCore/runtime/JSCell.h:40: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 32 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 167831 [details] Patch Attachment 167831 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/14249063
Created attachment 167835 [details] Patch
Attachment 167835 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'S..." exit_code: 1 Source/JavaScriptCore/runtime/JSCell.h:40: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 32 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 167853 [details] Patch
Attachment 167853 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'S..." exit_code: 1 Source/JavaScriptCore/runtime/JSCell.h:40: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 33 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 168115 [details] Patch
Attachment 168115 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'S..." exit_code: 1 Source/JavaScriptCore/runtime/JSCell.h:41: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 33 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 168115 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=168115&action=review > Source/JavaScriptCore/runtime/Options.h:120 > + v(double, maxCopiedSpaceFragmentation, 0.8) \ > + v(double, maxCopiedBlockFragmentation, 0.9) \ I believe the right word here is "min...Utilization". "Fragmentation" usually means the wasted space, not the used space.
Created attachment 168230 [details] Patch
Attachment 168230 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'S..." exit_code: 1 Source/JavaScriptCore/runtime/JSCell.h:41: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 33 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 168285 [details] Patch
Attachment 168285 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'S..." exit_code: 1 Source/JavaScriptCore/runtime/JSCell.h:41: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 33 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 168285 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=168285&action=review > Source/JavaScriptCore/heap/GCThread.cpp:88 > + { > + MutexLocker locker(m_shared.m_markingLock); > + } Add a comment to say why this trick works. > Source/JavaScriptCore/heap/GCThread.cpp:94 > + m_slotVisitor->drainFromShared(SlotVisitor::SlaveDrain); One sentence comment about termination condition for marking, please. > Source/JavaScriptCore/heap/GCThread.cpp:98 > + m_copyVisitor->copyFromShared(); One sentence comment about termination condition for copying, please. > Source/JavaScriptCore/heap/Heap.h:267 > + struct CopyFunctor : public MarkedBlock::VoidFunctor { Up to you, but you could rename it to something like MarkedBlockSnapshotFunctor.
Committed r131213: <http://trac.webkit.org/changeset/131213>
(In reply to comment #22) > Committed r131213: <http://trac.webkit.org/changeset/131213> ... and buildfixes landed in: https://trac.webkit.org/changeset/131215 https://trac.webkit.org/changeset/131225
(In reply to comment #22) > Committed r131213: <http://trac.webkit.org/changeset/131213> And it made all tests crash on Qt ARM - https://bugs.webkit.org/show_bug.cgi?id=99328
(In reply to comment #24) > (In reply to comment #22) > > Committed r131213: <http://trac.webkit.org/changeset/131213> > > And it made all tests crash on Qt ARM - https://bugs.webkit.org/show_bug.cgi?id=99328 It's odd that it only made ARMv7 fail. I added a new use of WTF::weakCompareAndSwap which would be called during the marking phase in CopiedBlock::reportLiveBytes. Maybe that's what's causing the crash if ARMv7 doesn't support CAS?
I filed bug 99331 as a potential fix for the ARM crashes.