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

Side by Side Diff: pkg/compiler/lib/src/compiler.dart

Issue 2850503005: Call resolveLibraryMetadata only when dart:mirrors are loaded (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library dart2js.compiler_base; 5 library dart2js.compiler_base;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import '../compiler_new.dart' as api; 9 import '../compiler_new.dart' as api;
10 import 'closure.dart' as closureMapping show ClosureTask; 10 import 'closure.dart' as closureMapping show ClosureTask;
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 resolutionEnqueuer 545 resolutionEnqueuer
546 .applyImpact(computeImpactForLibrary(rootLibrary)); 546 .applyImpact(computeImpactForLibrary(rootLibrary));
547 } 547 }
548 if (librariesToAnalyzeWhenRun != null) { 548 if (librariesToAnalyzeWhenRun != null) {
549 for (Uri libraryUri in librariesToAnalyzeWhenRun) { 549 for (Uri libraryUri in librariesToAnalyzeWhenRun) {
550 resolutionEnqueuer.applyImpact(computeImpactForLibrary( 550 resolutionEnqueuer.applyImpact(computeImpactForLibrary(
551 libraryLoader.lookupLibrary(libraryUri))); 551 libraryLoader.lookupLibrary(libraryUri)));
552 } 552 }
553 } 553 }
554 } 554 }
555 resolveLibraryMetadata(); 555 if (commonElements.mirrorsLibrary != null) {
556 resolveLibraryMetadata();
557 }
556 reporter.log('Resolving...'); 558 reporter.log('Resolving...');
557 559
558 processQueue(resolutionEnqueuer, mainFunction, libraryLoader.libraries, 560 processQueue(resolutionEnqueuer, mainFunction, libraryLoader.libraries,
559 onProgress: showResolutionProgress); 561 onProgress: showResolutionProgress);
560 backend.onResolutionEnd(); 562 backend.onResolutionEnd();
561 resolutionEnqueuer.logSummary(reporter.log); 563 resolutionEnqueuer.logSummary(reporter.log);
562 564
563 _reporter.reportSuppressedMessagesSummary(); 565 _reporter.reportSuppressedMessagesSummary();
564 566
565 if (compilationFailed) { 567 if (compilationFailed) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 } 692 }
691 }); 693 });
692 } 694 }
693 return impactBuilder; 695 return impactBuilder;
694 } 696 }
695 697
696 // Resolves metadata on library elements. This is necessary in order to 698 // Resolves metadata on library elements. This is necessary in order to
697 // resolve metadata classes referenced only from metadata on library tags. 699 // resolve metadata classes referenced only from metadata on library tags.
698 // TODO(ahe): Figure out how to do this lazily. 700 // TODO(ahe): Figure out how to do this lazily.
699 void resolveLibraryMetadata() { 701 void resolveLibraryMetadata() {
700 if (commonElements.mirrorsLibrary == null) return; 702 assert(commonElements.mirrorsLibrary != null);
701 for (LibraryElement library in libraryLoader.libraries) { 703 for (LibraryElement library in libraryLoader.libraries) {
702 if (library.metadata != null) { 704 if (library.metadata != null) {
703 for (MetadataAnnotation metadata in library.metadata) { 705 for (MetadataAnnotation metadata in library.metadata) {
704 metadata.ensureResolved(resolution); 706 metadata.ensureResolved(resolution);
705 } 707 }
706 } 708 }
707 } 709 }
708 } 710 }
709 711
710 /** 712 /**
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 _ElementScanner(this.scanner); 1679 _ElementScanner(this.scanner);
1678 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 1680 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
1679 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 1681 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
1680 } 1682 }
1681 1683
1682 class _EmptyEnvironment implements Environment { 1684 class _EmptyEnvironment implements Environment {
1683 const _EmptyEnvironment(); 1685 const _EmptyEnvironment();
1684 1686
1685 String valueOf(String key) => null; 1687 String valueOf(String key) => null;
1686 } 1688 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698