OLD | NEW |
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 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 entry.setState(RESOLVED_UNIT12, CacheState.FLUSHED); | 1372 entry.setState(RESOLVED_UNIT12, CacheState.FLUSHED); |
1373 entry.setState(RESOLVED_UNIT13, CacheState.FLUSHED); | 1373 entry.setState(RESOLVED_UNIT13, CacheState.FLUSHED); |
1374 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); | 1374 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); |
1375 } | 1375 } |
1376 | 1376 |
1377 @override | 1377 @override |
1378 bool validateCacheConsistency() { | 1378 bool validateCacheConsistency() { |
1379 int consistencyCheckStart = JavaSystem.nanoTime(); | 1379 int consistencyCheckStart = JavaSystem.nanoTime(); |
1380 HashSet<Source> changedSources = new HashSet<Source>(); | 1380 HashSet<Source> changedSources = new HashSet<Source>(); |
1381 HashSet<Source> missingSources = new HashSet<Source>(); | 1381 HashSet<Source> missingSources = new HashSet<Source>(); |
1382 for (Source source in _cache.sources) { | 1382 for (Source source in _privatePartition.sources) { |
1383 CacheEntry entry = _cache.get(source); | 1383 CacheEntry entry = _privatePartition.get(source); |
1384 int sourceTime = getModificationStamp(source); | 1384 int sourceTime = getModificationStamp(source); |
1385 if (sourceTime != entry.modificationTime) { | 1385 if (sourceTime != entry.modificationTime) { |
1386 changedSources.add(source); | 1386 changedSources.add(source); |
| 1387 PerformanceStatistics |
| 1388 .cacheConsistencyValidationStatistics.numOfModified++; |
1387 } | 1389 } |
1388 if (entry.exception != null) { | 1390 if (entry.exception != null) { |
1389 if (!exists(source)) { | 1391 if (!exists(source)) { |
1390 missingSources.add(source); | 1392 missingSources.add(source); |
| 1393 PerformanceStatistics |
| 1394 .cacheConsistencyValidationStatistics.numOfModified++; |
1391 } | 1395 } |
1392 } | 1396 } |
1393 } | 1397 } |
1394 for (Source source in changedSources) { | 1398 for (Source source in changedSources) { |
1395 _sourceChanged(source); | 1399 _sourceChanged(source); |
1396 } | 1400 } |
1397 int removalCount = 0; | 1401 int removalCount = 0; |
1398 for (Source source in missingSources) { | 1402 for (Source source in missingSources) { |
1399 if (getLibrariesContaining(source).isEmpty && | 1403 if (getLibrariesContaining(source).isEmpty && |
1400 getLibrariesDependingOn(source).isEmpty) { | 1404 getLibrariesDependingOn(source).isEmpty) { |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2262 } | 2266 } |
2263 DartSdk sdk = factory.dartSdk; | 2267 DartSdk sdk = factory.dartSdk; |
2264 if (sdk == null) { | 2268 if (sdk == null) { |
2265 throw new IllegalArgumentException( | 2269 throw new IllegalArgumentException( |
2266 "The source factory for an SDK analysis context must have a DartUriRes
olver"); | 2270 "The source factory for an SDK analysis context must have a DartUriRes
olver"); |
2267 } | 2271 } |
2268 return new AnalysisCache( | 2272 return new AnalysisCache( |
2269 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 2273 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
2270 } | 2274 } |
2271 } | 2275 } |
OLD | NEW |