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

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

Issue 1355503004: Fix for updating HINTS during incremental resolution with TM. (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
« 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 edb223159fe9f81315bb0321ca72cb714be81475..0c625e6ffe581d6548cfb2ed99fee716c42682e7 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -493,11 +493,14 @@ class CacheEntry {
* Set the value of the result represented by the given [descriptor] to the
* given [value], keep its dependency, invalidate all the dependent result.
*/
- void setValueIncremental(ResultDescriptor descriptor, dynamic value) {
+ void setValueIncremental(
+ ResultDescriptor descriptor, dynamic value, bool invalidateDependent) {
ResultData data = getResultData(descriptor);
- _invalidateDependentResults(null, data, null, 0);
data.state = CacheState.VALID;
data.value = value;
+ if (invalidateDependent) {
+ _invalidateDependentResults(null, data, null, 0);
+ }
}
@override
@@ -537,7 +540,12 @@ class CacheEntry {
return;
}
}
- if (deltaResult == null || deltaResult == DeltaResult.INVALIDATE) {
+ if (deltaResult == DeltaResult.INVALIDATE_NO_DELTA) {
+ delta = null;
+ }
+ if (deltaResult == null ||
+ deltaResult == DeltaResult.INVALIDATE ||
+ deltaResult == DeltaResult.INVALIDATE_NO_DELTA) {
_resultMap.remove(descriptor);
// {
// String indent = ' ' * level;
@@ -1035,7 +1043,30 @@ class Delta {
/**
* The possible results of validating analysis results againt a [Delta].
*/
-enum DeltaResult { INVALIDATE, KEEP_CONTINUE, STOP }
+enum DeltaResult {
+ /**
+ * Invalidate this result and continue visiting dependent results
+ * with this [Delta].
+ */
+ INVALIDATE,
+
+ /**
+ * Invalidate this result and stop using this [Delta], so unconditionally
+ * invalidate all the dependent results.
+ */
+ INVALIDATE_NO_DELTA,
+
+ /**
+ * Keep this result and continue validating dependent results
+ * with this [Delta].
+ */
+ KEEP_CONTINUE,
+
+ /**
+ * Keep this result and stop visiting results that depend on this one.
+ */
+ STOP
+}
/**
* [InvalidatedResult] describes an invalidated result.
« 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