Chromium Code Reviews| 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 466 CacheEntry getCacheEntry(AnalysisTarget target); | 466 CacheEntry getCacheEntry(AnalysisTarget target); |
| 467 } | 467 } |
| 468 | 468 |
| 469 /** | 469 /** |
| 470 * An exception indicating that an attempt was made to perform a task on a | 470 * An exception indicating that an attempt was made to perform a task on a |
| 471 * target while gathering the inputs to perform the same task for the same | 471 * target while gathering the inputs to perform the same task for the same |
| 472 * target. | 472 * target. |
| 473 */ | 473 */ |
| 474 class InfiniteTaskLoopException extends AnalysisException { | 474 class InfiniteTaskLoopException extends AnalysisException { |
| 475 /** | 475 /** |
| 476 * A concrete cyclic path of [TargetedResults] within the [dependencyCycle], | |
| 477 * `null` if no such path exists. All nodes in the path are in the | |
| 478 * dependencyCycle, but the path is not guaranteed to cover the | |
| 479 * entire cycle. | |
| 480 */ | |
| 481 final List<TargetedResult> cyclicPath; | |
|
Leaf
2015/10/19 22:32:27
Not sure if this is the right way to surface this.
Brian Wilkerson
2015/10/19 23:01:40
If it makes debugging easier without hurting perfo
| |
| 482 | |
| 483 /** | |
| 476 * If a dependency cycle was found while computing the inputs for the task, | 484 * If a dependency cycle was found while computing the inputs for the task, |
| 477 * the set of [WorkItem]s contained in the cycle (if there are overlapping | 485 * the set of [WorkItem]s contained in the cycle (if there are overlapping |
| 478 * cycles, this is the set of all [WorkItem]s in the entire strongly | 486 * cycles, this is the set of all [WorkItem]s in the entire strongly |
| 479 * connected component). Otherwise, `null`. | 487 * connected component). Otherwise, `null`. |
| 480 */ | 488 */ |
| 481 final List<WorkItem> dependencyCycle; | 489 final List<WorkItem> dependencyCycle; |
| 482 | 490 |
| 483 /** | 491 /** |
| 484 * Initialize a newly created exception to represent a failed attempt to | 492 * Initialize a newly created exception to represent a failed attempt to |
| 485 * perform the given [task] due to the given [dependencyCycle]. | 493 * perform the given [task] due to the given [dependencyCycle]. |
| 486 */ | 494 */ |
| 487 InfiniteTaskLoopException(AnalysisTask task, this.dependencyCycle) | 495 InfiniteTaskLoopException(AnalysisTask task, this.dependencyCycle, |
| 496 [this.cyclicPath]) | |
| 488 : super( | 497 : super( |
| 489 'Infinite loop while performing task ${task.descriptor.name} for ${t ask.target}'); | 498 'Infinite loop while performing task ${task.descriptor.name} for ${t ask.target}'); |
| 490 } | 499 } |
| 491 | 500 |
| 492 /** | 501 /** |
| 493 * Object used by CycleAwareDependencyWalker to report a single strongly | 502 * Object used by CycleAwareDependencyWalker to report a single strongly |
| 494 * connected component of nodes. | 503 * connected component of nodes. |
| 495 */ | 504 */ |
| 496 class StronglyConnectedComponent<Node> { | 505 class StronglyConnectedComponent<Node> { |
| 497 /** | 506 /** |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 759 final TaskManager taskManager; | 768 final TaskManager taskManager; |
| 760 | 769 |
| 761 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) | 770 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) |
| 762 : super(startingNode); | 771 : super(startingNode); |
| 763 | 772 |
| 764 @override | 773 @override |
| 765 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { | 774 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { |
| 766 return node.gatherInputs(taskManager, skipInputs); | 775 return node.gatherInputs(taskManager, skipInputs); |
| 767 } | 776 } |
| 768 } | 777 } |
| OLD | NEW |