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

Unified Diff: pkg/analyzer/lib/src/context/cache.dart

Issue 2266403008: Fix couple problems with in-body incremental resolution. (Closed)
Patch Set: Actual changes. Created 4 years, 4 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
*/
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698