Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d43cce578d4e40f262980bfbbcab0895f63f7211
      
https://github.com/WebKit/WebKit/commit/d43cce578d4e40f262980bfbbcab0895f63f7211
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-01-10 (Sat, 10 Jan 2026)

  Changed paths:
    M Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
    M Source/JavaScriptCore/interpreter/CachedCall.cpp
    M Source/JavaScriptCore/interpreter/CachedCallInlines.h
    M Source/JavaScriptCore/interpreter/Interpreter.cpp
    M Source/JavaScriptCore/interpreter/Interpreter.h
    M Source/JavaScriptCore/interpreter/InterpreterInlines.h
    M Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
    M Source/JavaScriptCore/llint/LLIntThunks.cpp
    M Source/JavaScriptCore/llint/LLIntThunks.h
    M Source/JavaScriptCore/llint/LowLevelInterpreter.asm
    M Source/JavaScriptCore/offlineasm/arm64.rb
    M Source/JavaScriptCore/offlineasm/registers.rb
    M Source/JavaScriptCore/runtime/CallData.cpp
    M Source/JavaScriptCore/runtime/CallData.h
    M Source/JavaScriptCore/runtime/JSMicrotask.cpp
    M Source/JavaScriptCore/runtime/MicrotaskQueueInlines.h
    M Source/JavaScriptCore/runtime/VM.cpp
    M Source/JavaScriptCore/runtime/VM.h

  Log Message:
  -----------
  [JSC] Optimize callMicrotask
https://bugs.webkit.org/show_bug.cgi?id=305084
rdar://167728315

Reviewed by Keith Miller.

This patch simplifies callMicrotask significantly to make it fast.
This is a function which is used for each microtask's JS function
invocation, thus this function is extremely hot. In this patch,

1. We introduce vmEntryToJavaScriptWith4Arguments up to 7. And
   vmEntryToJavaScriptMicrotaskWith0Arguments up to 6. This simplifies
   handling of arguments, avoding ProtoCallFrame and makes set up
   significantly efficient.
2. Some checks are hoisted from callMicrotask to MicrotaskQueue as it is
   repeatedly invoked while the condition should not change.
3. VMEntryScope is not necessary since MicrotaskQueue's already setting
   up.
4. vm.didEnterVM is set after MicrotaskQueue finishes.

* Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):
* Source/JavaScriptCore/interpreter/CachedCall.cpp:
(JSC::CachedCall::CachedCall):
* Source/JavaScriptCore/interpreter/CachedCallInlines.h:
(JSC::CachedCall::callWithArguments):
* Source/JavaScriptCore/interpreter/Interpreter.cpp:
(JSC::Interpreter::executeProgram):
(JSC::Interpreter::executeCallImpl):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::executeEval):
(JSC::Interpreter::executeModuleProgram):
(JSC::Interpreter::checkVMEntryPermission): Deleted.
* Source/JavaScriptCore/interpreter/Interpreter.h:
* Source/JavaScriptCore/interpreter/InterpreterInlines.h:
(JSC::Interpreter::tryCallWithArguments):
* Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:
(JSC::LLInt::llint_check_vm_entry_permission):
* Source/JavaScriptCore/llint/LLIntThunks.cpp:
* Source/JavaScriptCore/llint/LLIntThunks.h:
* Source/JavaScriptCore/llint/LowLevelInterpreter.asm:
* Source/JavaScriptCore/offlineasm/arm64.rb:
* Source/JavaScriptCore/offlineasm/registers.rb:
* Source/JavaScriptCore/runtime/CallData.cpp:
(JSC::callMicrotask): Deleted.
* Source/JavaScriptCore/runtime/CallData.h:
* Source/JavaScriptCore/runtime/JSMicrotask.cpp:
(JSC::callMicrotask):
(JSC::promiseResolveThenableJob):
(JSC::asyncFromSyncIteratorContinueOrDone):
(JSC::asyncGeneratorBodyCall):
(JSC::promiseFinallyReactionJob):
(JSC::runInternalMicrotask):
* Source/JavaScriptCore/runtime/MicrotaskQueueInlines.h:
(JSC::MicrotaskQueue::performMicrotaskCheckpoint):
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::checkVMEntryPermission):
* Source/JavaScriptCore/runtime/VM.h:

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



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

Reply via email to