Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.incremental_resolver; | 5 library engine.incremental_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
| 9 | 9 |
| 10 import 'package:analyzer/src/context/cache.dart' | 10 import 'package:analyzer/src/context/cache.dart' |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 897 if (isByTask(BuildCompilationUnitElementTask.DESCRIPTOR) || | 897 if (isByTask(BuildCompilationUnitElementTask.DESCRIPTOR) || |
| 898 isByTask(BuildDirectiveElementsTask.DESCRIPTOR) || | 898 isByTask(BuildDirectiveElementsTask.DESCRIPTOR) || |
| 899 isByTask(BuildEnumMemberElementsTask.DESCRIPTOR) || | 899 isByTask(BuildEnumMemberElementsTask.DESCRIPTOR) || |
| 900 isByTask(BuildExportNamespaceTask.DESCRIPTOR) || | 900 isByTask(BuildExportNamespaceTask.DESCRIPTOR) || |
| 901 isByTask(BuildLibraryElementTask.DESCRIPTOR) || | 901 isByTask(BuildLibraryElementTask.DESCRIPTOR) || |
| 902 isByTask(BuildPublicNamespaceTask.DESCRIPTOR) || | 902 isByTask(BuildPublicNamespaceTask.DESCRIPTOR) || |
| 903 isByTask(BuildSourceExportClosureTask.DESCRIPTOR) || | 903 isByTask(BuildSourceExportClosureTask.DESCRIPTOR) || |
| 904 isByTask(BuildSourceImportExportClosureTask.DESCRIPTOR) || | 904 isByTask(BuildSourceImportExportClosureTask.DESCRIPTOR) || |
| 905 isByTask(ComputeConstantDependenciesTask.DESCRIPTOR) || | 905 isByTask(ComputeConstantDependenciesTask.DESCRIPTOR) || |
| 906 isByTask(ComputeConstantValueTask.DESCRIPTOR) || | 906 isByTask(ComputeConstantValueTask.DESCRIPTOR) || |
| 907 isByTask(ComputeLibraryCycleTask.DESCRIPTOR) || | |
|
Leaf
2015/10/07 18:53:55
This was what was causing the cache invalidation t
| |
| 907 isByTask(DartErrorsTask.DESCRIPTOR) || | 908 isByTask(DartErrorsTask.DESCRIPTOR) || |
| 908 isByTask(EvaluateUnitConstantsTask.DESCRIPTOR) || | 909 isByTask(EvaluateUnitConstantsTask.DESCRIPTOR) || |
| 909 isByTask(GenerateHintsTask.DESCRIPTOR) || | 910 isByTask(GenerateHintsTask.DESCRIPTOR) || |
| 910 isByTask(InferInstanceMembersInUnitTask.DESCRIPTOR) || | 911 isByTask(InferInstanceMembersInUnitTask.DESCRIPTOR) || |
| 911 isByTask(InferStaticVariableTypesInUnitTask.DESCRIPTOR) || | 912 isByTask(InferStaticVariableTypesInUnitTask.DESCRIPTOR) || |
| 912 isByTask(LibraryErrorsReadyTask.DESCRIPTOR) || | 913 isByTask(LibraryErrorsReadyTask.DESCRIPTOR) || |
| 913 isByTask(LibraryUnitErrorsTask.DESCRIPTOR) || | 914 isByTask(LibraryUnitErrorsTask.DESCRIPTOR) || |
| 914 isByTask(ParseDartTask.DESCRIPTOR) || | 915 isByTask(ParseDartTask.DESCRIPTOR) || |
| 915 isByTask(PartiallyResolveUnitReferencesTask.DESCRIPTOR) || | 916 isByTask(PartiallyResolveUnitReferencesTask.DESCRIPTOR) || |
| 916 isByTask(ScanDartTask.DESCRIPTOR) || | 917 isByTask(ScanDartTask.DESCRIPTOR) || |
| 917 isByTask(ResolveFunctionBodiesInUnitTask.DESCRIPTOR) || | 918 isByTask(ResolveInstanceFieldsInUnitTask.DESCRIPTOR) || |
| 918 isByTask(ResolveLibraryReferencesTask.DESCRIPTOR) || | 919 isByTask(ResolveLibraryReferencesTask.DESCRIPTOR) || |
| 919 isByTask(ResolveLibraryTypeNamesTask.DESCRIPTOR) || | 920 isByTask(ResolveLibraryTypeNamesTask.DESCRIPTOR) || |
| 921 isByTask(ResolveUnitTask.DESCRIPTOR) || | |
| 920 isByTask(ResolveUnitTypeNamesTask.DESCRIPTOR) || | 922 isByTask(ResolveUnitTypeNamesTask.DESCRIPTOR) || |
| 921 isByTask(ResolveVariableReferencesTask.DESCRIPTOR) || | 923 isByTask(ResolveVariableReferencesTask.DESCRIPTOR) || |
| 922 isByTask(VerifyUnitTask.DESCRIPTOR)) { | 924 isByTask(VerifyUnitTask.DESCRIPTOR)) { |
| 923 return DeltaResult.KEEP_CONTINUE; | 925 return DeltaResult.KEEP_CONTINUE; |
| 924 } | 926 } |
| 925 // invalidate all the other results | 927 // invalidate all the other results |
| 926 return DeltaResult.INVALIDATE_NO_DELTA; | 928 return DeltaResult.INVALIDATE_NO_DELTA; |
| 927 } | 929 } |
| 928 } | 930 } |
| 929 | 931 |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1233 if (oldEntry != null) { | 1235 if (oldEntry != null) { |
| 1234 _shiftEntryErrors_OLD(); | 1236 _shiftEntryErrors_OLD(); |
| 1235 } else { | 1237 } else { |
| 1236 _shiftEntryErrors_NEW(); | 1238 _shiftEntryErrors_NEW(); |
| 1237 } | 1239 } |
| 1238 } | 1240 } |
| 1239 | 1241 |
| 1240 void _shiftEntryErrors_NEW() { | 1242 void _shiftEntryErrors_NEW() { |
| 1241 _shiftErrors_NEW(HINTS); | 1243 _shiftErrors_NEW(HINTS); |
| 1242 _shiftErrors_NEW(LINTS); | 1244 _shiftErrors_NEW(LINTS); |
| 1243 _shiftErrors_NEW(INFER_STATIC_VARIABLE_TYPES_ERRORS); | |
| 1244 _shiftErrors_NEW(LIBRARY_UNIT_ERRORS); | 1245 _shiftErrors_NEW(LIBRARY_UNIT_ERRORS); |
| 1245 _shiftErrors_NEW(PARTIALLY_RESOLVE_REFERENCES_ERRORS); | |
| 1246 _shiftErrors_NEW(RESOLVE_FUNCTION_BODIES_ERRORS); | |
| 1247 _shiftErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS); | 1246 _shiftErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS); |
| 1247 _shiftErrors_NEW(RESOLVE_UNIT_ERRORS); | |
| 1248 _shiftErrors_NEW(VARIABLE_REFERENCE_ERRORS); | 1248 _shiftErrors_NEW(VARIABLE_REFERENCE_ERRORS); |
| 1249 _shiftErrors_NEW(VERIFY_ERRORS); | 1249 _shiftErrors_NEW(VERIFY_ERRORS); |
| 1250 } | 1250 } |
| 1251 | 1251 |
| 1252 void _shiftEntryErrors_OLD() { | 1252 void _shiftEntryErrors_OLD() { |
| 1253 _shiftErrors_OLD(DartEntry.RESOLUTION_ERRORS); | 1253 _shiftErrors_OLD(DartEntry.RESOLUTION_ERRORS); |
| 1254 _shiftErrors_OLD(DartEntry.VERIFICATION_ERRORS); | 1254 _shiftErrors_OLD(DartEntry.VERIFICATION_ERRORS); |
| 1255 _shiftErrors_OLD(DartEntry.HINTS); | 1255 _shiftErrors_OLD(DartEntry.HINTS); |
| 1256 _shiftErrors_OLD(DartEntry.LINTS); | 1256 _shiftErrors_OLD(DartEntry.LINTS); |
| 1257 } | 1257 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1304 | 1304 |
| 1305 void _updateEntry() { | 1305 void _updateEntry() { |
| 1306 if (oldEntry != null) { | 1306 if (oldEntry != null) { |
| 1307 _updateEntry_OLD(); | 1307 _updateEntry_OLD(); |
| 1308 } else { | 1308 } else { |
| 1309 _updateEntry_NEW(); | 1309 _updateEntry_NEW(); |
| 1310 } | 1310 } |
| 1311 } | 1311 } |
| 1312 | 1312 |
| 1313 void _updateEntry_NEW() { | 1313 void _updateEntry_NEW() { |
| 1314 _updateErrors_NEW(INFER_STATIC_VARIABLE_TYPES_ERRORS, _resolveErrors); | |
| 1315 _updateErrors_NEW(PARTIALLY_RESOLVE_REFERENCES_ERRORS, _resolveErrors); | |
| 1316 _updateErrors_NEW(RESOLVE_FUNCTION_BODIES_ERRORS, _resolveErrors); | |
| 1317 _updateErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS, []); | 1314 _updateErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS, []); |
| 1315 _updateErrors_NEW(RESOLVE_UNIT_ERRORS, _resolveErrors); | |
| 1318 _updateErrors_NEW(VARIABLE_REFERENCE_ERRORS, []); | 1316 _updateErrors_NEW(VARIABLE_REFERENCE_ERRORS, []); |
| 1319 _updateErrors_NEW(VERIFY_ERRORS, _verifyErrors); | 1317 _updateErrors_NEW(VERIFY_ERRORS, _verifyErrors); |
| 1320 // invalidate results we don't update incrementally | 1318 // invalidate results we don't update incrementally |
| 1321 newUnitEntry.setState(USED_IMPORTED_ELEMENTS, CacheState.INVALID); | 1319 newUnitEntry.setState(USED_IMPORTED_ELEMENTS, CacheState.INVALID); |
| 1322 newUnitEntry.setState(USED_LOCAL_ELEMENTS, CacheState.INVALID); | 1320 newUnitEntry.setState(USED_LOCAL_ELEMENTS, CacheState.INVALID); |
| 1323 newUnitEntry.setState(HINTS, CacheState.INVALID); | 1321 newUnitEntry.setState(HINTS, CacheState.INVALID); |
| 1324 newUnitEntry.setState(LINTS, CacheState.INVALID); | 1322 newUnitEntry.setState(LINTS, CacheState.INVALID); |
| 1325 } | 1323 } |
| 1326 | 1324 |
| 1327 void _updateEntry_OLD() { | 1325 void _updateEntry_OLD() { |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2143 @override | 2141 @override |
| 2144 String toString() => name; | 2142 String toString() => name; |
| 2145 } | 2143 } |
| 2146 | 2144 |
| 2147 class _TokenPair { | 2145 class _TokenPair { |
| 2148 final _TokenDifferenceKind kind; | 2146 final _TokenDifferenceKind kind; |
| 2149 final Token oldToken; | 2147 final Token oldToken; |
| 2150 final Token newToken; | 2148 final Token newToken; |
| 2151 _TokenPair(this.kind, this.oldToken, this.newToken); | 2149 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 2152 } | 2150 } |
| OLD | NEW |