[webkit-changes] [WebKit/WebKit] 5be4a1: [JSC] Cache softStackLimit in Wasm::Instance

Yusuke Suzuki noreply at github.com
Thu May 25 12:02:22 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5be4a1faae21540b04ba622fbc0f482100903f77
      https://github.com/WebKit/WebKit/commit/5be4a1faae21540b04ba622fbc0f482100903f77
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M Source/JavaScriptCore/jit/AssemblyHelpers.cpp
    M Source/JavaScriptCore/llint/WebAssembly.asm
    M Source/JavaScriptCore/runtime/VM.cpp
    M Source/JavaScriptCore/runtime/VM.h
    M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
    M Source/JavaScriptCore/wasm/WasmInstance.cpp
    M Source/JavaScriptCore/wasm/WasmInstance.h

  Log Message:
  -----------
  [JSC] Cache softStackLimit in Wasm::Instance
https://bugs.webkit.org/show_bug.cgi?id=257230
rdar://109740794

Reviewed by Justin Michaud.

Let's store m_softStackLimit in Wasm::Instance directly. Wasm::Instance is strictly tied to one VM.
This patch associates Wasm::Instance to VM, and we update this field of Instance when VM's m_softStackLimit
changes (this is very rare). So we do not need to do double-load to stack overflow check in each prologue
of wasm functions.

* Source/JavaScriptCore/jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::checkWasmStackOverflow):
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/runtime/VM.cpp:
(JSC::VM::updateStackLimits):
(JSC::VM::registerWasmInstance):
* Source/JavaScriptCore/runtime/VM.h:
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::addTopLevel):
(JSC::Wasm::BBQJIT::addLoopOSREntrypoint):
* Source/JavaScriptCore/wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::Instance):
* Source/JavaScriptCore/wasm/WasmInstance.h:
(JSC::Wasm::Instance::offsetOfSoftStackLimit):
(JSC::Wasm::Instance::updateSoftStackLimit):

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




More information about the webkit-changes mailing list