| Index: pkg/analyzer/lib/src/generated/engine.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
|
| index 5c48c322f49cf75d71ec8ff3e472b5b532042be4..13ea09d8940712687a38a1ecdf84567958dfd261 100644
|
| --- a/pkg/analyzer/lib/src/generated/engine.dart
|
| +++ b/pkg/analyzer/lib/src/generated/engine.dart
|
| @@ -10939,10 +10939,7 @@ class ResolutionState {
|
| void setValue(DataDescriptor /*<V>*/ descriptor, dynamic /*V*/ value) {
|
| CachedResult result =
|
| resultMap.putIfAbsent(descriptor, () => new CachedResult(descriptor));
|
| - if (result.state == CacheState.FLUSHED) {
|
| - int count = SourceEntry.unflushedCountMap[descriptor];
|
| - SourceEntry.unflushedCountMap[descriptor] = count == null ? 1 : count + 1;
|
| - }
|
| + SourceEntry.countTransition(descriptor, result);
|
| result.state = CacheState.VALID;
|
| result.value = value == null ? descriptor.defaultValue : value;
|
| }
|
| @@ -11625,10 +11622,10 @@ abstract class SourceEntry {
|
|
|
| /**
|
| * A table mapping data descriptors to a count of the number of times a value
|
| - * of that kind was flushed and then re-created.
|
| + * was set when in a given state.
|
| */
|
| - static final Map<DataDescriptor, int> unflushedCountMap =
|
| - new HashMap<DataDescriptor, int>();
|
| + static final Map<DataDescriptor, Map<CacheState, int>> transitionMap =
|
| + new HashMap<DataDescriptor, Map<CacheState, int>>();
|
|
|
| /**
|
| * The most recent time at which the state of the source matched the state
|
| @@ -11820,14 +11817,23 @@ abstract class SourceEntry {
|
| _validateStateChange(descriptor, CacheState.VALID);
|
| CachedResult result =
|
| resultMap.putIfAbsent(descriptor, () => new CachedResult(descriptor));
|
| - if (result.state == CacheState.FLUSHED) {
|
| - int count = unflushedCountMap[descriptor];
|
| - unflushedCountMap[descriptor] = count == null ? 1 : count + 1;
|
| - }
|
| + countTransition(descriptor, result);
|
| result.state = CacheState.VALID;
|
| result.value = value == null ? descriptor.defaultValue : value;
|
| }
|
|
|
| + /**
|
| + * Increment the count of the number of times that data represented by the
|
| + * given [descriptor] was transitioned from the current state (as found in the
|
| + * given [result] to a valid state.
|
| + */
|
| + static void countTransition(DataDescriptor descriptor, CachedResult result) {
|
| + Map<CacheState, int> countMap =
|
| + transitionMap.putIfAbsent(descriptor, () => new HashMap<CacheState, int>());
|
| + int count = countMap[result.state];
|
| + countMap[result.state] = count == null ? 1 : count + 1;
|
| + }
|
| +
|
| @override
|
| String toString() {
|
| StringBuffer buffer = new StringBuffer();
|
|
|