• Paolo Severini's avatar
    Faster JS-to-Wasm calls · 860fcb1b
    Paolo Severini authored
    This replaces https://chromium-review.googlesource.com/c/v8/v8/+/2376165/.
    
    Currently JS-to-Wasm calls go through a wrapper/trampoline, built on
    the basis of the signature of a Wasm function to call, and whose task
    is to:
    - set "thread_in_wasm_flag" to true
    - convert the arguments from tagged types into Wasm native types
    - calculate the address of the Wasm function to call and call it
    - convert back the result from Wasm native types into tagged types
    - reset "thread_in_wasm_flag" to false.
    
    This CL tries to improve the performance of JS-to-Wasm calls by
    inlining the code of the JS-to-Wasm wrappers in the call site.
    
    It introduces a new IR operand, JSWasmCall, which replaces JSCall for
    this kind of calls. A 'JSWasmCall' node is associated to
    WasmCallParameters, which contain information about the signature of
    the Wasm function to call.
    
    WasmWrapperGraphBuilder::BuildJSToWasmWrapper is modified to avoid generating code to convert the types for the arguments
    of the Wasm function, when the conversion is not necessary.
    The actual inlining of the graph generated for this wrapper happens in
    the simplified-lowering phase.
    
    A new builtin, JSToWasmLazyDeoptContinuation, is introduced to manage
    lazy deoptimizations that can happen if the Wasm function callee calls
    back some JS code that invalidates the compiled JS caller function.
    
    Bug: v8:11092
    Change-Id: I3174c1c1f59b39107b333d1929ecc0584486b8ad
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2557538Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
    Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
    Reviewed-by: 's avatarGeorg Neis (ooo until January 5) <neis@chromium.org>
    Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
    Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
    Commit-Queue: Paolo Severini <paolosev@microsoft.com>
    Cr-Commit-Position: refs/heads/master@{#71824}
    860fcb1b
Name
Last commit
Last update
..
benchmarks Loading commit data...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
debugging Loading commit data...
fuzzer Loading commit data...
fuzzilli Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mkgrokdump Loading commit data...
mozilla Loading commit data...
test262 Loading commit data...
torque Loading commit data...
unittests Loading commit data...
wasm-api-tests Loading commit data...
wasm-js Loading commit data...
wasm-spec-tests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...
OWNERS Loading commit data...