New issue
Advanced search Search tips

Issue 860491 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature



Sign in to add a comment

Share code for same-signature js-to-wasm wrappers

Project Member Reported by clemensh@chromium.org, Jul 5

Issue description

In the pspdfkit benchmark (https://pspdfkit.com/webassembly-benchmark/), we spend 250ms in instantiation (on the main thread!).
Half of the time is spent in "CloneOrCompileJsToWasmWrapper".
We could avoid closing these wrappers if we load the function index from the WasmExportedFunction and use it to call relative to the jump table start (embedded in the code object).
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 6

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/815485244f78b5f28b4a9615248a5ebe84f40acb

commit 815485244f78b5f28b4a9615248a5ebe84f40acb
Author: Clemens Hammacher <clemensh@chromium.org>
Date: Fri Jul 06 15:09:47 2018

[wasm] Share code of js-to-wasm wrappers

Instead of creating a separate code object per exported function, we
can share the code per signature, and load the function index from the
{WasmExportedFunction} object which is being passed as an argument
anyway.
This greatly reduces instantiation time for modules with a lot of
exports.
As a next step, we could even share the code across instances, or (with
more work) across isolates.

R=mstarzinger@chromium.org

Bug:  chromium:860491 
Change-Id: I6438065b2de0df59dce980fb52408a0f475144b3
Reviewed-on: https://chromium-review.googlesource.com/1127660
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54299}
[modify] https://crrev.com/815485244f78b5f28b4a9615248a5ebe84f40acb/src/compiler/wasm-compiler.cc
[modify] https://crrev.com/815485244f78b5f28b4a9615248a5ebe84f40acb/src/compiler/wasm-compiler.h
[modify] https://crrev.com/815485244f78b5f28b4a9615248a5ebe84f40acb/src/wasm/module-compiler.cc
[modify] https://crrev.com/815485244f78b5f28b4a9615248a5ebe84f40acb/src/wasm/wasm-code-manager.h
[modify] https://crrev.com/815485244f78b5f28b4a9615248a5ebe84f40acb/src/wasm/wasm-objects.h
[modify] https://crrev.com/815485244f78b5f28b4a9615248a5ebe84f40acb/test/cctest/wasm/wasm-run-utils.cc

Status: Fixed (was: Started)

Sign in to add a comment