Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0b50860edfd4388c393278c559686121406f429e
      
https://github.com/WebKit/WebKit/commit/0b50860edfd4388c393278c559686121406f429e
  Author: Geoffrey Garen <[email protected]>
  Date:   2025-10-30 (Thu, 30 Oct 2025)

  Changed paths:
    M Source/JavaScriptCore/b3/B3GenericBlockInsertionSet.h
    M Source/JavaScriptCore/b3/B3InsertionSet.cpp
    M Source/JavaScriptCore/b3/air/AirInsertionSet.cpp
    M Source/JavaScriptCore/b3/air/AirOptimizeBlockOrder.cpp
    M Source/JavaScriptCore/b3/air/AirPhaseInsertionSet.cpp
    M Source/JavaScriptCore/bytecode/BytecodeRewriter.cpp
    M Source/JavaScriptCore/jit/JIT.cpp
    M Source/JavaScriptCore/runtime/ScopedArgumentsTable.cpp
    M Source/WTF/wtf/AccessibleAddress.h
    M Source/WTF/wtf/Atomics.h
    M Source/WTF/wtf/BitSet.h
    M Source/WTF/wtf/Brigand.h
    M Source/WTF/wtf/BubbleSort.h
    M Source/WTF/wtf/CagedPtr.h
    M Source/WTF/wtf/CagedUniquePtr.h
    M Source/WTF/wtf/CodePtr.h
    M Source/WTF/wtf/ConcurrentPtrHashSet.cpp
    M Source/WTF/wtf/ConcurrentPtrHashSet.h
    M Source/WTF/wtf/MetaAllocator.cpp
    M Source/WTF/wtf/StdLibExtras.h

  Log Message:
  -----------
  Reduce unsafe buffer usage in WTF
https://bugs.webkit.org/show_bug.cgi?id=301631
rdar://163646249

Reviewed by Chris Dumez.

* Source/WTF/wtf/Atomics.h:
(WTF::Dependency::consume): Move the unsafe behavior into a helper function in
StdLibExtras to avoid sprinkling unsafe throughout the project and to establish
a self-documenting abstraction that verifies its bounds safety with an ASSERT.

* Source/WTF/wtf/BitSet.h:
(WTF::WordType>::concurrentTestAndSet):
(WTF::WordType>::concurrentTestAndClear): Use operator[] instead of pointer
arithmetic since operator[] is checked.

* Source/WTF/wtf/Brigand.h:
(brigand::detail::count_bools): Use std::array instead of C array, since 
std::array
is bounds-safe.

* Source/WTF/wtf/BubbleSort.h:
(WTF::bubbleSort): Use span instead of iterators since span is bounds-safe.

* Source/WTF/wtf/CagedPtr.h: Mark our function unsafe so that callers get
labeled unsafe instead of us; we don't have the information required to make
this behavior safe internally.

* Source/WTF/wtf/CagedUniquePtr.h:
(WTF::CagedUniquePtr::create):
(WTF::CagedUniquePtr::tryCreate): Use span instead of raw pointer because span
is bounds-safe.

* Source/WTF/wtf/CodePtr.h:
(WTF::CodePtr::operator+ const):
(WTF::CodePtr::operator- const):
(WTF::CodePtr::operator+=):
(WTF::CodePtr::operator-=): Mark our function unsafe so that callers get
labeled unsafe instead of us; we don't have the information required to make
this behavior safe internally.

* Source/WTF/wtf/ConcurrentPtrHashSet.cpp:
(WTF::ConcurrentPtrHashSet::deleteOldTables):
(WTF::ConcurrentPtrHashSet::initialize):
(WTF::ConcurrentPtrHashSet::addSlow):
(WTF::ConcurrentPtrHashSet::containsImplSlow const):
(WTF::ConcurrentPtrHashSet::sizeSlow const):
(WTF::ConcurrentPtrHashSet::resizeIfNecessary):
(WTF::ConcurrentPtrHashSet::Table::create):
(WTF::ConcurrentPtrHashSet::Table::createStub):
(WTF::ConcurrentPtrHashSet::Table::initializeStub): Deleted.
* Source/WTF/wtf/ConcurrentPtrHashSet.h: Use TrailingArray instead of 
hand-coding
a trailing array. I had to out-of-line the stub table because TrailingArray
must be out of line.
* Source/WTF/wtf/MetaAllocator.cpp:
* Source/WTF/wtf/StdLibExtras.h:
(WTF::addOpaqueZero):

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



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

Reply via email to