| 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/instrumentation/instrumentation.dart'; | 10 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 | 1107 |
| 1108 LibrarySpecificUnit unit = | 1108 LibrarySpecificUnit unit = |
| 1109 new LibrarySpecificUnit(librarySource, librarySource); | 1109 new LibrarySpecificUnit(librarySource, librarySource); |
| 1110 entry = getCacheEntry(unit); | 1110 entry = getCacheEntry(unit); |
| 1111 setValue(HINTS, AnalysisError.NO_ERRORS); | 1111 setValue(HINTS, AnalysisError.NO_ERRORS); |
| 1112 // dartEntry.setValue(LINTS, AnalysisError.NO_ERRORS); | 1112 // dartEntry.setValue(LINTS, AnalysisError.NO_ERRORS); |
| 1113 entry.setState(RESOLVE_REFERENCES_ERRORS, CacheState.FLUSHED); | 1113 entry.setState(RESOLVE_REFERENCES_ERRORS, CacheState.FLUSHED); |
| 1114 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); | 1114 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); |
| 1115 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); | 1115 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); |
| 1116 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); | 1116 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); |
| 1117 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); |
| 1117 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); | 1118 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); |
| 1118 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); | 1119 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); |
| 1119 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); | |
| 1120 // USED_IMPORTED_ELEMENTS | 1120 // USED_IMPORTED_ELEMENTS |
| 1121 // USED_LOCAL_ELEMENTS | 1121 // USED_LOCAL_ELEMENTS |
| 1122 setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS); | 1122 setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS); |
| 1123 }); | 1123 }); |
| 1124 | 1124 |
| 1125 CacheEntry entry = getCacheEntry(AnalysisContextTarget.request); | 1125 CacheEntry entry = getCacheEntry(AnalysisContextTarget.request); |
| 1126 entry.setValue(TYPE_PROVIDER, typeProvider, TargetedResult.EMPTY_LIST); | 1126 entry.setValue(TYPE_PROVIDER, typeProvider, TargetedResult.EMPTY_LIST); |
| 1127 } | 1127 } |
| 1128 | 1128 |
| 1129 @override | 1129 @override |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 return true; | 1184 return true; |
| 1185 } | 1185 } |
| 1186 } | 1186 } |
| 1187 | 1187 |
| 1188 @override | 1188 @override |
| 1189 void test_flushAstStructures(Source source) { | 1189 void test_flushAstStructures(Source source) { |
| 1190 CacheEntry entry = getCacheEntry(source); | 1190 CacheEntry entry = getCacheEntry(source); |
| 1191 entry.setState(PARSED_UNIT, CacheState.FLUSHED); | 1191 entry.setState(PARSED_UNIT, CacheState.FLUSHED); |
| 1192 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); | 1192 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); |
| 1193 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); | 1193 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); |
| 1194 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); |
| 1194 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); | 1195 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); |
| 1195 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); | 1196 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); |
| 1196 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); | |
| 1197 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); | 1197 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); |
| 1198 } | 1198 } |
| 1199 | 1199 |
| 1200 @override | 1200 @override |
| 1201 bool validateCacheConsistency() { | 1201 bool validateCacheConsistency() { |
| 1202 int consistencyCheckStart = JavaSystem.nanoTime(); | 1202 int consistencyCheckStart = JavaSystem.nanoTime(); |
| 1203 HashSet<Source> changedSources = new HashSet<Source>(); | 1203 HashSet<Source> changedSources = new HashSet<Source>(); |
| 1204 HashSet<Source> missingSources = new HashSet<Source>(); | 1204 HashSet<Source> missingSources = new HashSet<Source>(); |
| 1205 for (Source source in _cache.sources) { | 1205 for (Source source in _cache.sources) { |
| 1206 CacheEntry entry = _cache.get(source); | 1206 CacheEntry entry = _cache.get(source); |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2015 new PendingFuture<T>(_context, target, computeValue); | 2015 new PendingFuture<T>(_context, target, computeValue); |
| 2016 if (!pendingFuture.evaluate(entry)) { | 2016 if (!pendingFuture.evaluate(entry)) { |
| 2017 _context._pendingFutureTargets | 2017 _context._pendingFutureTargets |
| 2018 .putIfAbsent(target, () => <PendingFuture>[]) | 2018 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2019 .add(pendingFuture); | 2019 .add(pendingFuture); |
| 2020 scheduleComputation(); | 2020 scheduleComputation(); |
| 2021 } | 2021 } |
| 2022 return pendingFuture.future; | 2022 return pendingFuture.future; |
| 2023 } | 2023 } |
| 2024 } | 2024 } |
| OLD | NEW |