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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/library_loader.dart

Issue 201613006: Introduces the new syntax for deferred loading (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * [CompilerTask] for loading libraries and setting up the import/export scopes. 8 * [CompilerTask] for loading libraries and setting up the import/export scopes.
9 * 9 *
10 * The library loader uses four different kinds of URIs in different parts of 10 * The library loader uses four different kinds of URIs in different parts of
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 prefixElement = new PrefixElementX(prefix, 549 prefixElement = new PrefixElementX(prefix,
550 importingLibrary.entryCompilationUnit, import.getBeginToken()); 550 importingLibrary.entryCompilationUnit, import.getBeginToken());
551 } else { 551 } else {
552 prefixElement = existingElement; 552 prefixElement = existingElement;
553 } 553 }
554 importingLibrary.addToScope(prefixElement, compiler); 554 importingLibrary.addToScope(prefixElement, compiler);
555 importedLibrary.forEachExport((Element element) { 555 importedLibrary.forEachExport((Element element) {
556 if (combinatorFilter.exclude(element)) return; 556 if (combinatorFilter.exclude(element)) return;
557 prefixElement.addImport(element, import, compiler); 557 prefixElement.addImport(element, import, compiler);
558 }); 558 });
559 if (import.isDeferred) {
560 prefixElement.addImport(
561 new DeferredLoaderFunctionElementX(prefixElement),
562 import, compiler);
563 prefixElement.markAsDeferred(import);
Johnni Winther 2014/03/18 12:29:14 Add a TODO to make (a deferred) [import] an argume
sigurdm 2014/03/20 12:26:33 Done.
564 }
559 } else { 565 } else {
560 importedLibrary.forEachExport((Element element) { 566 importedLibrary.forEachExport((Element element) {
561 compiler.withCurrentElement(importingLibrary, () { 567 compiler.withCurrentElement(importingLibrary, () {
562 if (combinatorFilter.exclude(element)) return; 568 if (combinatorFilter.exclude(element)) return;
563 importingLibrary.addImport(element, import, compiler); 569 importingLibrary.addImport(element, import, compiler);
564 }); 570 });
565 }); 571 });
566 } 572 }
567 } 573 }
568 } 574 }
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 } 926 }
921 927
922 /** 928 /**
923 * Registers all top-level entities of [library] as starting point for the 929 * Registers all top-level entities of [library] as starting point for the
924 * fixed-point computation of the import/export scopes. 930 * fixed-point computation of the import/export scopes.
925 */ 931 */
926 void registerLibraryExports(LibraryElement library) { 932 void registerLibraryExports(LibraryElement library) {
927 nodeMap[library].registerInitialExports(); 933 nodeMap[library].registerInitialExports();
928 } 934 }
929 } 935 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698