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

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

Issue 1902403005: Don't use AnalysisContext.exists() in VerifyUnitTask. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Regenerate task data. Created 4 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
« no previous file with comments | « pkg/analyzer/doc/tasks.html ('k') | pkg/analyzer/tool/task_dependency_graph/tasks.dot » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/task/dart.dart
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index fa360f1ac43c3518a04f74793d812bb5b0f22162..3124cd9e9252a035e074d10356158048a659cbd4 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -5313,6 +5313,13 @@ class VerifyUnitTask extends SourceBasedAnalysisTask {
static const String UNIT_INPUT = 'UNIT_INPUT';
/**
+ * The name of the input of a mapping from [REFERENCED_SOURCES] to their
+ * [MODIFICATION_TIME]s.
+ */
+ static const String REFERENCED_SOURCE_MODIFICATION_TIME_MAP_INPUT =
+ 'REFERENCED_SOURCE_MODIFICATION_TIME_MAP_INPUT';
+
+ /**
* The name of the [TYPE_PROVIDER] input.
*/
static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
@@ -5328,6 +5335,12 @@ class VerifyUnitTask extends SourceBasedAnalysisTask {
*/
ErrorReporter errorReporter;
+ /**
+ * The mapping from the current library referenced sources to their
+ * modification times.
+ */
+ Map<Source, int> sourceTimeMap;
+
VerifyUnitTask(InternalAnalysisContext context, AnalysisTarget target)
: super(context, target);
@@ -5344,6 +5357,8 @@ class VerifyUnitTask extends SourceBasedAnalysisTask {
//
TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
CompilationUnit unit = getRequiredInput(UNIT_INPUT);
+ sourceTimeMap =
+ getRequiredInput(REFERENCED_SOURCE_MODIFICATION_TIME_MAP_INPUT);
CompilationUnitElement unitElement = unit.element;
LibraryElement libraryElement = unitElement.library;
if (libraryElement == null) {
@@ -5398,7 +5413,8 @@ class VerifyUnitTask extends SourceBasedAnalysisTask {
void validateReferencedSource(UriBasedDirective directive) {
Source source = directive.source;
if (source != null) {
- if (context.exists(source)) {
+ int modificationTime = sourceTimeMap[source] ?? -1;
+ if (modificationTime >= 0) {
return;
}
} else {
@@ -5422,6 +5438,8 @@ class VerifyUnitTask extends SourceBasedAnalysisTask {
return <String, TaskInput>{
'thisLibraryClosureIsReady': READY_RESOLVED_UNIT.of(unit.library),
UNIT_INPUT: RESOLVED_UNIT.of(unit),
+ REFERENCED_SOURCE_MODIFICATION_TIME_MAP_INPUT:
+ REFERENCED_SOURCES.of(unit.library).toMapOf(MODIFICATION_TIME),
TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
};
}
« no previous file with comments | « pkg/analyzer/doc/tasks.html ('k') | pkg/analyzer/tool/task_dependency_graph/tasks.dot » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698