Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9c616fc9e30d3ee297b2f6838b986365f1d0cd7c
      
https://github.com/WebKit/WebKit/commit/9c616fc9e30d3ee297b2f6838b986365f1d0cd7c
  Author: Yusuke Suzuki <[email protected]>
  Date:   2025-12-07 (Sun, 07 Dec 2025)

  Changed paths:
    A JSTests/microbenchmarks/promise-all-settled.js
    M Source/JavaScriptCore/builtins/PromiseConstructor.js
    M Source/JavaScriptCore/interpreter/Interpreter.cpp
    M Source/JavaScriptCore/runtime/CommonIdentifiers.h
    M Source/JavaScriptCore/runtime/JSFunctionWithFields.h
    M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
    M Source/JavaScriptCore/runtime/JSGlobalObject.h
    M Source/JavaScriptCore/runtime/JSMicrotask.cpp
    M Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp
    M Source/JavaScriptCore/runtime/JSPromiseConstructor.h
    M Source/JavaScriptCore/runtime/Microtask.h
    M Source/JavaScriptCore/runtime/SmallStrings.cpp
    M Source/JavaScriptCore/runtime/SmallStrings.h
    M Source/JavaScriptCore/runtime/VM.cpp
    M Source/JavaScriptCore/runtime/VM.h

  Log Message:
  -----------
  [JSC] Move Promise.allSettled to C++
https://bugs.webkit.org/show_bug.cgi?id=303706
rdar://166007973

Reviewed by Sosuke Suzuki.

This patch moves Promise.allSettled to C++. This is similar to
304039@main which moves Promise.all to C++. We introduce
PromiseAllSettledResolveJob internal microtask to handle the common case
efficiently without invoking JS function from MicrotaskQueue.

                                    ToT                     Patched

    promise-all-settled       16.4862+-0.9895     ^     10.2508+-0.7836        
^ definitely 1.6083x faster

Test: JSTests/microbenchmarks/promise-all-settled.js

* JSTests/microbenchmarks/promise-all-settled.js: Added.
* Source/JavaScriptCore/builtins/PromiseConstructor.js:
(allSettled): Deleted.
* Source/JavaScriptCore/interpreter/Interpreter.cpp:
(JSC::Interpreter::getAsyncStackTrace):
* Source/JavaScriptCore/runtime/CommonIdentifiers.h:
* Source/JavaScriptCore/runtime/JSFunctionWithFields.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::promiseAllSettledFulfilledResultStructure const):
(JSC::JSGlobalObject::promiseAllSettledRejectedResultStructure const):
* Source/JavaScriptCore/runtime/JSMicrotask.cpp:
(JSC::runInternalMicrotask):
* Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp:
(JSC::promiseAllSettledSlow):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::createPromiseAllSettledFulfilledResultStructure):
(JSC::createPromiseAllSettledRejectedResultStructure):
(JSC::createPromiseAllSettledFulfilledResult):
(JSC::createPromiseAllSettledRejectedResult):
* Source/JavaScriptCore/runtime/JSPromiseConstructor.h:
* Source/JavaScriptCore/runtime/Microtask.h:
* Source/JavaScriptCore/runtime/SmallStrings.cpp:
(JSC::SmallStrings::initializeCommonStrings):
(JSC::SmallStrings::visitStrongReferences):
* Source/JavaScriptCore/runtime/SmallStrings.h:
(JSC::SmallStrings::fulfilledString const):
(JSC::SmallStrings::rejectedString const):
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::promiseAllSettledFulfillFunctionExecutableSlow):
(JSC::VM::promiseAllSettledRejectFunctionExecutableSlow):
(JSC::VM::promiseAllSettledSlowFulfillFunctionExecutableSlow):
(JSC::VM::promiseAllSettledSlowRejectFunctionExecutableSlow):
(JSC::VM::visitAggregateImpl):
* Source/JavaScriptCore/runtime/VM.h:
(JSC::VM::promiseAllSettledFulfillFunctionExecutable):
(JSC::VM::promiseAllSettledRejectFunctionExecutable):
(JSC::VM::promiseAllSettledSlowFulfillFunctionExecutable):
(JSC::VM::promiseAllSettledSlowRejectFunctionExecutable):

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



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

Reply via email to