| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 */ | 158 */ |
| 159 WorkOrder createWorkOrderForResult( | 159 WorkOrder createWorkOrderForResult( |
| 160 AnalysisTarget target, ResultDescriptor result) { | 160 AnalysisTarget target, ResultDescriptor result) { |
| 161 CacheEntry entry = context.getCacheEntry(target); | 161 CacheEntry entry = context.getCacheEntry(target); |
| 162 CacheState state = entry.getState(result); | 162 CacheState state = entry.getState(result); |
| 163 if (state == CacheState.VALID || | 163 if (state == CacheState.VALID || |
| 164 state == CacheState.ERROR || | 164 state == CacheState.ERROR || |
| 165 state == CacheState.IN_PROCESS) { | 165 state == CacheState.IN_PROCESS) { |
| 166 return null; | 166 return null; |
| 167 } | 167 } |
| 168 if (context.aboutToComputeResult(entry, result)) { |
| 169 return null; |
| 170 } |
| 168 TaskDescriptor taskDescriptor = taskManager.findTask(target, result); | 171 TaskDescriptor taskDescriptor = taskManager.findTask(target, result); |
| 169 if (taskDescriptor == null) { | 172 if (taskDescriptor == null) { |
| 170 return null; | 173 return null; |
| 171 } | 174 } |
| 172 try { | 175 try { |
| 173 WorkItem workItem = | 176 WorkItem workItem = |
| 174 new WorkItem(context, target, taskDescriptor, result, 0, null); | 177 new WorkItem(context, target, taskDescriptor, result, 0, null); |
| 175 return new WorkOrder(taskManager, workItem); | 178 return new WorkOrder(taskManager, workItem); |
| 176 } catch (exception, stackTrace) { | 179 } catch (exception, stackTrace) { |
| 177 throw new AnalysisException( | 180 throw new AnalysisException( |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 final TaskManager taskManager; | 860 final TaskManager taskManager; |
| 858 | 861 |
| 859 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) | 862 _WorkOrderDependencyWalker(this.taskManager, WorkItem startingNode) |
| 860 : super(startingNode); | 863 : super(startingNode); |
| 861 | 864 |
| 862 @override | 865 @override |
| 863 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { | 866 WorkItem getNextInput(WorkItem node, List<WorkItem> skipInputs) { |
| 864 return node.gatherInputs(taskManager, skipInputs); | 867 return node.gatherInputs(taskManager, skipInputs); |
| 865 } | 868 } |
| 866 } | 869 } |
| OLD | NEW |