[webkit-changes] [WebKit/WebKit] 7c8243: Add WASM tail calls support to single-pass BBQ JIT

Keith Miller noreply at github.com
Wed Jul 31 09:46:53 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7c8243bd28578162b7de09d3e7896547bb28a2e1
      https://github.com/WebKit/WebKit/commit/7c8243bd28578162b7de09d3e7896547bb28a2e1
  Author: Keith Miller <keith_miller at apple.com>
  Date:   2024-07-31 (Wed, 31 Jul 2024)

  Changed paths:
    M JSTests/wasm/stress/cc-int-to-int-memory.js
    M JSTests/wasm/stress/cc-int-to-int-tail-call.js
    M JSTests/wasm/stress/simd-tail-call-simple.js
    M JSTests/wasm/stress/simd-tail-calls-throw.js
    M JSTests/wasm/stress/tail-call-double.js
    M JSTests/wasm/stress/tail-call-js-inline.js
    M JSTests/wasm/stress/tail-call-js.js
    M JSTests/wasm/stress/tail-call-should-not-clobber-caller-origin.js
    M JSTests/wasm/stress/tail-call-simple.js
    M Source/JavaScriptCore/assembler/MacroAssembler.h
    M Source/JavaScriptCore/assembler/MacroAssemblerPrinter.h
    M Source/JavaScriptCore/runtime/Options.cpp
    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/WasmCallingConvention.h
    M Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp
    M Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp

  Log Message:
  -----------
  Add WASM tail calls support to single-pass BBQ JIT
https://bugs.webkit.org/show_bug.cgi?id=253192
rdar://106448393

Reviewed by Justin Michaud and Yusuke Suzuki.

This is an old patch that I've had sitting around for a while but never got around to
uploading. I put the tail call emit functions in their own function since they
are subtly different enough from the non-tail call versions it seemed more complicated
to combine them. The main other interesting detail is that on x86_64 we don't have enough
non-argument caller-save registers to hold the save FP/return PC. This means they
get shuffled with the other parameters and then get popped later once the shuffle is done.

* JSTests/wasm/stress/cc-int-to-int-memory.js:
* JSTests/wasm/stress/cc-int-to-int-tail-call.js:
* JSTests/wasm/stress/simd-tail-call-simple.js:
* JSTests/wasm/stress/simd-tail-calls-throw.js:
* JSTests/wasm/stress/tail-call-double.js:
* JSTests/wasm/stress/tail-call-js-inline.js:
* JSTests/wasm/stress/tail-call-js.js:
* JSTests/wasm/stress/tail-call-should-not-clobber-caller-origin.js:
* JSTests/wasm/stress/tail-call-simple.js:
* JSTests/wasm/tail-call-spec-tests/tail_call_indirect.wast.js:
* Source/JavaScriptCore/assembler/MacroAssembler.h:
* Source/JavaScriptCore/assembler/MacroAssemblerPrinter.h:
(JSC::MacroAssembler::println):
(JSC::AllRegisters::AllRegisters): Deleted.
(JSC::Memory::Memory): Deleted.
(JSC::MemWord::MemWord): Deleted.
* Source/JavaScriptCore/runtime/Options.cpp:
(JSC::Options::notifyOptionsChanged):
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addTopLevel):
(JSC::Wasm::BBQJITImpl::BBQJIT::emitTailCall):
(JSC::Wasm::BBQJITImpl::BBQJIT::addCall):
(JSC::Wasm::BBQJITImpl::BBQJIT::emitIndirectCall):
(JSC::Wasm::BBQJITImpl::BBQJIT::emitIndirectTailCall):
(JSC::Wasm::BBQJITImpl::BBQJIT::addCallIndirect):
* Source/JavaScriptCore/wasm/WasmBBQJIT.h:
(JSC::Wasm::BBQJITImpl::BBQJIT::ScratchScope::initializedPreservedSet):
* Source/JavaScriptCore/wasm/WasmBBQJIT32_64.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addCallRef):
* Source/JavaScriptCore/wasm/WasmBBQJIT64.cpp:
(JSC::Wasm::BBQJITImpl::BBQJIT::addCallRef):
* Source/JavaScriptCore/wasm/WasmCallingConvention.h:
(JSC::Wasm::WasmCallingConvention::argumentGPRS const):
* Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp:
(JSC::Wasm::OMGIRGenerator::createTailCallPatchpoint):
* Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

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



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


More information about the webkit-changes mailing list