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

Issue 2471883003: [wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. (Closed)

Created:
4 years, 1 month ago by gdeepti
Modified:
4 years ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] WebAssembly.Memory object can be referenced by multiple Instance objects. Add support for WebAssembly.Memory objects to be simultaneously referenced by multiple Instance objects. GrowingMemory should maintain a consistent view of memory across instances. - Store a link to instances that share WebAssembly.Memory in the WasmMemoryObject, updated on instantiate. - Implement WasmInstanceWrapper as a wrapper around the instance object to keep track of previous/next instances, instance object is stored as a WeakCell that can be garbage collected. - MemoryInstanceFinalizer maintains a valid list of instances when an instance is garbage collected. - Refactor GrowInstanceMemory to GrowMemoryBuffer that allocates a new buffer, and UncheckedUpdateInstanceMemory that updates memory references for an instance. R=titzer@chromium.org, mtrofin@chromium.org, bradnelson@chromium.org Committed: https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6 Committed: https://crrev.com/3c98e339599b068f1ed630afb7601ff942424d31 Committed: https://crrev.com/e108f90d5c17588910f1f91c56ceba2580277000 Cr-Original-Original-Commit-Position: refs/heads/master@{#41121} Cr-Original-Commit-Position: refs/heads/master@{#41198} Cr-Commit-Position: refs/heads/master@{#41234}

Patch Set 1 #

Patch Set 2 : Rebase, add Dcheck #

Total comments: 29

Patch Set 3 : rebase #

Patch Set 4 : Rebase, Refactor to use wasm-objects #

Patch Set 5 : Get correct max_size #

Patch Set 6 : Merge Finalizers #

Patch Set 7 : Review changes #

Patch Set 8 : Rebase #

Patch Set 9 : Rebase #

Patch Set 10 : Fix tests #

Patch Set 11 : Fix GC stress test #

Patch Set 12 : Fix bad merge #

Patch Set 13 : Remove unused function definition #

Total comments: 8

Patch Set 14 : Andreas's review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+536 lines, -93 lines) Patch
M src/runtime/runtime-wasm.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/wasm/wasm-js.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +7 lines, -29 lines 0 comments Download
M src/wasm/wasm-module.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -0 lines 0 comments Download
M src/wasm/wasm-module.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +161 lines, -55 lines 0 comments Download
M src/wasm/wasm-objects.h View 1 2 3 4 5 6 7 8 9 10 5 chunks +62 lines, -2 lines 0 comments Download
M src/wasm/wasm-objects.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +57 lines, -5 lines 0 comments Download
M test/mjsunit/wasm/import-memory.js View 1 2 3 2 chunks +138 lines, -1 line 0 comments Download
M test/mjsunit/wasm/instantiate-module-basic.js View 1 chunk +1 line, -0 lines 0 comments Download
A test/mjsunit/wasm/memory-instance-validation.js View 1 2 3 4 5 1 chunk +103 lines, -0 lines 0 comments Download

Messages

Total messages: 88 (64 generated)
gdeepti
4 years, 1 month ago (2016-11-02 21:05:52 UTC) #4
gdeepti
PTAL
4 years, 1 month ago (2016-11-07 17:41:27 UTC) #11
titzer
https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc#newcode37 src/wasm/wasm-js.cc:37: kWasmMemoryInstancesLink, I think this might be a bit simpler ...
4 years, 1 month ago (2016-11-07 19:34:07 UTC) #12
gdeepti
https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc#newcode37 src/wasm/wasm-js.cc:37: kWasmMemoryInstancesLink, On 2016/11/07 19:34:07, titzer wrote: > I think ...
4 years, 1 month ago (2016-11-09 01:26:18 UTC) #13
bradnelson
https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc#newcode37 src/wasm/wasm-js.cc:37: kWasmMemoryInstancesLink, On 2016/11/07 19:34:07, titzer wrote: > I think ...
4 years, 1 month ago (2016-11-09 01:40:11 UTC) #14
Mircea Trofin
https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc#newcode251 src/wasm/wasm-js.cc:251: if (args.Length() > 2 && args[2]->IsObject()) { there's another ...
4 years, 1 month ago (2016-11-09 18:57:10 UTC) #15
gdeepti
Refactored to include recent move to wasm-objects, ptal. https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2471883003/diff/20001/src/wasm/wasm-js.cc#newcode251 src/wasm/wasm-js.cc:251: if ...
4 years, 1 month ago (2016-11-16 05:34:10 UTC) #26
Mircea Trofin
lgtm
4 years, 1 month ago (2016-11-18 06:55:19 UTC) #33
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/2471883003/180001
4 years, 1 month ago (2016-11-19 03:29:17 UTC) #44
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 1 month ago (2016-11-19 03:31:21 UTC) #46
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/30ef8e33f3a199a27ca8512bcee314c9522d03f6 Cr-Commit-Position: refs/heads/master@{#41121}
4 years, 1 month ago (2016-11-19 03:31:43 UTC) #48
Michael Achenbach
A revert of this CL (patchset #10 id:180001) has been created in https://codereview.chromium.org/2512323004/ by machenbach@chromium.org. ...
4 years, 1 month ago (2016-11-19 13:39:01 UTC) #49
gdeepti
Fixed to use a TENURED object for the memory constructor, fixes the failing gc_stress test, ...
4 years, 1 month ago (2016-11-23 03:06:39 UTC) #61
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/2471883003/240001
4 years, 1 month ago (2016-11-23 03:06:56 UTC) #64
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 1 month ago (2016-11-23 03:09:01 UTC) #67
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/3c98e339599b068f1ed630afb7601ff942424d31 Cr-Commit-Position: refs/heads/master@{#41198}
4 years, 1 month ago (2016-11-23 03:09:42 UTC) #69
Michael Hablich
A revert of this CL (patchset #13 id:240001) has been created in https://codereview.chromium.org/2529573002/ by hablich@chromium.org. ...
4 years ago (2016-11-23 09:08:13 UTC) #70
ahaas
https://codereview.chromium.org/2471883003/diff/240001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2471883003/diff/240001/src/wasm/wasm-module.cc#newcode561 src/wasm/wasm-module.cc:561: // If the memory object is destroyed, nothing needs ...
4 years ago (2016-11-23 10:25:55 UTC) #72
gdeepti
https://codereview.chromium.org/2471883003/diff/240001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2471883003/diff/240001/src/wasm/wasm-module.cc#newcode561 src/wasm/wasm-module.cc:561: // If the memory object is destroyed, nothing needs ...
4 years ago (2016-11-23 20:01:20 UTC) #78
gdeepti
Not able to reproduce this failure - - Tested at commit e3f5c515faa7ec90f044a765a5cd6b3e3be0d90d (Last revert before ...
4 years ago (2016-11-23 20:41:29 UTC) #79
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/2471883003/260001
4 years ago (2016-11-23 20:41:59 UTC) #82
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years ago (2016-11-23 20:44:21 UTC) #85
commit-bot: I haz the power
Patchset 14 (id:??) landed as https://crrev.com/e108f90d5c17588910f1f91c56ceba2580277000 Cr-Commit-Position: refs/heads/master@{#41234}
4 years ago (2016-11-23 20:44:40 UTC) #87
petermarshall
4 years ago (2016-12-01 15:21:00 UTC) #88
Message was sent while issue was closed.
A revert of this CL (patchset #14 id:260001) has been created in
https://codereview.chromium.org/2538183003/ by petermarshall@chromium.org.

The reason for reverting is: Probably causes bot failures (see
https://bugs.chromium.org/p/v8/issues/detail?id=5707)..

Powered by Google App Engine
This is Rietveld 408576698