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

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 2473443005: Don't compute library cycle when the library is resynthesized. (Closed)
Patch Set: Created 4 years, 1 month 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer.src.task.dart; 5 library analyzer.src.task.dart;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
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 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2204 // in the element model. The LIBRARY_CYCLE results that have been cached 2204 // in the element model. The LIBRARY_CYCLE results that have been cached
2205 // by the task model are conservatively invalidated by the 2205 // by the task model are conservatively invalidated by the
2206 // IMPORT_EXPORT_SOURCE_CLOSURE dependency below. If anything reachable 2206 // IMPORT_EXPORT_SOURCE_CLOSURE dependency below. If anything reachable
2207 // from a node is changed, its LIBRARY_CYCLE results will be re-computed 2207 // from a node is changed, its LIBRARY_CYCLE results will be re-computed
2208 // here (possibly re-using the result from the element model if invalidation 2208 // here (possibly re-using the result from the element model if invalidation
2209 // did not cause it to be erased). In summary, task model dependencies 2209 // did not cause it to be erased). In summary, task model dependencies
2210 // on the import/export source closure ensure that this method will be 2210 // on the import/export source closure ensure that this method will be
2211 // re-run if anything reachable from this target has been invalidated, 2211 // re-run if anything reachable from this target has been invalidated,
2212 // and the invalidation code (invalidateLibraryCycles) will ensure that 2212 // and the invalidation code (invalidateLibraryCycles) will ensure that
2213 // element model results will be re-used here only if they are still valid. 2213 // element model results will be re-used here only if they are still valid.
2214 if (context.analysisOptions.strongMode) { 2214 LibraryElement library = getRequiredInput(LIBRARY_ELEMENT_INPUT);
2215 LibraryElement library = getRequiredInput(LIBRARY_ELEMENT_INPUT); 2215 if (context.analysisOptions.strongMode &&
2216 !LibraryElementImpl.hasResolutionCapability(
2217 library, LibraryResolutionCapability.resolvedTypeNames)) {
2216 List<LibraryElement> component = library.libraryCycle; 2218 List<LibraryElement> component = library.libraryCycle;
2217 Set<LibraryElement> filter = component.toSet(); 2219 Set<LibraryElement> filter = component.toSet();
2218 Set<CompilationUnitElement> deps = new Set<CompilationUnitElement>(); 2220 Set<CompilationUnitElement> deps = new Set<CompilationUnitElement>();
2219 void addLibrary(LibraryElement l) { 2221 void addLibrary(LibraryElement l) {
2220 if (!filter.contains(l)) { 2222 if (!filter.contains(l)) {
2221 deps.addAll(l.units); 2223 deps.addAll(l.units);
2222 } 2224 }
2223 } 2225 }
2224 2226
2225 int length = component.length; 2227 int length = component.length;
(...skipping 4216 matching lines...) Expand 10 before | Expand all | Expand 10 after
6442 6444
6443 @override 6445 @override
6444 bool moveNext() { 6446 bool moveNext() {
6445 if (_newSources.isEmpty) { 6447 if (_newSources.isEmpty) {
6446 return false; 6448 return false;
6447 } 6449 }
6448 currentTarget = _newSources.removeLast(); 6450 currentTarget = _newSources.removeLast();
6449 return true; 6451 return true;
6450 } 6452 }
6451 } 6453 }
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