OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.task.driver; | 5 library analyzer.src.task.driver; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analyzer/src/context/cache.dart'; | 10 import 'package:analyzer/src/context/cache.dart'; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 // Otherwise, perform the task. | 273 // Otherwise, perform the task. |
274 AnalysisTask task = item.buildTask(); | 274 AnalysisTask task = item.buildTask(); |
275 _onTaskStartedController.add(task); | 275 _onTaskStartedController.add(task); |
276 task.perform(); | 276 task.perform(); |
277 analysisDriverProcessOutputs.makeCurrentWhile(() { | 277 analysisDriverProcessOutputs.makeCurrentWhile(() { |
278 AnalysisTarget target = task.target; | 278 AnalysisTarget target = task.target; |
279 CacheEntry entry = context.getCacheEntry(target); | 279 CacheEntry entry = context.getCacheEntry(target); |
280 if (task.caughtException == null) { | 280 if (task.caughtException == null) { |
281 List<TargetedResult> dependedOn = item.inputTargetedResults.toList(); | 281 List<TargetedResult> dependedOn = item.inputTargetedResults.toList(); |
282 Map<ResultDescriptor, dynamic> outputs = task.outputs; | 282 Map<ResultDescriptor, dynamic> outputs = task.outputs; |
283 for (ResultDescriptor result in task.descriptor.results) { | 283 List<ResultDescriptor> results = task.descriptor.results; |
| 284 int resultLength = results.length; |
| 285 for (int i = 0; i < resultLength; i++) { |
| 286 ResultDescriptor result = results[i]; |
284 // TODO(brianwilkerson) We could check here that a value was produced | 287 // TODO(brianwilkerson) We could check here that a value was produced |
285 // and throw an exception if not (unless we want to allow null values)
. | 288 // and throw an exception if not (unless we want to allow null values)
. |
286 entry.setValue(result, outputs[result], dependedOn); | 289 entry.setValue(result, outputs[result], dependedOn); |
287 } | 290 } |
288 outputs.forEach((ResultDescriptor descriptor, value) { | 291 outputs.forEach((ResultDescriptor descriptor, value) { |
289 StreamController<ResultChangedEvent> controller = | 292 StreamController<ResultChangedEvent> controller = |
290 resultComputedControllers[descriptor]; | 293 resultComputedControllers[descriptor]; |
291 if (controller != null) { | 294 if (controller != null) { |
292 ResultChangedEvent event = new ResultChangedEvent( | 295 ResultChangedEvent event = new ResultChangedEvent( |
293 context, target, descriptor, value, true); | 296 context, target, descriptor, value, true); |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 final TaskManager taskManager; | 862 final TaskManager taskManager; |
860 | 863 |
861 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) | 864 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) |
862 : super(startingNode); | 865 : super(startingNode); |
863 | 866 |
864 @override | 867 @override |
865 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { | 868 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { |
866 return node.gatherInputs(taskManager, skipInputs); | 869 return node.gatherInputs(taskManager, skipInputs); |
867 } | 870 } |
868 } | 871 } |
OLD | NEW |