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

Issue 2676513008: [wasm] Managed<T> ensures T's lifetime does not leak past Isolate's (Closed)

Created:
3 years, 10 months ago by Mircea Trofin
Modified:
3 years, 10 months ago
CC:
v8-reviews_googlegroups.com, Eric Holk
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Managed<T> ensures T's lifetime does not leak past Isolate's Native resources allocated by v8, as internal implementation detail, and held by a Foreign object, must be released when the Isolate is torn down. Example: wasm::WasmModule allocated by wasm compile, and held throughout the lifetime of the WebAssembly.Module object. This change: - Extends Managed<CppType> with a mechanism for doing just that - Separates the role of Managed<CppType> to be strictly an owner of the lifetime of the native resource. For cases where that's not desirable, we can polymorphically use Foregin. - moves managed.h out of wasm, since it's not wasm-specific. BUG=680065 Review-Url: https://codereview.chromium.org/2676513008 Cr-Commit-Position: refs/heads/master@{#43350} Committed: https://chromium.googlesource.com/v8/v8/+/caa1d4b262d2e97ce3b9f4163de46f230a8a9929

Patch Set 1 #

Patch Set 2 : [wasm] cleanup wasm wrappers at Dispose time. #

Patch Set 3 : fixes #

Patch Set 4 : better api fixes #

Patch Set 5 : better api fixes #

Patch Set 6 : better api fixes #

Total comments: 11

Patch Set 7 : Role separation Foregin / Managed #

Patch Set 8 : rebase #

Patch Set 9 : Comments #

Total comments: 4

Patch Set 10 : moved test-managed under unittests, renamed #

Patch Set 11 : [rebase] #

Patch Set 12 : win link error #

Patch Set 13 : link #

Total comments: 2

Patch Set 14 : moved cctest #

Patch Set 15 : moved cctest #

Patch Set 16 : moved cctest #

Total comments: 2

Patch Set 17 : feedback. also a rebase #

Total comments: 2

Patch Set 18 : REBASE #

Patch Set 19 : renamed to ManagedObjectFinalizer, and using "finalizer"` #

Unified diffs Side-by-side diffs Delta from patch set Stats (+254 lines, -127 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +1 line, -1 line 0 comments Download
M src/isolate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +37 lines, -0 lines 0 comments Download
M src/isolate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +42 lines, -0 lines 0 comments Download
A src/managed.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +81 lines, -0 lines 0 comments Download
M src/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +1 line, -1 line 0 comments Download
D src/wasm/managed.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -58 lines 0 comments Download
M src/wasm/wasm-module.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M src/wasm/wasm-objects.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -1 line 0 comments Download
M src/wasm/wasm-objects.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +7 lines, -1 line 0 comments Download
M test/cctest/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +1 line, -1 line 0 comments Download
M test/cctest/cctest.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +1 line, -1 line 0 comments Download
A test/cctest/test-managed.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +78 lines, -0 lines 0 comments Download
D test/cctest/wasm/test-managed.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -60 lines 0 comments Download
M test/cctest/wasm/wasm-run-utils.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 106 (77 generated)
titzer
https://codereview.chromium.org/2676513008/diff/100001/src/isolate.cc File src/isolate.cc (right): https://codereview.chromium.org/2676513008/diff/100001/src/isolate.cc#newcode2045 src/isolate.cc:2045: void Isolate::ManagedLifeline::Clear() { Something seems weird with this. Why ...
3 years, 10 months ago (2017-02-08 23:32:48 UTC) #24
Mircea Trofin
https://codereview.chromium.org/2676513008/diff/100001/src/isolate.cc File src/isolate.cc (right): https://codereview.chromium.org/2676513008/diff/100001/src/isolate.cc#newcode2045 src/isolate.cc:2045: void Isolate::ManagedLifeline::Clear() { On 2017/02/08 23:32:47, titzer wrote: > ...
3 years, 10 months ago (2017-02-08 23:52:36 UTC) #25
titzer
https://codereview.chromium.org/2676513008/diff/100001/src/isolate.cc File src/isolate.cc (right): https://codereview.chromium.org/2676513008/diff/100001/src/isolate.cc#newcode2045 src/isolate.cc:2045: void Isolate::ManagedLifeline::Clear() { On 2017/02/08 23:52:35, Mircea Trofin wrote: ...
3 years, 10 months ago (2017-02-09 04:25:18 UTC) #26
Mircea Trofin
On 2017/02/09 04:25:18, titzer wrote: > https://codereview.chromium.org/2676513008/diff/100001/src/isolate.cc > File src/isolate.cc (right): > > https://codereview.chromium.org/2676513008/diff/100001/src/isolate.cc#newcode2045 > ...
3 years, 10 months ago (2017-02-09 04:28:00 UTC) #27
titzer
On 2017/02/09 04:28:00, Mircea Trofin wrote: > On 2017/02/09 04:25:18, titzer wrote: > > https://codereview.chromium.org/2676513008/diff/100001/src/isolate.cc ...
3 years, 10 months ago (2017-02-09 17:39:21 UTC) #28
Mircea Trofin
On 2017/02/09 17:39:21, titzer wrote: > On 2017/02/09 04:28:00, Mircea Trofin wrote: > > On ...
3 years, 10 months ago (2017-02-09 17:43:25 UTC) #29
Mircea Trofin
3 years, 10 months ago (2017-02-11 00:12:42 UTC) #40
Eric Holk
https://codereview.chromium.org/2676513008/diff/160001/src/isolate.cc File src/isolate.cc (right): https://codereview.chromium.org/2676513008/diff/160001/src/isolate.cc#newcode2033 src/isolate.cc:2033: delete current; Out of curiosity, would it make sense ...
3 years, 10 months ago (2017-02-11 02:19:30 UTC) #45
Mircea Trofin
https://codereview.chromium.org/2676513008/diff/160001/src/isolate.cc File src/isolate.cc (right): https://codereview.chromium.org/2676513008/diff/160001/src/isolate.cc#newcode2033 src/isolate.cc:2033: delete current; On 2017/02/11 02:19:29, Eric Holk wrote: > ...
3 years, 10 months ago (2017-02-11 02:29:32 UTC) #46
Michael Lippautz
dbc: long shot, but could we create a unit test for this one? If not, ...
3 years, 10 months ago (2017-02-11 12:49:18 UTC) #48
Mircea Trofin
On 2017/02/11 12:49:18, Michael Lippautz wrote: > dbc: long shot, but could we create a ...
3 years, 10 months ago (2017-02-13 17:04:51 UTC) #51
Mircea Trofin
3 years, 10 months ago (2017-02-13 17:05:03 UTC) #52
Eric Holk
https://codereview.chromium.org/2676513008/diff/160001/src/isolate.cc File src/isolate.cc (right): https://codereview.chromium.org/2676513008/diff/160001/src/isolate.cc#newcode2033 src/isolate.cc:2033: delete current; On 2017/02/11 02:29:32, Mircea Trofin wrote: > ...
3 years, 10 months ago (2017-02-13 21:55:35 UTC) #65
titzer
https://codereview.chromium.org/2676513008/diff/240001/src/isolate.h File src/isolate.h (right): https://codereview.chromium.org/2676513008/diff/240001/src/isolate.h#newcode1214 src/isolate.h:1214: class ManagedLifeline final { Can we just make this ...
3 years, 10 months ago (2017-02-13 21:58:25 UTC) #66
Mircea Trofin
On 2017/02/13 17:04:51, Mircea Trofin wrote: > On 2017/02/11 12:49:18, Michael Lippautz wrote: > > ...
3 years, 10 months ago (2017-02-14 02:59:22 UTC) #69
Mircea Trofin
https://codereview.chromium.org/2676513008/diff/240001/src/isolate.h File src/isolate.h (right): https://codereview.chromium.org/2676513008/diff/240001/src/isolate.h#newcode1214 src/isolate.h:1214: class ManagedLifeline final { On 2017/02/13 21:58:25, titzer wrote: ...
3 years, 10 months ago (2017-02-14 04:50:55 UTC) #78
Michael Lippautz
On 2017/02/14 02:59:22, Mircea Trofin wrote: > On 2017/02/13 17:04:51, Mircea Trofin wrote: > > ...
3 years, 10 months ago (2017-02-15 17:30:54 UTC) #83
Mircea Trofin
On 2017/02/15 17:30:54, Michael Lippautz wrote: > On 2017/02/14 02:59:22, Mircea Trofin wrote: > > ...
3 years, 10 months ago (2017-02-15 17:35:32 UTC) #84
bradnelson
lgtm +mvstanton as we're adding something on the isolate, can you take a look? Thanks ...
3 years, 10 months ago (2017-02-16 23:59:20 UTC) #86
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/2676513008/300001
3 years, 10 months ago (2017-02-21 03:39:57 UTC) #88
commit-bot: I haz the power
Failed to apply patch for BUILD.gn: While running git apply --index -p1; error: patch failed: ...
3 years, 10 months ago (2017-02-21 04:07:28 UTC) #90
Mircea Trofin
Incorporated bradnelson's feedback. Also, gentle nudge to mvstanton. Thanks!
3 years, 10 months ago (2017-02-21 04:38:54 UTC) #93
mvstanton
LGTM, thanks!
3 years, 10 months ago (2017-02-21 09:21:50 UTC) #96
titzer
https://codereview.chromium.org/2676513008/diff/320001/src/isolate.h File src/isolate.h (right): https://codereview.chromium.org/2676513008/diff/320001/src/isolate.h#newcode1215 src/isolate.h:1215: class ManagedLifeline final { Maybe a better name here? ...
3 years, 10 months ago (2017-02-21 09:30:08 UTC) #97
Mircea Trofin
https://codereview.chromium.org/2676513008/diff/320001/src/isolate.h File src/isolate.h (right): https://codereview.chromium.org/2676513008/diff/320001/src/isolate.h#newcode1215 src/isolate.h:1215: class ManagedLifeline final { On 2017/02/21 09:30:08, titzer wrote: ...
3 years, 10 months ago (2017-02-21 15:52:28 UTC) #98
titzer
On 2017/02/21 15:52:28, Mircea Trofin wrote: > https://codereview.chromium.org/2676513008/diff/320001/src/isolate.h > File src/isolate.h (right): > > https://codereview.chromium.org/2676513008/diff/320001/src/isolate.h#newcode1215 ...
3 years, 10 months ago (2017-02-21 16:33:10 UTC) #99
Mircea Trofin
On 2017/02/21 16:33:10, titzer wrote: > On 2017/02/21 15:52:28, Mircea Trofin wrote: > > https://codereview.chromium.org/2676513008/diff/320001/src/isolate.h ...
3 years, 10 months ago (2017-02-21 16:41:04 UTC) #100
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/2676513008/360001
3 years, 10 months ago (2017-02-21 16:56:06 UTC) #103
commit-bot: I haz the power
3 years, 10 months ago (2017-02-21 17:23:48 UTC) #106
Message was sent while issue was closed.
Committed patchset #19 (id:360001) as
https://chromium.googlesource.com/v8/v8/+/caa1d4b262d2e97ce3b9f4163de46f230a8...

Powered by Google App Engine
This is Rietveld 408576698