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

Unified Diff: pkg/analyzer/lib/src/task/inputs.dart

Issue 1383043002: Stop defensively copying AST structures before resolution (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « pkg/analyzer/lib/src/task/driver.dart ('k') | pkg/analyzer/lib/src/task/model.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/inputs.dart
diff --git a/pkg/analyzer/lib/src/task/inputs.dart b/pkg/analyzer/lib/src/task/inputs.dart
index 3de18e870bf0f015619852d127e5d5a8f69b30d9..468f3139f7eabba5232cca35971220a9e9ec4e20 100644
--- a/pkg/analyzer/lib/src/task/inputs.dart
+++ b/pkg/analyzer/lib/src/task/inputs.dart
@@ -55,6 +55,9 @@ class ConstantTaskInputBuilder<V> implements TaskInputBuilder<V> {
}
@override
+ bool get flushOnAccess => false;
+
+ @override
V get inputValue => input.value;
@override
@@ -78,7 +81,7 @@ class ListTaskInputImpl<E> extends SimpleTaskInput<List<E>>
* the given [result] associated with the given [target].
*/
ListTaskInputImpl(AnalysisTarget target, ResultDescriptor<List<E>> result)
- : super(target, result);
+ : super._unflushable(target, result);
}
/**
@@ -289,6 +292,9 @@ class MapToFlattenListTaskInputBuilder<K, V, E>
}
@override
+ bool get flushOnAccess => currentBuilder.flushOnAccess;
+
+ @override
void currentValueNotAvailable() {
if (currentBuilder == null) {
throw new StateError(
@@ -440,6 +446,9 @@ class ObjectToListTaskInputBuilder<E> implements TaskInputBuilder<List<E>> {
}
@override
+ bool get flushOnAccess => builder.flushOnAccess;
+
+ @override
List<E> get inputValue {
if (builder != null) {
throw new StateError('Result value has not been created');
@@ -491,10 +500,23 @@ class SimpleTaskInput<V> extends TaskInputImpl<V> {
final ResultDescriptor<V> result;
/**
+ * Return `true` if the value accessed by this input builder should be flushed
+ * from the cache at the time it is retrieved.
+ */
+ final bool flushOnAccess;
+
+ /**
+ * Initialize a newly created task input that computes the input by accessing
+ * the given [result] associated with the given [target].
+ */
+ SimpleTaskInput(this.target, this.result, {this.flushOnAccess: false});
+
+ /**
* Initialize a newly created task input that computes the input by accessing
* the given [result] associated with the given [target].
*/
- SimpleTaskInput(this.target, this.result);
+ SimpleTaskInput._unflushable(this.target, this.result)
+ : flushOnAccess = false;
@override
TaskInputBuilder<V> createBuilder() => new SimpleTaskInputBuilder<V>(this);
@@ -566,6 +588,9 @@ class SimpleTaskInputBuilder<V> implements TaskInputBuilder<V> {
}
@override
+ bool get flushOnAccess => input.flushOnAccess;
+
+ @override
V get inputValue {
if (_state != _AFTER) {
throw new StateError('Result value has not been created');
@@ -674,6 +699,9 @@ class TopLevelTaskInputBuilder
}
@override
+ bool get flushOnAccess => currentBuilder.flushOnAccess;
+
+ @override
Map<String, Object> get inputValue {
if (nameIndex < inputNames.length) {
throw new StateError('Result value has not been created');
@@ -827,6 +855,9 @@ abstract class _ListToCollectionTaskInputBuilder<B, E, C>
}
@override
+ bool get flushOnAccess => currentBuilder.flushOnAccess;
+
+ @override
C get inputValue {
if (currentBuilder != null || _resultValue == null) {
throw new StateError('Result value has not been created');
« no previous file with comments | « pkg/analyzer/lib/src/task/driver.dart ('k') | pkg/analyzer/lib/src/task/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698