Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1386023002: Resolve ordering issues. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 setValue(SCAN_ERRORS, AnalysisError.NO_ERRORS); 1132 setValue(SCAN_ERRORS, AnalysisError.NO_ERRORS);
1133 setValue(SOURCE_KIND, SourceKind.LIBRARY); 1133 setValue(SOURCE_KIND, SourceKind.LIBRARY);
1134 entry.setState(TOKEN_STREAM, CacheState.FLUSHED); 1134 entry.setState(TOKEN_STREAM, CacheState.FLUSHED);
1135 setValue(UNITS, <Source>[librarySource]); 1135 setValue(UNITS, <Source>[librarySource]);
1136 1136
1137 LibrarySpecificUnit unit = 1137 LibrarySpecificUnit unit =
1138 new LibrarySpecificUnit(librarySource, librarySource); 1138 new LibrarySpecificUnit(librarySource, librarySource);
1139 entry = getCacheEntry(unit); 1139 entry = getCacheEntry(unit);
1140 setValue(HINTS, AnalysisError.NO_ERRORS); 1140 setValue(HINTS, AnalysisError.NO_ERRORS);
1141 // dartEntry.setValue(LINTS, AnalysisError.NO_ERRORS); 1141 // dartEntry.setValue(LINTS, AnalysisError.NO_ERRORS);
1142 setValue(INFER_STATIC_VARIABLE_TYPES_ERRORS, AnalysisError.NO_ERRORS);
1143 setValue(LIBRARY_UNIT_ERRORS, AnalysisError.NO_ERRORS); 1142 setValue(LIBRARY_UNIT_ERRORS, AnalysisError.NO_ERRORS);
1144 setValue(PARTIALLY_RESOLVE_REFERENCES_ERRORS, AnalysisError.NO_ERRORS); 1143 setValue(RESOLVE_UNIT_ERRORS, AnalysisError.NO_ERRORS);
1145 setValue(RESOLVE_FUNCTION_BODIES_ERRORS, AnalysisError.NO_ERRORS);
1146 setValue(RESOLVE_TYPE_NAMES_ERRORS, AnalysisError.NO_ERRORS); 1144 setValue(RESOLVE_TYPE_NAMES_ERRORS, AnalysisError.NO_ERRORS);
1147 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); 1145 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
1148 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); 1146 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED);
1149 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); 1147 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED);
1150 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); 1148 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED);
1151 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); 1149 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED);
1152 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); 1150 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED);
1153 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); 1151 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED);
1154 entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED); 1152 entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED);
1155 entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED); 1153 entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED);
1154 entry.setState(RESOLVED_UNIT9, CacheState.FLUSHED);
1156 // USED_IMPORTED_ELEMENTS 1155 // USED_IMPORTED_ELEMENTS
1157 // USED_LOCAL_ELEMENTS 1156 // USED_LOCAL_ELEMENTS
1158 setValue(VARIABLE_REFERENCE_ERRORS, AnalysisError.NO_ERRORS); 1157 setValue(VARIABLE_REFERENCE_ERRORS, AnalysisError.NO_ERRORS);
1159 setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS); 1158 setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS);
1160 }); 1159 });
1161 1160
1162 CacheEntry entry = getCacheEntry(AnalysisContextTarget.request); 1161 CacheEntry entry = getCacheEntry(AnalysisContextTarget.request);
1163 entry.setValue(TYPE_PROVIDER, typeProvider, TargetedResult.EMPTY_LIST); 1162 entry.setValue(TYPE_PROVIDER, typeProvider, TargetedResult.EMPTY_LIST);
1164 } 1163 }
1165 1164
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 @override 1220 @override
1222 void test_flushAstStructures(Source source) { 1221 void test_flushAstStructures(Source source) {
1223 CacheEntry entry = getCacheEntry(source); 1222 CacheEntry entry = getCacheEntry(source);
1224 entry.setState(PARSED_UNIT, CacheState.FLUSHED); 1223 entry.setState(PARSED_UNIT, CacheState.FLUSHED);
1225 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); 1224 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED);
1226 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); 1225 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED);
1227 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); 1226 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED);
1228 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); 1227 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED);
1229 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); 1228 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED);
1230 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); 1229 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED);
1231 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); 1230 entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED);
Leaf 2015/10/06 00:14:58 I think this was a bug?
Brian Wilkerson 2015/10/06 19:04:46 Yes, i'm sure it was a bug.
1232 entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED); 1231 entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED);
1232 entry.setState(RESOLVED_UNIT9, CacheState.FLUSHED);
1233 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); 1233 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
1234 } 1234 }
1235 1235
1236 @override 1236 @override
1237 bool validateCacheConsistency() { 1237 bool validateCacheConsistency() {
1238 int consistencyCheckStart = JavaSystem.nanoTime(); 1238 int consistencyCheckStart = JavaSystem.nanoTime();
1239 HashSet<Source> changedSources = new HashSet<Source>(); 1239 HashSet<Source> changedSources = new HashSet<Source>();
1240 HashSet<Source> missingSources = new HashSet<Source>(); 1240 HashSet<Source> missingSources = new HashSet<Source>();
1241 for (Source source in _cache.sources) { 1241 for (Source source in _cache.sources) {
1242 CacheEntry entry = _cache.get(source); 1242 CacheEntry entry = _cache.get(source);
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 new PendingFuture<T>(_context, target, computeValue); 2088 new PendingFuture<T>(_context, target, computeValue);
2089 if (!pendingFuture.evaluate(entry)) { 2089 if (!pendingFuture.evaluate(entry)) {
2090 _context._pendingFutureTargets 2090 _context._pendingFutureTargets
2091 .putIfAbsent(target, () => <PendingFuture>[]) 2091 .putIfAbsent(target, () => <PendingFuture>[])
2092 .add(pendingFuture); 2092 .add(pendingFuture);
2093 scheduleComputation(); 2093 scheduleComputation();
2094 } 2094 }
2095 return pendingFuture.future; 2095 return pendingFuture.future;
2096 } 2096 }
2097 } 2097 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698