Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ad5c326d784521842d7b246bdd546f8ef236c85b
https://github.com/WebKit/WebKit/commit/ad5c326d784521842d7b246bdd546f8ef236c85b
Author: Sosuke Suzuki <[email protected]>
Date: 2025-11-11 (Tue, 11 Nov 2025)
Changed paths:
M Source/JavaScriptCore/runtime/JSMicrotask.cpp
M Source/JavaScriptCore/runtime/JSPromise.cpp
M Source/JavaScriptCore/runtime/JSPromise.h
M Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp
M Source/JavaScriptCore/runtime/Microtask.h
Log Message:
-----------
[JSC] Add new internal microtask `PromiseFirstResolveWithoutHandlerJob` for
`Promise.race`
https://bugs.webkit.org/show_bug.cgi?id=302151
Reviewed by Yusuke Suzuki.
This patch adds a new internal microtask,
`PromiseFirstResolveWithoutHandlerJob`.
It is very similar to the existing `PromiseResolveWithoutHandlerJob`, but
differs
in that it returns early without doing anything if the target promise is already
fulfilled.
This reduces unnecessary function allocations in the fast path of
`Promise.race`.
TipOfTree Patched
promise-race 7.4727+-0.3047 ^ 3.4886+-0.1515 ^
definitely 2.1420x faster
* Source/JavaScriptCore/runtime/JSMicrotask.cpp:
(JSC::runInternalMicrotask):
* Source/JavaScriptCore/runtime/JSPromise.cpp:
(JSC::JSPromise::performPromiseThenWithInternalMicrotask):
(JSC::JSPromise::triggerPromiseReactions):
* Source/JavaScriptCore/runtime/JSPromise.h:
* Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/Microtask.h:
Canonical link: https://commits.webkit.org/302896@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications