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

Issue 10690043: Implement proper module linking. (Closed)

Created:
8 years, 5 months ago by rossberg
Modified:
8 years, 5 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Implement proper module linking. Specifically: - In parser, check that all exports are defined. - Move JSModule allocation from parser to scope resolution. - Move JSModule linking from full codegen to scope resolution. - Implement module accessors for exported value members. - Allocate module contexts statically along with JSModules (to allow static linking), but chain them when module literal is evaluated. - Make module contexts' extension slot refer to resp. JSModule (makes modules' ScopeInfo accessible from context). - Some other tweaks to context handling in general. - Make any code containing module literals (and thus embedding static references to JSModules) non-cacheable. This enables accessing module instance objects as expected. Import declarations are a separate feature and do not work yet. R=mstarzinger@chromium.org BUG=v8:1569 TEST= Committed: https://code.google.com/p/v8/source/detail?r=12010

Patch Set 1 #

Total comments: 33

Patch Set 2 : Addressed Michael's comments. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+610 lines, -161 lines) Patch
M src/accessors.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/accessors.cc View 1 1 chunk +65 lines, -0 lines 0 comments Download
M src/ast.h View 1 3 chunks +13 lines, -18 lines 0 comments Download
M src/ast.cc View 1 4 chunks +15 lines, -1 line 0 comments Download
M src/compiler.cc View 4 chunks +7 lines, -3 lines 0 comments Download
M src/contexts.h View 1 5 chunks +8 lines, -3 lines 0 comments Download
M src/contexts.cc View 1 1 chunk +7 lines, -2 lines 0 comments Download
M src/factory.h View 2 chunks +3 lines, -3 lines 0 comments Download
M src/factory.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M src/full-codegen.cc View 3 chunks +41 lines, -57 lines 1 comment Download
M src/heap.h View 2 chunks +3 lines, -3 lines 0 comments Download
M src/heap.cc View 1 3 chunks +12 lines, -9 lines 0 comments Download
M src/messages.js View 1 2 chunks +7 lines, -1 line 0 comments Download
M src/objects.h View 1 5 chunks +10 lines, -2 lines 0 comments Download
M src/objects-debug.cc View 1 chunk +3 lines, -5 lines 0 comments Download
M src/objects-inl.h View 2 chunks +2 lines, -0 lines 0 comments Download
M src/objects-printer.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M src/parser.h View 1 chunk +1 line, -1 line 0 comments Download
M src/parser.cc View 1 6 chunks +26 lines, -20 lines 0 comments Download
M src/runtime.h View 2 chunks +4 lines, -1 line 0 comments Download
M src/runtime.cc View 1 chunk +16 lines, -10 lines 0 comments Download
M src/scopeinfo.cc View 2 chunks +3 lines, -6 lines 0 comments Download
M src/scopes.h View 1 2 chunks +9 lines, -1 line 0 comments Download
M src/scopes.cc View 1 5 chunks +87 lines, -1 line 1 comment Download
M test/mjsunit/harmony/module-linking.js View 2 chunks +180 lines, -3 lines 0 comments Download
M test/mjsunit/harmony/module-parsing.js View 1 chunk +5 lines, -0 lines 0 comments Download
A + test/mjsunit/harmony/module-recompile.js View 1 1 chunk +57 lines, -4 lines 0 comments Download
M test/mjsunit/harmony/module-resolution.js View 3 chunks +15 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
rossberg
8 years, 5 months ago (2012-06-29 15:07:52 UTC) #1
rossberg
Sorry for the size of this CL, but it is difficult to break into meaningful ...
8 years, 5 months ago (2012-06-29 15:10:36 UTC) #2
Michael Starzinger
LGTM (with nits and comments). Just one real comment at the end of scopes.cc, the ...
8 years, 5 months ago (2012-07-06 10:53:22 UTC) #3
rossberg
https://chromiumcodereview.appspot.com/10690043/diff/1/src/accessors.cc File src/accessors.cc (right): https://chromiumcodereview.appspot.com/10690043/diff/1/src/accessors.cc#newcode855 src/accessors.cc:855: Factory* factory = Isolate::Current()->factory(); On 2012/07/06 10:53:22, Michael Starzinger ...
8 years, 5 months ago (2012-07-06 15:39:28 UTC) #4
Jakob Kummerow
8 years, 5 months ago (2012-07-09 11:03:12 UTC) #5
This breaks compilation on newer GCCs:

../src/scopes.cc: In member function 'void
v8::internal::Scope::LinkModules(v8::internal::CompilationInfo*)':
../src/scopes.cc:1379:24: error: variable 'result' set but not used
[-Werror=unused-but-set-variable]

../src/full-codegen.cc: In member function 'virtual void
v8::internal::FullCodeGenerator::VisitModuleLiteral(v8::internal::ModuleLiteral*)':
../src/full-codegen.cc:596:21: error: variable 'scope_info' set but not used
[-Werror=unused-but-set-variable]

https://chromiumcodereview.appspot.com/10690043/diff/4004/src/full-codegen.cc
File src/full-codegen.cc (right):

https://chromiumcodereview.appspot.com/10690043/diff/4004/src/full-codegen.cc...
src/full-codegen.cc:596: Handle<ScopeInfo> scope_info = scope_->GetScopeInfo();
unused variable.

https://chromiumcodereview.appspot.com/10690043/diff/4004/src/scopes.cc
File src/scopes.cc (right):

https://chromiumcodereview.appspot.com/10690043/diff/4004/src/scopes.cc#newco...
src/scopes.cc:1371: Handle<Object> result = SetAccessor(instance, info);
unused variable (in release mode).

Powered by Google App Engine
This is Rietveld 408576698