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

Issue 201613006: Introduces the new syntax for deferred loading (Closed)

Created:
6 years, 9 months ago by sigurdm
Modified:
6 years, 9 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Introduces the new syntax for deferred loading import "lib.dart" deferred as lib; And then injecting a function of the name "loadLibrary" into the namespace of the import prefix. This FunctionElement is a triggers the builder to emit special code that causes _loadLibraryWrapper in js_helper to be called. Dart2dart will not crash on deferred loading, but calls to loadLibrary will become calls to a (not-existing) top-level function loadLibrary. The old syntax (using metadata) is still working For now keeping the language tests with the old syntax in addition to the updated tests. R=floitsch@google.com, johnniwinther@google.com Committed: https://code.google.com/p/dart/source/detail?r=34230

Patch Set 1 : #

Total comments: 22

Patch Set 2 : #

Patch Set 3 : Ambigous elements are not top-level. #

Total comments: 13

Patch Set 4 : #

Total comments: 6

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+499 lines, -327 lines) Patch
M sdk/lib/_internal/compiler/implementation/compiler.dart View 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart2jslib.dart View 1 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart View 1 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/deferred_load.dart View 1 7 chunks +59 lines, -36 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/elements/elements.dart View 1 2 3 4 3 chunks +6 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/elements/modelx.dart View 1 2 3 4 5 chunks +52 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/backend.dart View 1 1 chunk +8 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/library_loader.dart View 1 1 chunk +9 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/resolution/members.dart View 1 2 1 chunk +12 lines, -8 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/scanner/keyword.dart View 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/scanner/listener.dart View 2 chunks +7 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/scanner/parser.dart View 2 chunks +6 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/builder.dart View 1 2 3 4 3 chunks +19 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/tree/nodes.dart View 1 1 chunk +3 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart View 1 2 chunks +38 lines, -20 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/tree/unparser.dart View 1 1 chunk +4 lines, -2 lines 0 comments Download
M sdk/lib/_internal/lib/async_patch.dart View 2 chunks +6 lines, -118 lines 0 comments Download
M sdk/lib/_internal/lib/js_helper.dart View 1 2 3 2 chunks +126 lines, -0 lines 0 comments Download
M tests/compiler/dart2js/unparser_test.dart View 1 2 chunks +8 lines, -0 lines 0 comments Download
A + tests/language/deferred_closurize_load_library_lib.dart View 1 1 chunk +1 line, -1 line 0 comments Download
A + tests/language/deferred_closurize_load_library_test.dart View 1 1 chunk +8 lines, -10 lines 0 comments Download
A + tests/language/deferred_constraints_constants_old_syntax_lib.dart View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + tests/language/deferred_constraints_constants_old_syntax_test.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M tests/language/deferred_constraints_constants_test.dart View 2 chunks +2 lines, -5 lines 0 comments Download
A + tests/language/deferred_constraints_old_syntax_lib.dart View 1 chunk +1 line, -1 line 0 comments Download
A + tests/language/deferred_constraints_type_annotation_old_syntax_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/language/deferred_constraints_type_annotation_test.dart View 2 chunks +2 lines, -5 lines 0 comments Download
M tests/language/deferred_duplicate_prefix1_test.dart View 1 chunk +1 line, -5 lines 0 comments Download
M tests/language/deferred_duplicate_prefix2_test.dart View 1 chunk +1 line, -5 lines 0 comments Download
M tests/language/deferred_duplicate_prefix3_test.dart View 1 chunk +2 lines, -7 lines 0 comments Download
A + tests/language/deferred_load_library_wrong_args_lib.dart View 1 1 chunk +1 line, -1 line 0 comments Download
A tests/language/deferred_load_library_wrong_args_test.dart View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M tests/language/deferred_no_prefix_test.dart View 1 2 3 1 chunk +3 lines, -9 lines 0 comments Download
A + tests/language/deferred_shadow_load_library_lib.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download
A tests/language/deferred_shadow_load_library_test.dart View 1 2 3 1 chunk +23 lines, -0 lines 0 comments Download
M tests/language/language.status View 1 2 3 1 chunk +43 lines, -23 lines 0 comments Download
M tests/language/language_analyzer.status View 1 2 3 1 chunk +9 lines, -22 lines 0 comments Download
M tests/language/language_analyzer2.status View 1 2 3 1 chunk +9 lines, -22 lines 0 comments Download
M tests/language/language_dart2js.status View 1 chunk +4 lines, -0 lines 0 comments Download
M tests/lib/lib.status View 2 chunks +3 lines, -0 lines 0 comments Download
M tests/lib/mirrors/deferred_mirrors_metadata_test.dart View 2 chunks +2 lines, -6 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
sigurdm
6 years, 9 months ago (2014-03-17 13:41:00 UTC) #1
karlklose
DBC: https://codereview.chromium.org/201613006/diff/40001/sdk/lib/_internal/compiler/implementation/elements/modelx.dart File sdk/lib/_internal/compiler/implementation/elements/modelx.dart (right): https://codereview.chromium.org/201613006/diff/40001/sdk/lib/_internal/compiler/implementation/elements/modelx.dart#newcode1664 sdk/lib/_internal/compiler/implementation/elements/modelx.dart:1664: class DeferredLoaderFunctionElementX extends FunctionElementX { This element should ...
6 years, 9 months ago (2014-03-17 14:05:00 UTC) #2
floitsch
FYI. https://codereview.chromium.org/201613006/diff/40001/sdk/lib/_internal/compiler/implementation/deferred_load.dart File sdk/lib/_internal/compiler/implementation/deferred_load.dart (right): https://codereview.chromium.org/201613006/diff/40001/sdk/lib/_internal/compiler/implementation/deferred_load.dart#newcode541 sdk/lib/_internal/compiler/implementation/deferred_load.dart:541: // Returns suggestedName if it is not in ...
6 years, 9 months ago (2014-03-17 14:15:41 UTC) #3
Johnni Winther
LGTM https://codereview.chromium.org/201613006/diff/40001/sdk/lib/_internal/compiler/implementation/elements/modelx.dart File sdk/lib/_internal/compiler/implementation/elements/modelx.dart (right): https://codereview.chromium.org/201613006/diff/40001/sdk/lib/_internal/compiler/implementation/elements/modelx.dart#newcode1032 sdk/lib/_internal/compiler/implementation/elements/modelx.dart:1032: Import _import; On 2014/03/17 14:15:41, floitsch wrote: > ...
6 years, 9 months ago (2014-03-18 12:29:13 UTC) #4
sigurdm
Besides addressing comments, I have changed the deferredLoader element to be a getter - so ...
6 years, 9 months ago (2014-03-19 12:46:29 UTC) #5
floitsch
LGTM, but wait for Johnni's ok. Add test where loadLibrary is used as a getter. ...
6 years, 9 months ago (2014-03-19 21:04:51 UTC) #6
Johnni Winther
Still LGTM https://codereview.chromium.org/201613006/diff/100001/sdk/lib/_internal/compiler/implementation/elements/modelx.dart File sdk/lib/_internal/compiler/implementation/elements/modelx.dart (right): https://codereview.chromium.org/201613006/diff/100001/sdk/lib/_internal/compiler/implementation/elements/modelx.dart#newcode1039 sdk/lib/_internal/compiler/implementation/elements/modelx.dart:1039: Import get import => _deferredImport; On 2014/03/19 ...
6 years, 9 months ago (2014-03-20 08:42:56 UTC) #7
sigurdm
https://codereview.chromium.org/201613006/diff/40001/sdk/lib/_internal/compiler/implementation/library_loader.dart File sdk/lib/_internal/compiler/implementation/library_loader.dart (right): https://codereview.chromium.org/201613006/diff/40001/sdk/lib/_internal/compiler/implementation/library_loader.dart#newcode563 sdk/lib/_internal/compiler/implementation/library_loader.dart:563: prefixElement.markAsDeferred(import); On 2014/03/18 12:29:14, Johnni Winther wrote: > Add ...
6 years, 9 months ago (2014-03-20 12:26:32 UTC) #8
floitsch
Almost LGTM. https://codereview.chromium.org/201613006/diff/120001/sdk/lib/_internal/compiler/implementation/elements/elements.dart File sdk/lib/_internal/compiler/implementation/elements/elements.dart (right): https://codereview.chromium.org/201613006/diff/120001/sdk/lib/_internal/compiler/implementation/elements/elements.dart#newcode753 sdk/lib/_internal/compiler/implementation/elements/elements.dart:753: Import get deferred_import; Is this getter even ...
6 years, 9 months ago (2014-03-20 12:33:21 UTC) #9
sigurdm
https://codereview.chromium.org/201613006/diff/120001/sdk/lib/_internal/compiler/implementation/elements/elements.dart File sdk/lib/_internal/compiler/implementation/elements/elements.dart (right): https://codereview.chromium.org/201613006/diff/120001/sdk/lib/_internal/compiler/implementation/elements/elements.dart#newcode753 sdk/lib/_internal/compiler/implementation/elements/elements.dart:753: Import get deferred_import; On 2014/03/20 12:33:22, floitsch wrote: > ...
6 years, 9 months ago (2014-03-20 12:45:54 UTC) #10
sigurdm
6 years, 9 months ago (2014-03-21 07:50:40 UTC) #11
Message was sent while issue was closed.
Committed patchset #5 manually as r34230 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698