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

Unified Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 1355853005: Limit cache invalidation by the updated source bounds. (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 side-by-side diff with in-line comments
Download patch
« pkg/analyzer/lib/plugin/task.dart ('K') | « pkg/analyzer/lib/plugin/task.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index 74ad8219e05b2683352202b8690fbf19b21891e3..f1090176365999b6d42309b086033ffb9db849e5 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -8,7 +8,7 @@ import 'dart:collection';
import 'dart:math' as math;
import 'package:analyzer/src/context/cache.dart'
- show CacheEntry, Delta, DeltaResult, TargetedResult;
+ show CacheEntry, Delta, DeltaResult;
import 'package:analyzer/src/generated/constant.dart';
import 'package:analyzer/src/task/dart.dart';
import 'package:analyzer/task/dart.dart';
@@ -857,6 +857,12 @@ class IncrementalBodyDelta extends Delta {
@override
DeltaResult validate(InternalAnalysisContext context, AnalysisTarget target,
ResultDescriptor descriptor) {
+ // A body change delta should never leak outside its source.
+ // It can cause invalidation of results (e.g. hints) in other sources,
+ // but only when a result in the updated source is INVALIDATE_NO_DELTA.
+ if (target.source != source) {
+ return DeltaResult.STOP;
+ }
// don't invalidate results of standard Dart tasks
bool isByTask(TaskDescriptor taskDescriptor) {
return taskDescriptor.results.contains(descriptor);
« pkg/analyzer/lib/plugin/task.dart ('K') | « pkg/analyzer/lib/plugin/task.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698