Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7a597ba1b58e80eac0e77815d59adc2d618fadc1
      
https://github.com/WebKit/WebKit/commit/7a597ba1b58e80eac0e77815d59adc2d618fadc1
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-03-13 (Fri, 13 Mar 2026)

  Changed paths:
    A JSTests/stress/microtask-call-caching.js
    M Source/JavaScriptCore/CMakeLists.txt
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/Sources.txt
    M Source/JavaScriptCore/bytecode/CallLinkInfoBase.cpp
    M Source/JavaScriptCore/bytecode/CallLinkInfoBase.h
    M Source/JavaScriptCore/interpreter/Interpreter.cpp
    M Source/JavaScriptCore/interpreter/Interpreter.h
    A Source/JavaScriptCore/interpreter/MicrotaskCall.cpp
    A Source/JavaScriptCore/interpreter/MicrotaskCall.h
    A Source/JavaScriptCore/interpreter/MicrotaskCallInlines.h
    M Source/JavaScriptCore/runtime/JSMicrotask.cpp
    M Source/JavaScriptCore/runtime/JSMicrotask.h
    M Source/JavaScriptCore/runtime/MicrotaskQueue.cpp

  Log Message:
  -----------
  [JSC] Add MicrotaskCall
https://bugs.webkit.org/show_bug.cgi?id=309881
rdar://172458722

Reviewed by Yijia Huang.

This patch adds MicrotaskCall, which is similar to CachedCall, but much
more tailored for MicrotaskQueue.

1. This is more aligned to Closure Call in DataOnlyCallLinkInfo. So we
   cache the FunctionExecutable* and based on that, we cache CodeBlock*.
2. Available # of arguments are aligned to microtask.
3. A lot of setup are skipped because it is for microtask invocation.

Test: JSTests/stress/microtask-call-caching.js
* JSTests/stress/microtask-call-caching.js: Added.
(const.handler):
(Promise.all.promises.then):
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/bytecode/CallLinkInfoBase.cpp:
(JSC::CallLinkInfoBase::unlinkOrUpgrade):
* Source/JavaScriptCore/bytecode/CallLinkInfoBase.h:
* Source/JavaScriptCore/interpreter/Interpreter.cpp:
(JSC::Interpreter::prepareForMicrotaskCall):
* Source/JavaScriptCore/interpreter/Interpreter.h:
* Source/JavaScriptCore/interpreter/MicrotaskCall.cpp: Added.
(JSC::MicrotaskCall::initialize):
(JSC::MicrotaskCall::relink):
(JSC::MicrotaskCall::unlinkOrUpgradeImpl):
* Source/JavaScriptCore/interpreter/MicrotaskCall.h: Added.
(JSC::MicrotaskCall::MicrotaskCall):
(JSC::MicrotaskCall::~MicrotaskCall):
(JSC::MicrotaskCall::isInitializedFor const):
(JSC::MicrotaskCall::functionExecutable):
* Source/JavaScriptCore/interpreter/MicrotaskCallInlines.h: Added.
(JSC::MicrotaskCall::callWithArguments):
* Source/JavaScriptCore/runtime/JSMicrotask.cpp:
(JSC::callMicrotask):
(JSC::promiseResolveThenableJob):
(JSC::asyncFromSyncIteratorContinueOrDone):
(JSC::asyncGeneratorBodyCall):
(JSC::promiseFinallyReactionJob):
(JSC::runInternalMicrotask):
* Source/JavaScriptCore/runtime/JSMicrotask.h:
* Source/JavaScriptCore/runtime/MicrotaskQueue.cpp:
(JSC::runMicrotask):
(JSC::runMicrotaskWithDebugger):
(JSC::MicrotaskQueue::drainImpl):

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



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

Reply via email to