Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Issue 2124743002: [wasm] Copy the signature when compiling an imported function. (Closed)

Created:
4 years, 5 months ago by ahaas
Modified:
4 years, 5 months ago
Reviewers:
titzer, Mircea Trofin
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Copy the signature when compiling an imported function. The signature of an imported function is needed to compile a wrapper in wasm to call the imported function. The signature is stored in a heap object which is created when the wasm module is compiled. With this CL we do not use a pointer to the signature in the heap object but instead copy the signature and then use a pointer to the copy. A pointer into a heap object causes problems when a GC is happening. R=titzer@chromium.org, mtrofin@chromium.org Committed: https://crrev.com/65415ca79584506c6ce2d78139a7dda608f8978e Cr-Commit-Position: refs/heads/master@{#37527}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -9 lines) Patch
M src/wasm/wasm-module.cc View 1 chunk +16 lines, -9 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
ahaas
4 years, 5 months ago (2016-07-05 10:57:04 UTC) #1
titzer
lgtm
4 years, 5 months ago (2016-07-05 12:13:00 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2124743002/1
4 years, 5 months ago (2016-07-05 12:13:34 UTC) #4
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 5 months ago (2016-07-05 12:15:21 UTC) #5
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/65415ca79584506c6ce2d78139a7dda608f8978e Cr-Commit-Position: refs/heads/master@{#37527}
4 years, 5 months ago (2016-07-05 12:17:13 UTC) #7
Mircea Trofin
On 2016/07/05 12:17:13, commit-bot: I haz the power wrote: > Patchset 1 (id:??) landed as ...
4 years, 5 months ago (2016-07-05 15:05:43 UTC) #8
Mircea Trofin
On 2016/07/05 15:05:43, Mircea Trofin wrote: > On 2016/07/05 12:17:13, commit-bot: I haz the power ...
4 years, 5 months ago (2016-07-05 16:02:03 UTC) #9
ahaas
On 2016/07/05 at 16:02:03, mtrofin wrote: > On 2016/07/05 15:05:43, Mircea Trofin wrote: > > ...
4 years, 5 months ago (2016-07-05 17:06:11 UTC) #10
Mircea Trofin
4 years, 5 months ago (2016-07-06 16:26:24 UTC) #11
Message was sent while issue was closed.
On 2016/07/05 17:06:11, ahaas wrote:
> On 2016/07/05 at 16:02:03, mtrofin wrote:
> > On 2016/07/05 15:05:43, Mircea Trofin wrote:
> > > On 2016/07/05 12:17:13, commit-bot: I haz the power wrote:
> > > > Patchset 1 (id:??) landed as
> > > > https://crrev.com/65415ca79584506c6ce2d78139a7dda608f8978e
> > > > Cr-Commit-Position: refs/heads/master@{#37527}
> > > 
> > > Lgtm
> > 
> > FWIW, I believe the only time we're doing a heap allocation there is when we
> construct the code object, at 
> > which time we don't need the signature object anymore. Have you seen a
failure
> somewhere? Even if not, I 
> > like your CL because it improves robustness.
> > 
> Some tests crashed sometimes on the stress-gc bots because the pointer to the
> signature array was invalid.
> 
> There is some heap allocation happening during the graph construction of the
> WasmToJSWrapper: The wrapper uses the {AllocateHeapNumber} code stub to
prepare
> float parameters for javascript. The code of this code stub is generated when
it
> is used for the first time, which can also be during the graph construction of
> the wrapper. This problem with code stubs is already on my list, because it
> blocks my attempt to extend parallel compilation to most parts of code
> generation.
> 
> > Now, if the above is correct and we only allocate on the JS heap as
described,
> we could factor
> > CompileWasmToJSWrapper into the part that builds up the graph (and needs the
> signature) and the part that
> > codegens (and allocates on the JS heap), and we could then avoid allocating
> and copying yet again.
> 
Thanks for the details!

> We could even think about adding the wasm-to-js wrappers to parallel
compilation
> if we manage to avoid all heap allocation.
Nice - we'd still need to defer that to instantiation time, though. 

BTW, do we have an idea how much compiling imports, and, separately, exports
costs,
vs the total compile time?

Powered by Google App Engine
This is Rietveld 408576698