[webkit-changes] [WebKit/WebKit] ffae77: [JSC] Add lock / unlock mechanism to LRU in new wa...

Yusuke Suzuki noreply at github.com
Thu Feb 23 17:41:00 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ffae772a848e40be9839efbf81742919df8d84f5
      https://github.com/WebKit/WebKit/commit/ffae772a848e40be9839efbf81742919df8d84f5
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-02-23 (Thu, 23 Feb 2023)

  Changed paths:
    M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp

  Log Message:
  -----------
  [JSC] Add lock / unlock mechanism to LRU in new wasm BBQ for scratch
https://bugs.webkit.org/show_bug.cgi?id=252869
rdar://105856151

Reviewed by Justin Michaud.

When a register is used for scratch, then we must not evict it while it is used
since (1) we would like to have a register, and (2) there is no way to save and restore scratches.
However we have no mechanism to prevent it, and we crash when running tfjs-wasm in JetStream3.

This patch integrates lock and unlock mechanism for registers allocated for scratches.
This lock / unlock names are derived from DFG's reigster allocator & Baseline JIT's IC register allocators.
We mark scratches as locked, and they are not used for register allocation targets.

We would like to expand this mechanism for the non scratch registers when it is currently used and we would like
to lock it down right now. But in this patch, let's first do it for scratches.

* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::LRU::findMin):
(JSC::Wasm::BBQJIT::LRU::lock):
(JSC::Wasm::BBQJIT::LRU::unlock):
(JSC::Wasm::BBQJIT::ScratchScope::gpr const):
(JSC::Wasm::BBQJIT::ScratchScope::fpr const):
(JSC::Wasm::BBQJIT::ScratchScope::bindGPRToScratch):
(JSC::Wasm::BBQJIT::ScratchScope::bindFPRToScratch):
(JSC::Wasm::BBQJIT::ScratchScope::unbindGPRFromScratch):
(JSC::Wasm::BBQJIT::ScratchScope::unbindFPRFromScratch):

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




More information about the webkit-changes mailing list