Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e498e0debab264e2d840a9e74613b60c420d04f4
      
https://github.com/WebKit/WebKit/commit/e498e0debab264e2d840a9e74613b60c420d04f4
  Author: Yusuke Suzuki <[email protected]>
  Date:   2025-06-30 (Mon, 30 Jun 2025)

  Changed paths:
    M Source/JavaScriptCore/heap/MarkedBlock.cpp
    M Source/JavaScriptCore/heap/MarkedBlock.h
    M Source/JavaScriptCore/heap/MarkedBlockInlines.h
    M Source/JavaScriptCore/runtime/OptionsList.h

  Log Message:
  -----------
  [JSC] Use BitSet for MarkedBlock::sweep
https://bugs.webkit.org/show_bug.cgi?id=295083
rdar://154457450

Reviewed by Yijia Huang.

This patch changes MarkedBlock::sweep by using BitSet.

1. Instead of iterating each cell, this patch uses BitSet.
   We construct these set from m_marks and m_newlyAllocated.
   These BitSet will answer liveness information super quickly,
   and iterating these bits are very efficient, in particular
   given that BitSet is already sparse (since atom size is smaller
   than cell size in most cases).
2. We copy BitSet before iterating them. So we can get snapshot of
   liveness information. We no longer need to push cells to the
   Vector for concurrent marking case since this liveness information
   is enough.
3. We construct FreeList in a forward direction. And we also call
   scribble / destructor too. So we can keep touching the same region
   well. Furthermore, we can do destroy calls in a bulk manner.
4. We leverage "unswept" bit and avoid calling destructors when unswept
   bit was not set. This happens when we call resumeAllocation
   (reconstructing FreeList to resume peripheral threads). In this case,
   we do not need to call destructors since our liveness condition is
   not changed from the previous sweeping, otherwise, unswept bit is
   updated.
5. We also remove useBumpAllocator option. Now we are always using
   interval based FreeList. So this option is meaningless.

* Source/JavaScriptCore/heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::sweep):
* Source/JavaScriptCore/heap/MarkedBlock.h:
* Source/JavaScriptCore/heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::specializedSweep):
(JSC::MarkedBlock::Handle::sweepDestructionMode):
(JSC::DeadCellStorage::append): Deleted.
(): Deleted.
* Source/JavaScriptCore/runtime/OptionsList.h:

Canonical link: https://commits.webkit.org/296816@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to