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

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 DeferredLoaderGetterElementX(prefixElement),
562 import, compiler);
563 // TODO(sigurdm): When we remove support for the annotation based
564 // syntax the [PrefixElement] constructor should receive this
565 // information.
566 prefixElement.markAsDeferred(import);
567 }
559 } else { 568 } else {
560 importedLibrary.forEachExport((Element element) { 569 importedLibrary.forEachExport((Element element) {
561 compiler.withCurrentElement(importingLibrary, () { 570 compiler.withCurrentElement(importingLibrary, () {
562 if (combinatorFilter.exclude(element)) return; 571 if (combinatorFilter.exclude(element)) return;
563 importingLibrary.addImport(element, import, compiler); 572 importingLibrary.addImport(element, import, compiler);
564 }); 573 });
565 }); 574 });
566 } 575 }
567 } 576 }
568 } 577 }
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 } 929 }
921 930
922 /** 931 /**
923 * Registers all top-level entities of [library] as starting point for the 932 * Registers all top-level entities of [library] as starting point for the
924 * fixed-point computation of the import/export scopes. 933 * fixed-point computation of the import/export scopes.
925 */ 934 */
926 void registerLibraryExports(LibraryElement library) { 935 void registerLibraryExports(LibraryElement library) {
927 nodeMap[library].registerInitialExports(); 936 nodeMap[library].registerInitialExports();
928 } 937 }
929 } 938 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698