[webkit-changes] [WebKit/WebKit] 8d3fb3: [JSC] Optimize wasm CallIndirect more

Yusuke Suzuki noreply at github.com
Wed Jan 25 21:17:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8d3fb3092671faf576e584d7a58b0b428f0623be
      https://github.com/WebKit/WebKit/commit/8d3fb3092671faf576e584d7a58b0b428f0623be
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-01-25 (Wed, 25 Jan 2023)

  Changed paths:
    M Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h
    M Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp

  Log Message:
  -----------
  [JSC] Optimize wasm CallIndirect more
https://bugs.webkit.org/show_bug.cgi?id=251177
rdar://104669231

Reviewed by Justin Michaud.

This patch further optimizes CallIndirect in OMG tier.

1. We should just get jsCallee and anchoring it in the stack instead of loading JSWebAssemblyInstance from Wasm::Instance.
   Callee can keep instance too (via GC), and we can avoid loading a value from a bit different memory location.
2. Combine signature check into one branch in the major path.

* Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h:
(JSC::Wasm::ExpressionType>::addCallIndirect):
(JSC::Wasm::ExpressionType>::emitIndirectCall):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::emitIndirectCall):
(JSC::Wasm::B3IRGenerator::createCallPatchpoint):
(JSC::Wasm::B3IRGenerator::addCallIndirect):

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




More information about the webkit-changes mailing list