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

  Changed paths:
    M Source/WTF/wtf/Liveness.h
    M Source/WTF/wtf/SparseBitVector.h
    M Tools/TestWebKitAPI/Tests/WTF/SparseBitVector.cpp

  Log Message:
  -----------
  [JSC][WTF] WTF::Liveness should use BitVector / SparseBitVector for the 
external workset
https://bugs.webkit.org/show_bug.cgi?id=317551
rdar://180251801

Reviewed by Marcus Plutowski.

We use BitVector (internally Vector<uint64_t> for direct bulk access) and
SparseBitVector in WTF::Liveness. But for the external interface, we are
converting them to Vector to expose. But this is wasteful. Let's just
expose these BitVector as a result. Wrap them with common interface not
to switch BitVector v.s. SparseBitVector from the client side.

* Source/WTF/wtf/Liveness.h:
(WTF::Liveness::Liveness):
(WTF::Liveness::wordsForBits):
(WTF::Liveness::Workset::initialize):
(WTF::Liveness::Workset::clear):
(WTF::Liveness::Workset::add):
(WTF::Liveness::Workset::remove):
(WTF::Liveness::Workset::contains const):
(WTF::Liveness::Workset::copyFromDense):
(WTF::Liveness::Workset::copyFromSparse):
(WTF::Liveness::Workset::storage const):
(WTF::Liveness::Iterator::makeBegin):
(WTF::Liveness::Iterator::makeEnd):
(WTF::Liveness::Iterator::operator* const):
(WTF::Liveness::Iterator::operator++):
(WTF::Liveness::Iterator::operator== const):
(WTF::Liveness::Iterator::advanceDense):
(WTF::Liveness::Iterable::Iterable):
(WTF::Liveness::Iterable::contains const):
(WTF::Liveness::LocalCalc::LocalCalc):
(WTF::Liveness::LocalCalc::Iterable::Iterable):
(WTF::Liveness::LocalCalc::Iterable::contains const):
(WTF::Liveness::LocalCalc::isLive const):
(WTF::Liveness::LocalCalc::execute):
(WTF::Liveness::LiveAtHead::LiveAtHead):
(WTF::Liveness::LiveAtHead::isLiveAtHead):
(WTF::Liveness::compute):
(WTF::Liveness::computeDense):
(WTF::Liveness::computeSparse):
(WTF::Liveness::denseHalfWords const):
(WTF::Liveness::sparseHalfSize const):
(WTF::Liveness::LocalCalc::Iterable::iterator::iterator): Deleted.
(WTF::Liveness::LocalCalc::Iterable::iterator::operator++): Deleted.
(WTF::Liveness::LocalCalc::Iterable::iterator::operator* const): Deleted.
(WTF::Liveness::LocalCalc::Iterable::iterator::operator== const): Deleted.
(WTF::Liveness::LocalCalc::live const): Deleted.
(WTF::Liveness::rawLiveAtHead): Deleted.
(WTF::Liveness::Iterable::iterator::iterator): Deleted.
(WTF::Liveness::Iterable::iterator::operator*): Deleted.
(WTF::Liveness::Iterable::iterator::operator++): Deleted.
(WTF::Liveness::Iterable::iterator::operator== const): Deleted.
(WTF::Liveness::liveAtHead): Deleted.
(WTF::Liveness::liveAtTail): Deleted.
* Source/WTF/wtf/SparseBitVector.h:
(WTF::SparseBitVector::iterator::iterator):
(WTF::SparseBitVector::iterator::operator* const):
(WTF::SparseBitVector::iterator::operator++):
(WTF::SparseBitVector::iterator::operator== const):
* Tools/TestWebKitAPI/Tests/WTF/SparseBitVector.cpp:
(TestWebKitAPI::collectViaIterator):
(TestWebKitAPI::TEST(WTF_SparseBitVector, IteratorEmpty)):
(TestWebKitAPI::TEST(WTF_SparseBitVector, IteratorSingleBit)):
(TestWebKitAPI::TEST(WTF_SparseBitVector, IteratorWithinSingleElement)):
(TestWebKitAPI::TEST(WTF_SparseBitVector, IteratorCrossesElementBoundaries)):
(TestWebKitAPI::TEST(WTF_SparseBitVector, IteratorMatchesForEachSetBit)):
(TestWebKitAPI::TEST(WTF_SparseBitVector, IteratorAfterClear)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to