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

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

Issue 1854863002: Issue 26096. Explicitly compute the result that ensures that directives are resolved in units. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix for a review comment. Created 4 years, 8 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) 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.context.context; 5 library analyzer.src.context.context;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); 1231 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED);
1232 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); 1232 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED);
1233 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); 1233 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED);
1234 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); 1234 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED);
1235 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); 1235 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED);
1236 entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED); 1236 entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED);
1237 entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED); 1237 entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED);
1238 entry.setState(RESOLVED_UNIT9, CacheState.FLUSHED); 1238 entry.setState(RESOLVED_UNIT9, CacheState.FLUSHED);
1239 entry.setState(RESOLVED_UNIT10, CacheState.FLUSHED); 1239 entry.setState(RESOLVED_UNIT10, CacheState.FLUSHED);
1240 entry.setState(RESOLVED_UNIT11, CacheState.FLUSHED); 1240 entry.setState(RESOLVED_UNIT11, CacheState.FLUSHED);
1241 entry.setState(RESOLVED_UNIT12, CacheState.FLUSHED);
1241 // USED_IMPORTED_ELEMENTS 1242 // USED_IMPORTED_ELEMENTS
1242 // USED_LOCAL_ELEMENTS 1243 // USED_LOCAL_ELEMENTS
1243 setValue(STRONG_MODE_ERRORS, AnalysisError.NO_ERRORS); 1244 setValue(STRONG_MODE_ERRORS, AnalysisError.NO_ERRORS);
1244 setValue(VARIABLE_REFERENCE_ERRORS, AnalysisError.NO_ERRORS); 1245 setValue(VARIABLE_REFERENCE_ERRORS, AnalysisError.NO_ERRORS);
1245 setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS); 1246 setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS);
1246 }); 1247 });
1247 1248
1248 CacheEntry entry = getCacheEntry(AnalysisContextTarget.request); 1249 CacheEntry entry = getCacheEntry(AnalysisContextTarget.request);
1249 entry.setValue(TYPE_PROVIDER, typeProvider, TargetedResult.EMPTY_LIST); 1250 entry.setValue(TYPE_PROVIDER, typeProvider, TargetedResult.EMPTY_LIST);
1250 } 1251 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); 1310 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED);
1310 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); 1311 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED);
1311 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); 1312 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED);
1312 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); 1313 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED);
1313 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); 1314 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED);
1314 entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED); 1315 entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED);
1315 entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED); 1316 entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED);
1316 entry.setState(RESOLVED_UNIT9, CacheState.FLUSHED); 1317 entry.setState(RESOLVED_UNIT9, CacheState.FLUSHED);
1317 entry.setState(RESOLVED_UNIT10, CacheState.FLUSHED); 1318 entry.setState(RESOLVED_UNIT10, CacheState.FLUSHED);
1318 entry.setState(RESOLVED_UNIT11, CacheState.FLUSHED); 1319 entry.setState(RESOLVED_UNIT11, CacheState.FLUSHED);
1320 entry.setState(RESOLVED_UNIT12, CacheState.FLUSHED);
1319 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); 1321 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
1320 } 1322 }
1321 1323
1322 @override 1324 @override
1323 bool validateCacheConsistency() { 1325 bool validateCacheConsistency() {
1324 int consistencyCheckStart = JavaSystem.nanoTime(); 1326 int consistencyCheckStart = JavaSystem.nanoTime();
1325 HashSet<Source> changedSources = new HashSet<Source>(); 1327 HashSet<Source> changedSources = new HashSet<Source>();
1326 HashSet<Source> missingSources = new HashSet<Source>(); 1328 HashSet<Source> missingSources = new HashSet<Source>();
1327 for (Source source in _cache.sources) { 1329 for (Source source in _cache.sources) {
1328 CacheEntry entry = _cache.get(source); 1330 CacheEntry entry = _cache.get(source);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 /** 1546 /**
1545 * Return a [CompilationUnit] for the given library and unit sources, which 1547 * Return a [CompilationUnit] for the given library and unit sources, which
1546 * can be incrementally resolved. 1548 * can be incrementally resolved.
1547 */ 1549 */
1548 CompilationUnit _getIncrementallyResolvableUnit( 1550 CompilationUnit _getIncrementallyResolvableUnit(
1549 Source librarySource, Source unitSource) { 1551 Source librarySource, Source unitSource) {
1550 LibrarySpecificUnit target = 1552 LibrarySpecificUnit target =
1551 new LibrarySpecificUnit(librarySource, unitSource); 1553 new LibrarySpecificUnit(librarySource, unitSource);
1552 for (ResultDescriptor result in [ 1554 for (ResultDescriptor result in [
1553 RESOLVED_UNIT, 1555 RESOLVED_UNIT,
1556 RESOLVED_UNIT12,
1554 RESOLVED_UNIT11, 1557 RESOLVED_UNIT11,
1555 RESOLVED_UNIT10, 1558 RESOLVED_UNIT10,
1556 RESOLVED_UNIT9, 1559 RESOLVED_UNIT9,
1557 RESOLVED_UNIT8, 1560 RESOLVED_UNIT8,
1558 RESOLVED_UNIT7, 1561 RESOLVED_UNIT7
1559 RESOLVED_UNIT6
1560 ]) { 1562 ]) {
1561 CompilationUnit unit = getResult(target, result); 1563 CompilationUnit unit = getResult(target, result);
1562 if (unit != null) { 1564 if (unit != null) {
1563 return unit; 1565 return unit;
1564 } 1566 }
1565 } 1567 }
1566 return null; 1568 return null;
1567 } 1569 }
1568 1570
1569 /** 1571 /**
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 } 2199 }
2198 DartSdk sdk = factory.dartSdk; 2200 DartSdk sdk = factory.dartSdk;
2199 if (sdk == null) { 2201 if (sdk == null) {
2200 throw new IllegalArgumentException( 2202 throw new IllegalArgumentException(
2201 "The source factory for an SDK analysis context must have a DartUriRes olver"); 2203 "The source factory for an SDK analysis context must have a DartUriRes olver");
2202 } 2204 }
2203 return new AnalysisCache( 2205 return new AnalysisCache(
2204 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); 2206 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]);
2205 } 2207 }
2206 } 2208 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698