Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 821c07448c2f82f0fd166d1090b6f01d8a9acd08
      
https://github.com/WebKit/WebKit/commit/821c07448c2f82f0fd166d1090b6f01d8a9acd08
  Author: Yusuke Suzuki <[email protected]>
  Date:   2025-10-20 (Mon, 20 Oct 2025)

  Changed paths:
    M Source/JavaScriptCore/assembler/MacroAssembler.h
    M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
    M Source/JavaScriptCore/wasm/WasmBBQJIT.h
    M Source/JavaScriptCore/wasm/WasmBBQJIT32_64.cpp
    M Source/JavaScriptCore/wasm/WasmBBQJIT64.cpp
    M Source/JavaScriptCore/wasm/WasmCallProfile.h
    M Source/JavaScriptCore/wasm/js/WebAssemblyFunctionBase.h

  Log Message:
  -----------
  [JSC] Use GPRInfo::nonPreservedNonArgumentGPR1 for BBQJIT boxedCallee GPR
https://bugs.webkit.org/show_bug.cgi?id=300932
rdar://162807925

Reviewed by Yijia Huang.

This patch pins BBQJIT boxedCallee GPR as GPRInfo::nonPreservedNonArgumentGPR1.
To introduce polymorphic call profiling, we will introduce a bit more
complex code to count polymorphic cases. This will require a shared
thunk which sometimes calls C++ function to allocate polymorphic call
profile data structure. Thus we need to ensure that boxedCallee are
always placed in a particular register after we set up all wasm arguments.
This means it needs to be in non-preserved non-argument register. Also
we avoid using GPRInfo::nonPreservedNonArgumentGPR0 since it is already
used for wasmScratchGPR. Thus we pick GPRInfo::nonPreservedNonArgumentGPR1.

With this, we also move the current profiling code from "before setting
up the arguments" to "after setting up the arguments" since this ensures
that we can call a function if we save and restore arguments registers.
This should rarely happen (only when we allocate polymorphic call
profiling data structure allocation), thus it is costly but fine.

* Source/JavaScriptCore/assembler/MacroAssembler.h:
(JSC::MacroAssembler::orPtr):
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::emitIndirectCall):
(JSC::Wasm::BBQJITImpl::BBQJIT::emitIndirectTailCall):
(JSC::Wasm::BBQJITImpl::BBQJIT::addCallIndirect):
* Source/JavaScriptCore/wasm/WasmBBQJIT.h:
* Source/JavaScriptCore/wasm/WasmBBQJIT32_64.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addCallRef):
* Source/JavaScriptCore/wasm/WasmBBQJIT64.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addCallRef):
* Source/JavaScriptCore/wasm/WasmCallProfile.h:
* Source/JavaScriptCore/wasm/js/WebAssemblyFunctionBase.h:
(JSC::WebAssemblyFunctionBase::offsetOfImportableFunction):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to