[webkit-changes] [WebKit/WebKit] ad5bc6: Introduce new Vector constructor that takes in a l...

Chris Dumez noreply at github.com
Tue Oct 3 11:02:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ad5bc6db70f64c61cec477c458f7a921fc8e951e
      https://github.com/WebKit/WebKit/commit/ad5bc6db70f64c61cec477c458f7a921fc8e951e
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-10-03 (Tue, 03 Oct 2023)

  Changed paths:
    M Source/JavaScriptCore/API/APICallbackFunction.h
    M Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
    M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
    M Source/JavaScriptCore/wasm/WasmTypeDefinition.cpp
    M Source/JavaScriptCore/wasm/WasmWorklist.cpp
    M Source/WTF/wtf/Vector.h
    M Source/WTF/wtf/WorkQueue.cpp
    M Source/WebCore/css/CSSImageSetValue.cpp
    M Tools/TestWebKitAPI/Tests/WTF/Vector.cpp

  Log Message:
  -----------
  Introduce new Vector constructor that takes in a length and a lambda to generate vector items
https://bugs.webkit.org/show_bug.cgi?id=262523

Reviewed by Darin Adler.

Introduce new Vector constructor that takes in a length and a lambda to generate vector items.
This allows us to construct vectors safely and more efficiently without the explicit use of
Vector::uncheckedAppend(), which recently became an alias for Vector::append().

Adopt this new constructor in a few places to get rid of some Vector::uncheckedAppend() calls.

* Source/JavaScriptCore/API/APICallbackFunction.h:
(JSC::APICallbackFunction::callImpl):
(JSC::APICallbackFunction::constructImpl):
* Source/JavaScriptCore/API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::constructImpl):
(JSC::JSCallbackObject<Parent>::callImpl):
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::addSwitch):
* Source/JavaScriptCore/wasm/WasmTypeDefinition.cpp:
(JSC::Wasm::TypeDefinition::replacePlaceholders const):
* Source/JavaScriptCore/wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::Worklist):
* Source/WTF/wtf/Vector.h:
(WTF::Vector::Vector):
* Source/WTF/wtf/WorkQueue.cpp:
(WTF::ConcurrentWorkQueue::apply):
* Source/WebCore/css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::createStyleImage const):
* Tools/TestWebKitAPI/Tests/WTF/Vector.cpp:
(TestWebKitAPI::TEST):

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




More information about the webkit-changes mailing list