[webkit-changes] [WebKit/WebKit] da3929: [JSC] Add I64 support for Wasm IC and FTL Wasm fas...

Yusuke Suzuki noreply at github.com
Mon Jan 30 13:03:10 PST 2023


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

  Changed paths:
    A JSTests/wasm/stress/js-to-wasm-i64-register.js
    A JSTests/wasm/stress/js-to-wasm-i64-stack.js
    A JSTests/wasm/stress/js-to-wasm-many-double-from-js.js
    A JSTests/wasm/stress/js-to-wasm-many-i64.js
    M Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
    M Source/JavaScriptCore/dfg/DFGOperations.cpp
    M Source/JavaScriptCore/dfg/DFGOperations.h
    M Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp
    M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
    M Source/JavaScriptCore/jit/AssemblyHelpers.h
    M Source/JavaScriptCore/runtime/JSBigInt.h
    M Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp

  Log Message:
  -----------
  [JSC] Add I64 support for Wasm IC and FTL Wasm fast call
https://bugs.webkit.org/show_bug.cgi?id=251332
rdar://104794806

Reviewed by Tadeu Zagallo.

This patch adds I64 support for Wasm IC and FTL Wasm fast call. This makes it possible to accept all major wasm types in IC and Wasm fast calls,
so we can reasonably assume that we will always go to this IC or fast call when the callsite is performance enough.

What we need is extracting I64 from HeapBigInt. This patch adds AssemblyHelpers::toBigInt64, which takes JSBigInt and extract I64 for wasm.

Microbenchmark showed 10x improvement (following script's iteration count is modified to make the core part running longer for measurement).

    DYLD_FRAMEWORK_PATH=$VM $VM/jsc -m js-to-wasm-many-i64.js  0.62s user 0.05s system 102% cpu 0.653 total
    DYLD_FRAMEWORK_PATH=$VM $VM/jsc -m js-to-wasm-many-i64.js  5.11s user 0.09s system 83% cpu 6.184 total

* JSTests/wasm/stress/js-to-wasm-many-double-from-js.js: Added.
(async test):
* JSTests/wasm/stress/js-to-wasm-many-i64.js: Added.
(async test):
* Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* Source/JavaScriptCore/dfg/DFGOperations.cpp:
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/dfg/DFGOperations.h:
* Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
* Source/JavaScriptCore/jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::toBigInt64):
* Source/JavaScriptCore/runtime/JSBigInt.h:
* Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

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




More information about the webkit-changes mailing list