| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 */ | 150 */ |
| 151 WorkOrder createWorkOrderForResult( | 151 WorkOrder createWorkOrderForResult( |
| 152 AnalysisTarget target, ResultDescriptor result) { | 152 AnalysisTarget target, ResultDescriptor result) { |
| 153 CacheEntry entry = context.getCacheEntry(target); | 153 CacheEntry entry = context.getCacheEntry(target); |
| 154 CacheState state = entry.getState(result); | 154 CacheState state = entry.getState(result); |
| 155 if (state == CacheState.VALID || | 155 if (state == CacheState.VALID || |
| 156 state == CacheState.ERROR || | 156 state == CacheState.ERROR || |
| 157 state == CacheState.IN_PROCESS) { | 157 state == CacheState.IN_PROCESS) { |
| 158 return null; | 158 return null; |
| 159 } | 159 } |
| 160 TaskDescriptor taskDescriptor = taskManager.findTask(target, result); |
| 160 try { | 161 try { |
| 161 TaskDescriptor taskDescriptor = taskManager.findTask(target, result); | |
| 162 WorkItem workItem = new WorkItem(context, target, taskDescriptor, result); | 162 WorkItem workItem = new WorkItem(context, target, taskDescriptor, result); |
| 163 return new WorkOrder(taskManager, workItem); | 163 return new WorkOrder(taskManager, workItem); |
| 164 } catch (exception, stackTrace) { | 164 } catch (exception, stackTrace) { |
| 165 throw new AnalysisException( | 165 throw new AnalysisException( |
| 166 'Could not create work order (target = $target; result = $result)', | 166 'Could not create work order (target = $target; taskDescriptor = $task
Descriptor; result = $result)', |
| 167 new CaughtException(exception, stackTrace)); | 167 new CaughtException(exception, stackTrace)); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 /** | 171 /** |
| 172 * Create a work order that will produce the required analysis results for | 172 * Create a work order that will produce the required analysis results for |
| 173 * the given [target]. If [isPriority] is true, then the target is a priority | 173 * the given [target]. If [isPriority] is true, then the target is a priority |
| 174 * target. Return the work order that was created, or `null` if there is no | 174 * target. Return the work order that was created, or `null` if there is no |
| 175 * further work that needs to be done for the given target. | 175 * further work that needs to be done for the given target. |
| 176 */ | 176 */ |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 final TaskManager taskManager; | 808 final TaskManager taskManager; |
| 809 | 809 |
| 810 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) | 810 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) |
| 811 : super(startingNode); | 811 : super(startingNode); |
| 812 | 812 |
| 813 @override | 813 @override |
| 814 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { | 814 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { |
| 815 return node.gatherInputs(taskManager, skipInputs); | 815 return node.gatherInputs(taskManager, skipInputs); |
| 816 } | 816 } |
| 817 } | 817 } |
| OLD | NEW |