[webkit-changes] [WebKit/WebKit] 061181: [JSC] Simplify Wasm Call IC generated code

Yusuke Suzuki noreply at github.com
Sat Dec 31 23:00:32 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 061181925960bee67c6f9a8ff3f3391b6bfd1ccf
      https://github.com/WebKit/WebKit/commit/061181925960bee67c6f9a8ff3f3391b6bfd1ccf
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2022-12-31 (Sat, 31 Dec 2022)

  Changed paths:
    M Source/JavaScriptCore/wasm/js/JSToWasm.cpp
    M Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp

  Log Message:
  -----------
  [JSC] Simplify Wasm Call IC generated code
https://bugs.webkit.org/show_bug.cgi?id=249906
rdar://103726311

Reviewed by Mark Lam.

This patch simplifies Wasm Call IC generated code.

1. Use emitSave / emitRestore to emit paired load / store.
2. Omit stack-overflow check for Wasm Call IC in most of cases. Because this IC is guaranteed that we will
   call wasm function, we can omit stack-overflow check if the stack frame size is smaller than the threshold.
3. When memory is signaling / shared, we embed memory base pointer and bound checking size directly since
   both values will not be changed for this type.
4. Omit argument count check for zero-argument case.

These optimization affects on generated code. And we observed 15% faster Runtime for JetStream2/richards-wasm.

* Source/JavaScriptCore/wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:
(JSC::trampolineReservedStackSize):
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

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




More information about the webkit-changes mailing list