Index: pkg/analyzer/lib/src/context/cache.dart |
diff --git a/pkg/analyzer/lib/src/context/cache.dart b/pkg/analyzer/lib/src/context/cache.dart |
index 36df855dde96e00fc4a7ca02700db0e153df2ea9..ae7961546a45a8f433ac8b2bf88b5b653f4f30fa 100644 |
--- a/pkg/analyzer/lib/src/context/cache.dart |
+++ b/pkg/analyzer/lib/src/context/cache.dart |
@@ -286,6 +286,13 @@ class CacheEntry { |
static int nextInvalidateId = 0; |
/** |
+ * A table containing the number of times the value of a result descriptor was |
+ * recomputed after having been flushed. |
+ */ |
+ static final Map<ResultDescriptor, int> recomputedCounts = |
+ new HashMap<ResultDescriptor, int>(); |
+ |
+ /** |
* The target this entry is about. |
*/ |
final AnalysisTarget target; |
@@ -530,6 +537,10 @@ class CacheEntry { |
} |
ResultData data = getResultData(descriptor); |
_setDependedOnResults(data, thisResult, dependedOn); |
+ if (data.state == CacheState.FLUSHED) { |
+ int count = recomputedCounts[descriptor] ?? 0; |
+ recomputedCounts[descriptor] = count + 1; |
+ } |
data.state = CacheState.VALID; |
data.value = value ?? descriptor.defaultValue; |
} |