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

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

Issue 1331223003: Keep known valid Dart results and invalidate all the other results during incremental resolution. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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.cache; 5 library analyzer.src.context.cache;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/generated/engine.dart' 10 import 'package:analyzer/src/generated/engine.dart'
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 if (deltaResult == DeltaResult.KEEP_CONTINUE) { 534 if (deltaResult == DeltaResult.KEEP_CONTINUE) {
535 thisData = _resultMap[descriptor]; 535 thisData = _resultMap[descriptor];
536 } 536 }
537 if (thisData == null) { 537 if (thisData == null) {
538 return; 538 return;
539 } 539 }
540 // Stop depending on other results. 540 // Stop depending on other results.
541 TargetedResult thisResult = new TargetedResult(target, descriptor); 541 TargetedResult thisResult = new TargetedResult(target, descriptor);
542 for (TargetedResult dependedOnResult in thisData.dependedOnResults) { 542 for (TargetedResult dependedOnResult in thisData.dependedOnResults) {
543 ResultData data = _partition._getDataFor(dependedOnResult); 543 ResultData data = _partition._getDataFor(dependedOnResult);
544 if (data != null) { 544 if (data != null && deltaResult != DeltaResult.KEEP_CONTINUE) {
545 data.dependentResults.remove(thisResult); 545 data.dependentResults.remove(thisResult);
546 } 546 }
547 } 547 }
548 // Invalidate results that depend on this result. 548 // Invalidate results that depend on this result.
549 List<TargetedResult> dependentResults = thisData.dependentResults.toList(); 549 List<TargetedResult> dependentResults = thisData.dependentResults.toList();
550 for (TargetedResult dependentResult in dependentResults) { 550 for (TargetedResult dependentResult in dependentResults) {
551 CacheEntry entry = _partition.get(dependentResult.target); 551 CacheEntry entry = _partition.get(dependentResult.target);
552 if (entry != null) { 552 if (entry != null) {
553 entry._invalidate(dependentResult.result, delta); 553 entry._invalidate(dependentResult.result, delta);
554 } 554 }
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 void resultAccessed(TargetedResult result) {} 1144 void resultAccessed(TargetedResult result) {}
1145 1145
1146 @override 1146 @override
1147 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { 1147 List<TargetedResult> resultStored(TargetedResult newResult, newValue) {
1148 return TargetedResult.EMPTY_LIST; 1148 return TargetedResult.EMPTY_LIST;
1149 } 1149 }
1150 1150
1151 @override 1151 @override
1152 void targetRemoved(AnalysisTarget target) {} 1152 void targetRemoved(AnalysisTarget target) {}
1153 } 1153 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698