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

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 1053673008: Initial re-write of analysis context for the new task model (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
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 4cd2f615d422aee0f4ea59e6192d04b6f26f706f..faa809a4545eba8ed3d5bf70592d646247f44968 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -12,10 +12,14 @@ import 'dart:async';
import 'dart:collection';
import 'package:analyzer/src/cancelable_future.dart';
+import 'package:analyzer/src/context/cache.dart' as cache;
+import 'package:analyzer/src/context/context.dart' as cache;
kevmoo 2015/04/20 16:27:28 Two imports both 'as cache'
Brian Wilkerson 2015/04/20 16:29:52 You're right. That was a copy/paste error. I'll cl
import 'package:analyzer/src/generated/incremental_resolution_validator.dart';
import 'package:analyzer/src/plugin/engine_plugin.dart';
import 'package:analyzer/src/services/lint.dart';
+import 'package:analyzer/src/task/manager.dart';
import 'package:analyzer/src/task/task_dart.dart';
+import 'package:analyzer/task/model.dart';
import '../../instrumentation/instrumentation.dart';
import 'ast.dart';
@@ -1132,6 +1136,18 @@ class AnalysisContextImpl implements InternalAnalysisContext {
DeclaredVariables get declaredVariables => _declaredVariables;
@override
+ List<AnalysisTarget> get explicitTargets {
+ List<AnalysisTarget> targets = <AnalysisTarget>[];
+ MapIterator<Source, SourceEntry> iterator = _cache.iterator();
+ while (iterator.moveNext()) {
+ if (iterator.value.explicitlyAdded) {
+ targets.add(iterator.key);
+ }
+ }
+ return targets;
+ }
+
+ @override
List<Source> get htmlSources => _getSources(SourceKind.HTML);
@override
@@ -1329,6 +1345,9 @@ class AnalysisContextImpl implements InternalAnalysisContext {
List<Source> get prioritySources => _priorityOrder;
@override
+ List<AnalysisTarget> get priorityTargets => prioritySources;
+
+ @override
List<Source> get refactoringUnsafeSources {
List<Source> sources = new List<Source>();
MapIterator<Source, SourceEntry> iterator = _cache.iterator();
@@ -1826,6 +1845,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
+ cache.CacheEntry getCacheEntry(AnalysisTarget target) {
+ return null;
+ }
+
+ @override
CompilationUnitElement getCompilationUnitElement(
Source unitSource, Source librarySource) {
LibraryElement libraryElement = getLibraryElement(librarySource);
@@ -5739,6 +5763,34 @@ class AnalysisEngine {
*/
final PartitionManager partitionManager = new PartitionManager();
+ /**
+ * The partition manager being used to manage the shared partitions.
+ */
+ final cache.PartitionManager partitionManager_new =
+ new cache.PartitionManager();
+
+ /**
+ * A flag indicating whether the (new) task model should be used to perform
+ * analysis.
+ */
+ bool useTaskModel = false;
+
+ /**
+ * The task manager used to manage the tasks used to analyze code.
+ */
+ TaskManager _taskManager;
+
+ /**
+ * A flag indicating whether union types should be used.
+ */
+ bool enableUnionTypes = false;
scheglov 2015/04/20 03:44:50 IIRC Paul removed union types support some a week
Brian Wilkerson 2015/04/20 15:00:36 Yes. That resulted from a merge issue. I've re-rem
+
+ /**
+ * A flag indicating whether union types should have strict semantics. This
+ * option has no effect when `enabledUnionTypes` is `false`.
+ */
+ bool strictUnionTypes = false;
+
AnalysisEngine._();
/**
@@ -5774,6 +5826,17 @@ class AnalysisEngine {
}
/**
+ * Return the task manager used to manage the tasks used to analyze code.
+ */
+ TaskManager get taskManager {
+ if (_taskManager == null) {
+ _taskManager = new TaskManager();
+ _taskManager.addTaskDescriptors(enginePlugin.taskDescriptors());
+ }
+ return _taskManager;
+ }
+
+ /**
* Clear any caches holding on to analysis results so that a full re-analysis
* will be performed the next time an analysis context is created.
*/
@@ -7172,7 +7235,7 @@ class CycleBuilder_LibraryPair {
/**
* A pair containing a source and the cache entry associated with that source.
* They are used to reduce the number of times an entry must be looked up in the
- * [cache].
+ * cache.
*/
class CycleBuilder_SourceEntryPair {
/**
@@ -9010,12 +9073,27 @@ abstract class InternalAnalysisContext implements AnalysisContext {
set contentCache(ContentCache value);
/**
+ * Return a list of the explicit targets being analyzed by this context.
+ */
+ List<AnalysisTarget> get explicitTargets;
+
+ /**
+ * A factory to override how [LibraryResolver] is created.
+ */
+ LibraryResolverFactory get libraryResolverFactory;
+
+ /**
* Return a list containing all of the sources that have been marked as
* priority sources. Clients must not modify the returned list.
*/
List<Source> get prioritySources;
/**
+ * Return a list of the priority targets being analyzed by this context.
+ */
+ List<AnalysisTarget> get priorityTargets;
+
+ /**
* A factory to override how [ResolverVisitor] is created.
*/
ResolverVisitorFactory get resolverVisitorFactory;
@@ -9036,11 +9114,6 @@ abstract class InternalAnalysisContext implements AnalysisContext {
TypeResolverVisitorFactory get typeResolverVisitorFactory;
/**
- * A factory to override how [LibraryResolver] is created.
- */
- LibraryResolverFactory get libraryResolverFactory;
-
- /**
* Add the given [source] with the given [information] to this context.
*/
void addSourceInfo(Source source, SourceEntry information);
@@ -9086,6 +9159,11 @@ abstract class InternalAnalysisContext implements AnalysisContext {
List<CompilationUnit> ensureResolvedDartUnits(Source source);
/**
+ * Return the cache entry associated with the given [target].
+ */
+ cache.CacheEntry getCacheEntry(AnalysisTarget target);
+
+ /**
* Return context that owns the given [source].
*/
InternalAnalysisContext getContextFor(Source source);

Powered by Google App Engine
This is Rietveld 408576698