|
[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}
Total comments: 4
|
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
|
Total messages: 20 (12 generated)
|