Chromium Code Reviews| 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 104d89a55cc4a91b627b141cf6e63e45cb7084c0..a6c054840204131c5f0c78bb5adc3960b4cc3bd9 100644 |
| --- a/pkg/analyzer/lib/src/context/cache.dart |
| +++ b/pkg/analyzer/lib/src/context/cache.dart |
| @@ -617,6 +617,9 @@ class CacheEntry { |
| if (delta == null) { |
| return false; |
| } |
| + if (!delta.gatherRequired()) { |
| + return true; |
| + } |
| for (int i = 0; i < 64; i++) { |
| bool hasVisitChanges = false; |
| _visitResults(nextVisitId++, result, |
| @@ -1255,6 +1258,13 @@ class Delta { |
| Delta(this.source); |
| + /** |
| + * This method is called during a cache walk, so that the delta can gather |
| + * additional changes to which are caused by the changes it already knows |
| + * about. Return `true` if a new change was added, so that one more cache |
| + * walk will be performed (to include changes that depend on results which we |
| + * decided to be changed later in the previous cache walk). |
| + */ |
| bool gatherChanges(InternalAnalysisContext context, AnalysisTarget target, |
| ResultDescriptor descriptor, Object value) { |
| return false; |
| @@ -1266,6 +1276,16 @@ class Delta { |
| void gatherEnd() {} |
| /** |
| + * Return `true` if this delta needs cache walking to gather additional |
| + * changes before it can be used to [validate]. In this case [gatherChanges] |
| + * is invoked for every targeted result in transitive dependencies, and |
| + * [gatherEnd] is invoked after cache walking is done. |
| + */ |
| + bool gatherRequired() { |
|
Brian Wilkerson
2016/08/25 18:57:55
This looks like it ought to be a getter.
|
| + return false; |
| + } |
| + |
| + /** |
| * Check whether this delta affects the result described by the given |
| * [descriptor] and [target]. The current [value] of the result is provided. |
| */ |