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

Issue 2393303002: [modules] Store Module metadata in per-Context EmbedderData (Closed)

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

Description

[modules] Store Module metadata in per-Context EmbedderData Unifies the approaches used for storing the specifier -> module mapping and the module -> directory mapping, using std::unordered_maps for both and storing them per-Context. This requires adding a method to the v8::Module API to get a hash code for a Module, but allows slimming down the API in return: gone are SetEmbedderData/GetEmbedderData, along with the fourth argument to ResolveModuleCallback. Besides a simpler API, this allows d8 to get closer to the HTML loader, which requires each Realm to have a persistent module map (though this capability is not yet exercised by any tests). BUG=v8:1569 Committed: https://crrev.com/9cf8fce74cf6e7afd6aea3f3545f6bb61572f277 Cr-Commit-Position: refs/heads/master@{#40133}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Review comments from neis #

Patch Set 3 : Rebased #

Patch Set 4 : Attempt at dispose #

Patch Set 5 : Add a Dispose call for every call to CreateEvaluationContext #

Patch Set 6 : Rebased #

Patch Set 7 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+104 lines, -93 lines) Patch
M include/v8.h View 1 2 3 4 5 6 1 chunk +7 lines, -7 lines 0 comments Download
M src/api.cc View 1 2 3 4 5 6 1 chunk +4 lines, -13 lines 0 comments Download
M src/d8.h View 2 chunks +2 lines, -4 lines 0 comments Download
M src/d8.cc View 1 2 3 4 11 chunks +84 lines, -35 lines 0 comments Download
M src/factory.cc View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M src/objects.h View 1 2 3 4 5 6 2 chunks +1 line, -5 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 3 chunks +3 lines, -4 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M src/objects-printer.cc View 1 chunk +0 lines, -1 line 0 comments Download
M test/cctest/test-modules.cc View 3 chunks +3 lines, -21 lines 0 comments Download

Messages

Total messages: 38 (22 generated)
adamk
neis, please look at everything here. jochen, I want to make sure it's OK to ...
4 years, 2 months ago (2016-10-05 21:46:31 UTC) #2
neis
Looks mostly good, but I'd like to talk offline about an idea I have that ...
4 years, 2 months ago (2016-10-06 09:44:47 UTC) #7
jochen (gone - plz use gerrit)
include/ lgtm
4 years, 2 months ago (2016-10-06 12:21:30 UTC) #8
jochen (gone - plz use gerrit)
I guess lsan won't be thrilled about leaking the embedder data. Why not just pointing ...
4 years, 2 months ago (2016-10-06 13:28:48 UTC) #9
adamk
On 2016/10/06 13:28:48, jochen wrote: > I guess lsan won't be thrilled about leaking the ...
4 years, 2 months ago (2016-10-06 18:36:18 UTC) #10
jochen (gone - plz use gerrit)
if those globals are weak as well, yes
4 years, 2 months ago (2016-10-06 19:06:15 UTC) #11
adamk
Handled neis's comments (interested to hear your offline idea). Also it seems like the hash ...
4 years, 2 months ago (2016-10-06 20:47:01 UTC) #12
adamk
I've added a DisposeModuleEmbedderData() helper and called it in a bunch of places. Thoughts? Should ...
4 years, 2 months ago (2016-10-06 21:28:54 UTC) #19
adamk
Jochen, thoughts on this approach to lifetime management?
4 years, 2 months ago (2016-10-07 18:18:26 UTC) #22
neis
lgtm modulo the d8/api issues that you're discussing, which I'm not familiar with.
4 years, 2 months ago (2016-10-10 12:10:41 UTC) #27
jochen (gone - plz use gerrit)
sorry for the late reply. In Blink, we also explicitly destroy some per context data ...
4 years, 2 months ago (2016-10-10 12:24:29 UTC) #28
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/2393303002/100001
4 years, 2 months ago (2016-10-10 17:04:58 UTC) #30
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/2393303002/120001
4 years, 2 months ago (2016-10-10 17:06:30 UTC) #34
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 2 months ago (2016-10-10 17:37:39 UTC) #35
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/9cf8fce74cf6e7afd6aea3f3545f6bb61572f277 Cr-Commit-Position: refs/heads/master@{#40133}
4 years, 2 months ago (2016-10-10 17:38:03 UTC) #37
adamk
4 years, 2 months ago (2016-10-11 00:24:25 UTC) #38
Message was sent while issue was closed.
A revert of this CL (patchset #7 id:120001) has been created in
https://codereview.chromium.org/2406973003/ by adamk@chromium.org.

The reason for reverting is: Fails under LeakSanitizer on auto-roll fyi bot:

https://build.chromium.org/p/client.v8.fyi/builders/Auto-roll%20-%20release%2....

Powered by Google App Engine
This is Rietveld 408576698