Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c88ec0937ab27555a59e986679429f52f1c90b30
https://github.com/WebKit/WebKit/commit/c88ec0937ab27555a59e986679429f52f1c90b30
Author: Yusuke Suzuki <[email protected]>
Date: 2025-12-30 (Tue, 30 Dec 2025)
Changed paths:
M Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js
M Source/JavaScriptCore/builtins/BuiltinNames.h
M Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp
M Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h
M Source/JavaScriptCore/bytecode/LinkTimeConstant.h
M Source/JavaScriptCore/runtime/CommonIdentifiers.h
M Source/JavaScriptCore/runtime/JSAsyncGenerator.h
M Source/JavaScriptCore/runtime/JSFunctionWithFields.h
M Source/JavaScriptCore/runtime/JSGlobalObject.cpp
M Source/JavaScriptCore/runtime/JSGlobalObject.h
M Source/JavaScriptCore/runtime/JSGlobalObjectInlines.h
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
M Source/JavaScriptCore/runtime/VM.cpp
M Source/JavaScriptCore/runtime/VM.h
Log Message:
-----------
[JSC] Move MicrotaskQueue driving AsyncGenerator code to C++ and remove
"WithoutPromise" variants
https://bugs.webkit.org/show_bug.cgi?id=304772
rdar://167318733
Reviewed by Sosuke Suzuki.
This patch adds MicrotaskQueue driving AsyncGenerator code in C++. But
importantly, we still keep JS version of that. The reason is that these
code can be called synchronously from `next()` call of AsyncGenerator,
and in this case, keeping them in JS is better for performance when it
is calling AsyncGenerator's body function. This also simplifies JS side
of AsyncGenerator code: we can inline `doAsyncGeneratorBodyCall` into
`asyncGeneratorResumeNext`.
As a result, we no longer need any "WithoutPromise" variants of
JSPromise related functions. We remove them since they can be replaced
with InternalMicrotask version instead.
* Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js:
(linkTimeConstant.asyncGeneratorResumeNext):
(linkTimeConstant.asyncGeneratorYieldAwaited): Deleted.
(linkTimeConstant.asyncGeneratorYieldOnRejected): Deleted.
(linkTimeConstant.asyncGeneratorYield):
(linkTimeConstant.doAsyncGeneratorBodyCallOnFulfilledNormal): Deleted.
(linkTimeConstant.doAsyncGeneratorBodyCallOnFulfilledReturn): Deleted.
(linkTimeConstant.doAsyncGeneratorBodyCall):
(linkTimeConstant.asyncGeneratorResumeNextOnFulfilled): Deleted.
(linkTimeConstant.asyncGeneratorResumeNextOnRejected): Deleted.
* Source/JavaScriptCore/builtins/BuiltinNames.h:
* Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* Source/JavaScriptCore/bytecode/BytecodeIntrinsicRegistry.h:
* Source/JavaScriptCore/bytecode/LinkTimeConstant.h:
* Source/JavaScriptCore/runtime/CommonIdentifiers.h:
* Source/JavaScriptCore/runtime/JSAsyncGenerator.h:
* Source/JavaScriptCore/runtime/JSFunctionWithFields.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
* Source/JavaScriptCore/runtime/JSGlobalObjectInlines.h:
(JSC::JSGlobalObject::iteratorProtocolFunction const):
(JSC::JSGlobalObject::asyncGeneratorYieldOnRejectedFunction const): Deleted.
* Source/JavaScriptCore/runtime/JSMicrotask.cpp:
(JSC::asyncGeneratorQueueIsEmpty):
(JSC::asyncGeneratorQueueDequeue):
(JSC::isSuspendYieldState):
(JSC::asyncGeneratorReject):
(JSC::asyncGeneratorResolve):
(JSC::asyncGeneratorYield):
(JSC::doAsyncGeneratorBodyCall):
(JSC::asyncGeneratorResumeNext):
(JSC::asyncGeneratorYieldAwaited):
(JSC::asyncGeneratorBodyCallNormal):
(JSC::asyncGeneratorBodyCallReturn):
(JSC::asyncGeneratorResumeNextReturn):
(JSC::runInternalMicrotask):
(JSC::promiseResolveThenableJobWithoutPromiseFastSlow): Deleted.
* Source/JavaScriptCore/runtime/JSPromise.cpp:
(JSC::JSPromise::performPromiseThen):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSPromise::triggerPromiseReactions):
(JSC::JSPromise::resolveWithoutPromiseForAsyncAwait): Deleted.
(JSC::JSPromise::resolveWithoutPromise): Deleted.
(JSC::JSPromise::rejectWithoutPromise): Deleted.
(JSC::JSPromise::fulfillWithoutPromise): Deleted.
* Source/JavaScriptCore/runtime/JSPromise.h:
* Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp:
(JSC::promiseRaceSlow):
* Source/JavaScriptCore/runtime/Microtask.h:
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::promiseResolvingFunctionResolveWithInternalMicrotaskExecutableSlow):
(JSC::VM::promiseResolvingFunctionRejectWithInternalMicrotaskExecutableSlow):
(JSC::VM::visitAggregateImpl):
(JSC::VM::promiseResolvingFunctionResolveWithoutPromiseExecutableSlow): Deleted.
(JSC::VM::promiseResolvingFunctionRejectWithoutPromiseExecutableSlow): Deleted.
* Source/JavaScriptCore/runtime/VM.h:
(JSC::VM::promiseResolvingFunctionResolveWithInternalMicrotaskExecutable):
(JSC::VM::promiseResolvingFunctionRejectWithInternalMicrotaskExecutable):
(JSC::VM::promiseResolvingFunctionResolveWithoutPromiseExecutable): Deleted.
(JSC::VM::promiseResolvingFunctionRejectWithoutPromiseExecutable): Deleted.
Canonical link: https://commits.webkit.org/304998@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications