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

Issue 2367623004: [modules] Detect and throw exceptions for cyclic dependencies (Closed)

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

Description

[modules] Detect and throw exceptions for cyclic dependencies Use an unordered_map<Module, unordered_set<String>> to keep track of visited Module/ExportName pairs during ResolveExport. This required adding a Hash() method to Module, which is accomplished by allocating a Symbol and storing it in the SharedFunctionInfo::name slot, then delegating the hash to that Symbol. Also added a helper method Module::shared() to easily get ahold of the SharedFunctionInfo and call it in the appropriate places instead of re-doing the ternary operator. BUG=v8:1569 Committed: https://crrev.com/b48eb56905e7fb3f14d9f54adb4853e01fdacc4e Cr-Commit-Position: refs/heads/master@{#39743}

Patch Set 1 #

Patch Set 2 : Update golden files #

Total comments: 4

Patch Set 3 : Rebased #

Patch Set 4 : Handled review comments, added a test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+147 lines, -43 lines) Patch
M src/factory.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/messages.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/objects.h View 1 2 3 2 chunks +15 lines, -8 lines 0 comments Download
M src/objects.cc View 1 2 3 9 chunks +100 lines, -15 lines 0 comments Download
M src/objects-debug.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/objects-inl.h View 2 chunks +11 lines, -8 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForOf.golden View 1 4 chunks +4 lines, -4 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Generators.golden View 1 1 chunk +1 line, -1 line 0 comments Download
A + test/mjsunit/modules-fail-cyclic-1.js View 1 2 1 chunk +2 lines, -1 line 0 comments Download
A + test/mjsunit/modules-fail-cyclic-2.js View 1 2 1 chunk +2 lines, -1 line 0 comments Download
A + test/mjsunit/modules-fail-cyclic-3.js View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
A + test/mjsunit/modules-skip-cyclic.js View 1 2 1 chunk +1 line, -3 lines 0 comments Download
A + test/mjsunit/modules-skip-cyclic-3.js View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 20 (12 generated)
adamk
This is ready for initial review, even if it's not quite done.
4 years, 2 months ago (2016-09-24 00:04:07 UTC) #8
adamk
Okay, this is ready for review again
4 years, 2 months ago (2016-09-26 19:01:38 UTC) #11
neis
https://codereview.chromium.org/2367623004/diff/20001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/2367623004/diff/20001/src/objects.h#newcode7953 src/objects.h:7953: s/Returns/Get/ for consistency https://codereview.chromium.org/2367623004/diff/20001/src/objects.h#newcode7958 src/objects.h:7958: inline uint32_t Hash() const; ...
4 years, 2 months ago (2016-09-26 21:06:28 UTC) #12
adamk
Handled review comments, clarified unordered_map usage, added a more complicated cyclic test. PTAL. https://codereview.chromium.org/2367623004/diff/20001/src/objects.h File ...
4 years, 2 months ago (2016-09-26 21:20:47 UTC) #13
neis
lgtm
4 years, 2 months ago (2016-09-26 22:13:40 UTC) #15
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/2367623004/60001
4 years, 2 months ago (2016-09-26 22:13:54 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 2 months ago (2016-09-26 22:42:25 UTC) #18
commit-bot: I haz the power
4 years, 2 months ago (2016-09-26 22:42:54 UTC) #20
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/b48eb56905e7fb3f14d9f54adb4853e01fdacc4e
Cr-Commit-Position: refs/heads/master@{#39743}

Powered by Google App Engine
This is Rietveld 408576698