| 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 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 void recordLibraryElements(Map<Source, LibraryElement> elementMap) { | 1069 void recordLibraryElements(Map<Source, LibraryElement> elementMap) { |
| 1070 elementMap.forEach((Source librarySource, LibraryElement library) { | 1070 elementMap.forEach((Source librarySource, LibraryElement library) { |
| 1071 // | 1071 // |
| 1072 // Cache the element in the library's info. | 1072 // Cache the element in the library's info. |
| 1073 // | 1073 // |
| 1074 CacheEntry entry = getCacheEntry(librarySource); | 1074 CacheEntry entry = getCacheEntry(librarySource); |
| 1075 setValue(ResultDescriptor result, value) { | 1075 setValue(ResultDescriptor result, value) { |
| 1076 entry.setValue(result, value, TargetedResult.EMPTY_LIST); | 1076 entry.setValue(result, value, TargetedResult.EMPTY_LIST); |
| 1077 } | 1077 } |
| 1078 setValue(BUILD_DIRECTIVES_ERRORS, AnalysisError.NO_ERRORS); | 1078 setValue(BUILD_DIRECTIVES_ERRORS, AnalysisError.NO_ERRORS); |
| 1079 setValue(BUILD_FUNCTION_TYPE_ALIASES_ERRORS, AnalysisError.NO_ERRORS); | |
| 1080 setValue(BUILD_LIBRARY_ERRORS, AnalysisError.NO_ERRORS); | 1079 setValue(BUILD_LIBRARY_ERRORS, AnalysisError.NO_ERRORS); |
| 1081 // CLASS_ELEMENTS | 1080 // CLASS_ELEMENTS |
| 1082 setValue(COMPILATION_UNIT_ELEMENT, library.definingCompilationUnit); | 1081 setValue(COMPILATION_UNIT_ELEMENT, library.definingCompilationUnit); |
| 1083 // CONSTRUCTORS | 1082 // CONSTRUCTORS |
| 1084 // CONSTRUCTORS_ERRORS | 1083 // CONSTRUCTORS_ERRORS |
| 1085 entry.setState(CONTENT, CacheState.FLUSHED); | 1084 entry.setState(CONTENT, CacheState.FLUSHED); |
| 1086 setValue(EXPORTED_LIBRARIES, Source.EMPTY_LIST); | 1085 setValue(EXPORTED_LIBRARIES, Source.EMPTY_LIST); |
| 1087 // EXPORT_SOURCE_CLOSURE | 1086 // EXPORT_SOURCE_CLOSURE |
| 1088 setValue(IMPORTED_LIBRARIES, Source.EMPTY_LIST); | 1087 setValue(IMPORTED_LIBRARIES, Source.EMPTY_LIST); |
| 1089 // IMPORT_SOURCE_CLOSURE | 1088 // IMPORT_SOURCE_CLOSURE |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1108 | 1107 |
| 1109 LibrarySpecificUnit unit = | 1108 LibrarySpecificUnit unit = |
| 1110 new LibrarySpecificUnit(librarySource, librarySource); | 1109 new LibrarySpecificUnit(librarySource, librarySource); |
| 1111 entry = getCacheEntry(unit); | 1110 entry = getCacheEntry(unit); |
| 1112 setValue(HINTS, AnalysisError.NO_ERRORS); | 1111 setValue(HINTS, AnalysisError.NO_ERRORS); |
| 1113 // dartEntry.setValue(LINTS, AnalysisError.NO_ERRORS); | 1112 // dartEntry.setValue(LINTS, AnalysisError.NO_ERRORS); |
| 1114 entry.setState(RESOLVE_REFERENCES_ERRORS, CacheState.FLUSHED); | 1113 entry.setState(RESOLVE_REFERENCES_ERRORS, CacheState.FLUSHED); |
| 1115 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); | 1114 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); |
| 1116 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); | 1115 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); |
| 1117 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); | 1116 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); |
| 1118 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); | |
| 1119 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); | 1117 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); |
| 1120 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); | 1118 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); |
| 1121 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); | 1119 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); |
| 1122 // USED_IMPORTED_ELEMENTS | 1120 // USED_IMPORTED_ELEMENTS |
| 1123 // USED_LOCAL_ELEMENTS | 1121 // USED_LOCAL_ELEMENTS |
| 1124 setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS); | 1122 setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS); |
| 1125 }); | 1123 }); |
| 1126 | 1124 |
| 1127 CacheEntry entry = getCacheEntry(AnalysisContextTarget.request); | 1125 CacheEntry entry = getCacheEntry(AnalysisContextTarget.request); |
| 1128 entry.setValue(TYPE_PROVIDER, typeProvider, TargetedResult.EMPTY_LIST); | 1126 entry.setValue(TYPE_PROVIDER, typeProvider, TargetedResult.EMPTY_LIST); |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2005 new PendingFuture<T>(_context, target, computeValue); | 2003 new PendingFuture<T>(_context, target, computeValue); |
| 2006 if (!pendingFuture.evaluate(entry)) { | 2004 if (!pendingFuture.evaluate(entry)) { |
| 2007 _context._pendingFutureTargets | 2005 _context._pendingFutureTargets |
| 2008 .putIfAbsent(target, () => <PendingFuture>[]) | 2006 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2009 .add(pendingFuture); | 2007 .add(pendingFuture); |
| 2010 scheduleComputation(); | 2008 scheduleComputation(); |
| 2011 } | 2009 } |
| 2012 return pendingFuture.future; | 2010 return pendingFuture.future; |
| 2013 } | 2011 } |
| 2014 } | 2012 } |
| OLD | NEW |