[webkit-changes] [WebKit/WebKit] 43198e: [JSC] Wasm Callee should be directly embedded

Yusuke Suzuki noreply at github.com
Wed Jan 4 22:56:29 PST 2023


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

  Changed paths:
    M Source/JavaScriptCore/interpreter/CalleeBits.h
    M Source/JavaScriptCore/llint/LowLevelInterpreter.asm
    M Source/JavaScriptCore/llint/WebAssembly.asm
    M Source/JavaScriptCore/wasm/WasmAirIRGenerator.h
    M Source/JavaScriptCore/wasm/WasmAirIRGenerator32_64.cpp
    M Source/JavaScriptCore/wasm/WasmAirIRGenerator64.cpp
    M Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h
    M Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmB3IRGenerator.h
    M Source/JavaScriptCore/wasm/WasmBBQPlan.cpp
    M Source/JavaScriptCore/wasm/WasmBBQPlan.h
    M Source/JavaScriptCore/wasm/WasmCallee.cpp
    M Source/JavaScriptCore/wasm/WasmCallee.h
    M Source/JavaScriptCore/wasm/WasmFormat.h
    M Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp
    M Source/JavaScriptCore/wasm/WasmOMGPlan.cpp
    M Source/JavaScriptCore/wasm/WasmOSREntryPlan.cpp
    M Source/JavaScriptCore/wasm/js/JSToWasm.cpp
    M Source/JavaScriptCore/wasm/js/JSToWasm.h
    M Source/WTF/wtf/WTFConfig.cpp
    M Source/WTF/wtf/WTFConfig.h

  Log Message:
  -----------
  [JSC] Wasm Callee should be directly embedded
https://bugs.webkit.org/show_bug.cgi?id=250015
rdar://103821380

Reviewed by Saam Barati.

This patch changes Wasm compilers to embed Wasm::Callee bits directly.
Since callee can be created while compiling (since this is not a cell),
we can just create it and directly embed it during compilation instead of
repatching later. This makes compiler simpler and allows compilers to embed
pointer with fewer instructions based on its value.

Also, this patch changes the CalleeBits::boxWasm encoding a bit: which
now decreases lowestAccessibleAddress from the given pointer. This is OK
since this is just a C++ pointer (so conservative GC is not affected with this change).
By doing this, we can make Wasm::Callee within 32bit in most cases. This allows
callee direct embedding to use fewer instructions to embed this in the code.

* Source/JavaScriptCore/interpreter/CalleeBits.h:
(JSC::CalleeBits::boxWasm):
(JSC::CalleeBits::asWasmCallee const):
* Source/JavaScriptCore/llint/LowLevelInterpreter.asm:
* Source/JavaScriptCore/llint/WebAssembly.asm:
* Source/JavaScriptCore/wasm/WasmAirIRGenerator.h:
* Source/JavaScriptCore/wasm/WasmAirIRGenerator32_64.cpp:
(JSC::Wasm::AirIRGenerator32::AirIRGenerator32):
(JSC::Wasm::parseAndCompileAir):
* Source/JavaScriptCore/wasm/WasmAirIRGenerator64.cpp:
(JSC::Wasm::AirIRGenerator64::AirIRGenerator64):
(JSC::Wasm::parseAndCompileAir):
* Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h:
(JSC::Wasm::ExpressionType>::AirIRGeneratorBase):
(JSC::Wasm::parseAndCompileAirImpl):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::origin):
(JSC::Wasm::parseAndCompileB3):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.h:
* Source/JavaScriptCore/wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::prepareImpl):
(JSC::Wasm::BBQPlan::work):
(JSC::Wasm::BBQPlan::compileFunction):
(JSC::Wasm::BBQPlan::didCompleteCompilation):
(JSC::Wasm::BBQPlan::initializeCallees):
* Source/JavaScriptCore/wasm/WasmBBQPlan.h:
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::Callee::Callee):
(JSC::Wasm::JITCallee::JITCallee):
* Source/JavaScriptCore/wasm/WasmCallee.h:
(JSC::Wasm::JITCallee::setEntrypoint):
(JSC::Wasm::OptimizingJITCallee::OptimizingJITCallee):
(JSC::Wasm::OptimizingJITCallee::setEntrypoint):
* Source/JavaScriptCore/wasm/WasmFormat.h:
* Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp:
(JSC::Wasm::LLIntPlan::didCompleteCompilation):
* Source/JavaScriptCore/wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* Source/JavaScriptCore/wasm/WasmOSREntryPlan.cpp:
(JSC::Wasm::OSREntryPlan::work):
* Source/JavaScriptCore/wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* Source/JavaScriptCore/wasm/js/JSToWasm.h:

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




More information about the webkit-changes mailing list