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

Side by Side Diff: pkg/analyzer/lib/src/summary/pub_summary.dart

Issue 2353433002: Use configurations and declared variables to select import/export URIs during prelinking. (Closed)
Patch Set: Cache selected URI. Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'dart:core'; 7 import 'dart:core';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 uriToNode[uri] = node; 734 uriToNode[uri] = node;
735 } 735 }
736 } 736 }
737 Set<String> libraryUris = uriToNode.keys.toSet(); 737 Set<String> libraryUris = uriToNode.keys.toSet();
738 // Perform linking. 738 // Perform linking.
739 Map<String, LinkedLibraryBuilder> linkedLibraries = 739 Map<String, LinkedLibraryBuilder> linkedLibraries =
740 link(libraryUris, (String uri) { 740 link(libraryUris, (String uri) {
741 return store.linkedMap[uri]; 741 return store.linkedMap[uri];
742 }, (String uri) { 742 }, (String uri) {
743 return store.unlinkedMap[uri]; 743 return store.unlinkedMap[uri];
744 }, (String name) {
745 // TODO(scheglov) decide how to use declared variables in Pub
746 return null;
744 }, strong); 747 }, strong);
745 // Assemble linked bundles and put them into the store. 748 // Assemble linked bundles and put them into the store.
746 for (_LinkedNode node in scc) { 749 for (_LinkedNode node in scc) {
747 PackageBundleAssembler assembler = new PackageBundleAssembler(); 750 PackageBundleAssembler assembler = new PackageBundleAssembler();
748 linkedLibraries.forEach((uri, linkedLibrary) { 751 linkedLibraries.forEach((uri, linkedLibrary) {
749 if (identical(uriToNode[uri], node)) { 752 if (identical(uriToNode[uri], node)) {
750 assembler.addLinkedLibrary(uri, linkedLibrary); 753 assembler.addLinkedLibrary(uri, linkedLibrary);
751 } 754 }
752 }); 755 });
753 List<int> bytes = assembler.assemble().toBuffer(); 756 List<int> bytes = assembler.assemble().toBuffer();
(...skipping 21 matching lines...) Expand all
775 } 778 }
776 779
777 /** 780 /**
778 * Check whether the given `package:` [uri] is listed in the package map. 781 * Check whether the given `package:` [uri] is listed in the package map.
779 */ 782 */
780 bool isListed(String uri) { 783 bool isListed(String uri) {
781 String package = PubSummaryManager.getPackageName(uri); 784 String package = PubSummaryManager.getPackageName(uri);
782 return names.contains(package); 785 return names.contains(package);
783 } 786 }
784 } 787 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/prelink.dart ('k') | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698