| 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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 isByTask(DartErrorsTask.DESCRIPTOR) || | 889 isByTask(DartErrorsTask.DESCRIPTOR) || |
| 890 isByTask(EvaluateUnitConstantsTask.DESCRIPTOR) || | 890 isByTask(EvaluateUnitConstantsTask.DESCRIPTOR) || |
| 891 isByTask(GenerateHintsTask.DESCRIPTOR) || | 891 isByTask(GenerateHintsTask.DESCRIPTOR) || |
| 892 isByTask(InferInstanceMembersInUnitTask.DESCRIPTOR) || | 892 isByTask(InferInstanceMembersInUnitTask.DESCRIPTOR) || |
| 893 isByTask(InferStaticVariableTypesInUnitTask.DESCRIPTOR) || | 893 isByTask(InferStaticVariableTypesInUnitTask.DESCRIPTOR) || |
| 894 isByTask(LibraryErrorsReadyTask.DESCRIPTOR) || | 894 isByTask(LibraryErrorsReadyTask.DESCRIPTOR) || |
| 895 isByTask(LibraryUnitErrorsTask.DESCRIPTOR) || | 895 isByTask(LibraryUnitErrorsTask.DESCRIPTOR) || |
| 896 isByTask(ParseDartTask.DESCRIPTOR) || | 896 isByTask(ParseDartTask.DESCRIPTOR) || |
| 897 isByTask(PartiallyResolveUnitReferencesTask.DESCRIPTOR) || | 897 isByTask(PartiallyResolveUnitReferencesTask.DESCRIPTOR) || |
| 898 isByTask(ScanDartTask.DESCRIPTOR) || | 898 isByTask(ScanDartTask.DESCRIPTOR) || |
| 899 isByTask(ResolveFunctionBodiesInUnitTask.DESCRIPTOR) || | 899 isByTask(ResolveInstanceFieldsInUnitTask.DESCRIPTOR) || |
| 900 isByTask(ResolveUnitTask.DESCRIPTOR) || |
| 900 isByTask(ResolveLibraryReferencesTask.DESCRIPTOR) || | 901 isByTask(ResolveLibraryReferencesTask.DESCRIPTOR) || |
| 901 isByTask(ResolveLibraryTypeNamesTask.DESCRIPTOR) || | 902 isByTask(ResolveLibraryTypeNamesTask.DESCRIPTOR) || |
| 902 isByTask(ResolveUnitTypeNamesTask.DESCRIPTOR) || | 903 isByTask(ResolveUnitTypeNamesTask.DESCRIPTOR) || |
| 903 isByTask(ResolveVariableReferencesTask.DESCRIPTOR) || | 904 isByTask(ResolveVariableReferencesTask.DESCRIPTOR) || |
| 904 isByTask(VerifyUnitTask.DESCRIPTOR)) { | 905 isByTask(VerifyUnitTask.DESCRIPTOR)) { |
| 905 return DeltaResult.KEEP_CONTINUE; | 906 return DeltaResult.KEEP_CONTINUE; |
| 906 } | 907 } |
| 907 // invalidate all the other results | 908 // invalidate all the other results |
| 908 return DeltaResult.INVALIDATE_NO_DELTA; | 909 return DeltaResult.INVALIDATE_NO_DELTA; |
| 909 } | 910 } |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 void _shiftEntryErrors() { | 1215 void _shiftEntryErrors() { |
| 1215 if (oldEntry != null) { | 1216 if (oldEntry != null) { |
| 1216 _shiftEntryErrors_OLD(); | 1217 _shiftEntryErrors_OLD(); |
| 1217 } else { | 1218 } else { |
| 1218 _shiftEntryErrors_NEW(); | 1219 _shiftEntryErrors_NEW(); |
| 1219 } | 1220 } |
| 1220 } | 1221 } |
| 1221 | 1222 |
| 1222 void _shiftEntryErrors_NEW() { | 1223 void _shiftEntryErrors_NEW() { |
| 1223 _shiftErrors_NEW(HINTS); | 1224 _shiftErrors_NEW(HINTS); |
| 1224 _shiftErrors_NEW(INFER_STATIC_VARIABLE_TYPES_ERRORS); | |
| 1225 _shiftErrors_NEW(LIBRARY_UNIT_ERRORS); | 1225 _shiftErrors_NEW(LIBRARY_UNIT_ERRORS); |
| 1226 _shiftErrors_NEW(PARTIALLY_RESOLVE_REFERENCES_ERRORS); | 1226 _shiftErrors_NEW(RESOLVE_UNIT_ERRORS); |
| 1227 _shiftErrors_NEW(RESOLVE_FUNCTION_BODIES_ERRORS); | |
| 1228 _shiftErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS); | 1227 _shiftErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS); |
| 1229 _shiftErrors_NEW(VARIABLE_REFERENCE_ERRORS); | 1228 _shiftErrors_NEW(VARIABLE_REFERENCE_ERRORS); |
| 1230 _shiftErrors_NEW(VERIFY_ERRORS); | 1229 _shiftErrors_NEW(VERIFY_ERRORS); |
| 1231 } | 1230 } |
| 1232 | 1231 |
| 1233 void _shiftEntryErrors_OLD() { | 1232 void _shiftEntryErrors_OLD() { |
| 1234 _shiftErrors_OLD(DartEntry.RESOLUTION_ERRORS); | 1233 _shiftErrors_OLD(DartEntry.RESOLUTION_ERRORS); |
| 1235 _shiftErrors_OLD(DartEntry.VERIFICATION_ERRORS); | 1234 _shiftErrors_OLD(DartEntry.VERIFICATION_ERRORS); |
| 1236 _shiftErrors_OLD(DartEntry.HINTS); | 1235 _shiftErrors_OLD(DartEntry.HINTS); |
| 1237 _shiftErrors_OLD(DartEntry.LINTS); | 1236 _shiftErrors_OLD(DartEntry.LINTS); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 | 1284 |
| 1286 void _updateEntry() { | 1285 void _updateEntry() { |
| 1287 if (oldEntry != null) { | 1286 if (oldEntry != null) { |
| 1288 _updateEntry_OLD(); | 1287 _updateEntry_OLD(); |
| 1289 } else { | 1288 } else { |
| 1290 _updateEntry_NEW(); | 1289 _updateEntry_NEW(); |
| 1291 } | 1290 } |
| 1292 } | 1291 } |
| 1293 | 1292 |
| 1294 void _updateEntry_NEW() { | 1293 void _updateEntry_NEW() { |
| 1295 _updateErrors_NEW(INFER_STATIC_VARIABLE_TYPES_ERRORS, _resolveErrors); | 1294 _updateErrors_NEW(RESOLVE_UNIT_ERRORS, _resolveErrors); |
| 1296 _updateErrors_NEW(PARTIALLY_RESOLVE_REFERENCES_ERRORS, _resolveErrors); | |
| 1297 _updateErrors_NEW(RESOLVE_FUNCTION_BODIES_ERRORS, _resolveErrors); | |
| 1298 _updateErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS, []); | 1295 _updateErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS, []); |
| 1299 _updateErrors_NEW(VARIABLE_REFERENCE_ERRORS, []); | 1296 _updateErrors_NEW(VARIABLE_REFERENCE_ERRORS, []); |
| 1300 _updateErrors_NEW(VERIFY_ERRORS, _verifyErrors); | 1297 _updateErrors_NEW(VERIFY_ERRORS, _verifyErrors); |
| 1301 // invalidate results we don't update incrementally | 1298 // invalidate results we don't update incrementally |
| 1302 newUnitEntry.setState(USED_IMPORTED_ELEMENTS, CacheState.INVALID); | 1299 newUnitEntry.setState(USED_IMPORTED_ELEMENTS, CacheState.INVALID); |
| 1303 newUnitEntry.setState(USED_LOCAL_ELEMENTS, CacheState.INVALID); | 1300 newUnitEntry.setState(USED_LOCAL_ELEMENTS, CacheState.INVALID); |
| 1304 newUnitEntry.setState(HINTS, CacheState.INVALID); | 1301 newUnitEntry.setState(HINTS, CacheState.INVALID); |
| 1305 } | 1302 } |
| 1306 | 1303 |
| 1307 void _updateEntry_OLD() { | 1304 void _updateEntry_OLD() { |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2123 @override | 2120 @override |
| 2124 String toString() => name; | 2121 String toString() => name; |
| 2125 } | 2122 } |
| 2126 | 2123 |
| 2127 class _TokenPair { | 2124 class _TokenPair { |
| 2128 final _TokenDifferenceKind kind; | 2125 final _TokenDifferenceKind kind; |
| 2129 final Token oldToken; | 2126 final Token oldToken; |
| 2130 final Token newToken; | 2127 final Token newToken; |
| 2131 _TokenPair(this.kind, this.oldToken, this.newToken); | 2128 _TokenPair(this.kind, this.oldToken, this.newToken); |
| 2132 } | 2129 } |
| OLD | NEW |