| 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.dart; | 5 library analyzer.src.task.dart; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2221 outputs[LIBRARY_CYCLE_DEPENDENCIES] = []; | 2221 outputs[LIBRARY_CYCLE_DEPENDENCIES] = []; |
| 2222 } | 2222 } |
| 2223 } | 2223 } |
| 2224 | 2224 |
| 2225 /** | 2225 /** |
| 2226 * Return a map from the names of the inputs of this kind of task to the task | 2226 * Return a map from the names of the inputs of this kind of task to the task |
| 2227 * input descriptors describing those inputs for a task with the | 2227 * input descriptors describing those inputs for a task with the |
| 2228 * given [target]. | 2228 * given [target]. |
| 2229 */ | 2229 */ |
| 2230 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 2230 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
| 2231 LibrarySpecificUnit unit = target; | 2231 Source librarySource = target; |
| 2232 return <String, TaskInput>{ | 2232 return <String, TaskInput>{ |
| 2233 LIBRARY_ELEMENT_INPUT: LIBRARY_ELEMENT2.of(unit.library), | 2233 LIBRARY_ELEMENT_INPUT: LIBRARY_ELEMENT2.of(librarySource), |
| 2234 'resolveReachableLibraries': READY_LIBRARY_ELEMENT2.of(unit.library), | 2234 'resolveReachableLibraries': READY_LIBRARY_ELEMENT2.of(librarySource), |
| 2235 }; | 2235 }; |
| 2236 } | 2236 } |
| 2237 | 2237 |
| 2238 /** | 2238 /** |
| 2239 * Create a [ComputeLibraryCycleTask] based on the | 2239 * Create a [ComputeLibraryCycleTask] based on the |
| 2240 * given [target] in the given [context]. | 2240 * given [target] in the given [context]. |
| 2241 */ | 2241 */ |
| 2242 static ComputeLibraryCycleTask createTask( | 2242 static ComputeLibraryCycleTask createTask( |
| 2243 AnalysisContext context, AnalysisTarget target) { | 2243 AnalysisContext context, AnalysisTarget target) { |
| 2244 return new ComputeLibraryCycleTask(context, target); | 2244 return new ComputeLibraryCycleTask(context, target); |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3287 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { | 3287 static Map<String, TaskInput> buildInputs(AnalysisTarget target) { |
| 3288 LibrarySpecificUnit unit = target; | 3288 LibrarySpecificUnit unit = target; |
| 3289 return <String, TaskInput>{ | 3289 return <String, TaskInput>{ |
| 3290 UNIT_INPUT: RESOLVED_UNIT10.of(unit), | 3290 UNIT_INPUT: RESOLVED_UNIT10.of(unit), |
| 3291 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | 3291 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 3292 // In strong mode, add additional dependencies to enforce inference | 3292 // In strong mode, add additional dependencies to enforce inference |
| 3293 // ordering. | 3293 // ordering. |
| 3294 | 3294 |
| 3295 // Require that field re-resolution be complete for all units in the | 3295 // Require that field re-resolution be complete for all units in the |
| 3296 // current library cycle. | 3296 // current library cycle. |
| 3297 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( | 3297 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit.library).toList( |
| 3298 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT10.of( | 3298 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT10.of( |
| 3299 new LibrarySpecificUnit( | 3299 new LibrarySpecificUnit( |
| 3300 (unit as CompilationUnitElementImpl).librarySource, | 3300 (unit as CompilationUnitElementImpl).librarySource, |
| 3301 unit.source))), | 3301 unit.source))), |
| 3302 // Require that full inference be complete for all dependencies of the | 3302 // Require that full inference be complete for all dependencies of the |
| 3303 // current library cycle. | 3303 // current library cycle. |
| 3304 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( | 3304 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit.library).toList( |
| 3305 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( | 3305 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( |
| 3306 new LibrarySpecificUnit( | 3306 new LibrarySpecificUnit( |
| 3307 (unit as CompilationUnitElementImpl).librarySource, | 3307 (unit as CompilationUnitElementImpl).librarySource, |
| 3308 unit.source))) | 3308 unit.source))) |
| 3309 }; | 3309 }; |
| 3310 } | 3310 } |
| 3311 | 3311 |
| 3312 /** | 3312 /** |
| 3313 * Create a [InferInstanceMembersInUnitTask] based on the given [target] in | 3313 * Create a [InferInstanceMembersInUnitTask] based on the given [target] in |
| 3314 * the given [context]. | 3314 * the given [context]. |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3566 DEPENDENCIES_INPUT: INFERABLE_STATIC_VARIABLE_DEPENDENCIES | 3566 DEPENDENCIES_INPUT: INFERABLE_STATIC_VARIABLE_DEPENDENCIES |
| 3567 .of(variable) | 3567 .of(variable) |
| 3568 .toListOf(INFERRED_STATIC_VARIABLE), | 3568 .toListOf(INFERRED_STATIC_VARIABLE), |
| 3569 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | 3569 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 3570 UNIT_INPUT: RESOLVED_UNIT8.of(unit), | 3570 UNIT_INPUT: RESOLVED_UNIT8.of(unit), |
| 3571 // In strong mode, add additional dependencies to enforce inference | 3571 // In strong mode, add additional dependencies to enforce inference |
| 3572 // ordering. | 3572 // ordering. |
| 3573 | 3573 |
| 3574 // Require that full inference be complete for all dependencies of the | 3574 // Require that full inference be complete for all dependencies of the |
| 3575 // current library cycle. | 3575 // current library cycle. |
| 3576 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( | 3576 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit.library).toList( |
| 3577 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( | 3577 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( |
| 3578 new LibrarySpecificUnit( | 3578 new LibrarySpecificUnit( |
| 3579 (unit as CompilationUnitElementImpl).librarySource, | 3579 (unit as CompilationUnitElementImpl).librarySource, |
| 3580 unit.source))) | 3580 unit.source))) |
| 3581 }; | 3581 }; |
| 3582 } | 3582 } |
| 3583 | 3583 |
| 3584 /** | 3584 /** |
| 3585 * Create a [InferStaticVariableTypeTask] based on the given [target] in the | 3585 * Create a [InferStaticVariableTypeTask] based on the given [target] in the |
| 3586 * given [context]. | 3586 * given [context]. |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4067 return <String, TaskInput>{ | 4067 return <String, TaskInput>{ |
| 4068 'fullyBuiltLibraryElements': READY_LIBRARY_ELEMENT6.of(unit.library), | 4068 'fullyBuiltLibraryElements': READY_LIBRARY_ELEMENT6.of(unit.library), |
| 4069 LIBRARY_INPUT: LIBRARY_ELEMENT6.of(unit.library), | 4069 LIBRARY_INPUT: LIBRARY_ELEMENT6.of(unit.library), |
| 4070 UNIT_INPUT: RESOLVED_UNIT6.of(unit), | 4070 UNIT_INPUT: RESOLVED_UNIT6.of(unit), |
| 4071 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | 4071 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 4072 // In strong mode, add additional dependencies to enforce inference | 4072 // In strong mode, add additional dependencies to enforce inference |
| 4073 // ordering. | 4073 // ordering. |
| 4074 | 4074 |
| 4075 // Require that full inference be complete for all dependencies of the | 4075 // Require that full inference be complete for all dependencies of the |
| 4076 // current library cycle. | 4076 // current library cycle. |
| 4077 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( | 4077 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit.library).toList( |
| 4078 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( | 4078 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( |
| 4079 new LibrarySpecificUnit( | 4079 new LibrarySpecificUnit( |
| 4080 (unit as CompilationUnitElementImpl).librarySource, | 4080 (unit as CompilationUnitElementImpl).librarySource, |
| 4081 unit.source))) | 4081 unit.source))) |
| 4082 }; | 4082 }; |
| 4083 } | 4083 } |
| 4084 | 4084 |
| 4085 /** | 4085 /** |
| 4086 * Create a [PartiallyResolveUnitReferencesTask] based on the given [target] | 4086 * Create a [PartiallyResolveUnitReferencesTask] based on the given [target] |
| 4087 * in the given [context]. | 4087 * in the given [context]. |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5064 LibrarySpecificUnit unit = target; | 5064 LibrarySpecificUnit unit = target; |
| 5065 return <String, TaskInput>{ | 5065 return <String, TaskInput>{ |
| 5066 UNIT_INPUT: RESOLVED_UNIT9.of(unit), | 5066 UNIT_INPUT: RESOLVED_UNIT9.of(unit), |
| 5067 LIBRARY_INPUT: LIBRARY_ELEMENT6.of(unit.library), | 5067 LIBRARY_INPUT: LIBRARY_ELEMENT6.of(unit.library), |
| 5068 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | 5068 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 5069 // In strong mode, add additional dependencies to enforce inference | 5069 // In strong mode, add additional dependencies to enforce inference |
| 5070 // ordering. | 5070 // ordering. |
| 5071 | 5071 |
| 5072 // Require that static variable inference be complete for all units in | 5072 // Require that static variable inference be complete for all units in |
| 5073 // the current library cycle. | 5073 // the current library cycle. |
| 5074 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( | 5074 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit.library).toList( |
| 5075 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT9.of( | 5075 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT9.of( |
| 5076 new LibrarySpecificUnit( | 5076 new LibrarySpecificUnit( |
| 5077 (unit as CompilationUnitElementImpl).librarySource, | 5077 (unit as CompilationUnitElementImpl).librarySource, |
| 5078 unit.source))), | 5078 unit.source))), |
| 5079 // Require that full inference be complete for all dependencies of the | 5079 // Require that full inference be complete for all dependencies of the |
| 5080 // current library cycle. | 5080 // current library cycle. |
| 5081 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( | 5081 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit.library).toList( |
| 5082 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( | 5082 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( |
| 5083 new LibrarySpecificUnit( | 5083 new LibrarySpecificUnit( |
| 5084 (unit as CompilationUnitElementImpl).librarySource, | 5084 (unit as CompilationUnitElementImpl).librarySource, |
| 5085 unit.source))) | 5085 unit.source))) |
| 5086 }; | 5086 }; |
| 5087 } | 5087 } |
| 5088 | 5088 |
| 5089 /** | 5089 /** |
| 5090 * Create a [ResolveInstanceFieldsInUnitTask] based on the given [target] in | 5090 * Create a [ResolveInstanceFieldsInUnitTask] based on the given [target] in |
| 5091 * the given [context]. | 5091 * the given [context]. |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5548 LibrarySpecificUnit unit = target; | 5548 LibrarySpecificUnit unit = target; |
| 5549 return <String, TaskInput>{ | 5549 return <String, TaskInput>{ |
| 5550 LIBRARY_INPUT: LIBRARY_ELEMENT8.of(unit.library), | 5550 LIBRARY_INPUT: LIBRARY_ELEMENT8.of(unit.library), |
| 5551 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | 5551 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 5552 UNIT_INPUT: RESOLVED_UNIT11.of(unit), | 5552 UNIT_INPUT: RESOLVED_UNIT11.of(unit), |
| 5553 // In strong mode, add additional dependencies to enforce inference | 5553 // In strong mode, add additional dependencies to enforce inference |
| 5554 // ordering. | 5554 // ordering. |
| 5555 | 5555 |
| 5556 // Require that inference be complete for all units in the | 5556 // Require that inference be complete for all units in the |
| 5557 // current library cycle. | 5557 // current library cycle. |
| 5558 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( | 5558 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit.library).toList( |
| 5559 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( | 5559 (CompilationUnitElement unit) => CREATED_RESOLVED_UNIT11.of( |
| 5560 new LibrarySpecificUnit( | 5560 new LibrarySpecificUnit( |
| 5561 (unit as CompilationUnitElementImpl).librarySource, | 5561 (unit as CompilationUnitElementImpl).librarySource, |
| 5562 unit.source))) | 5562 unit.source))) |
| 5563 }; | 5563 }; |
| 5564 } | 5564 } |
| 5565 | 5565 |
| 5566 /** | 5566 /** |
| 5567 * Create a [ResolveUnitTask] based on the given [target] in | 5567 * Create a [ResolveUnitTask] based on the given [target] in |
| 5568 * the given [context]. | 5568 * the given [context]. |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6252 | 6252 |
| 6253 @override | 6253 @override |
| 6254 bool moveNext() { | 6254 bool moveNext() { |
| 6255 if (_newSources.isEmpty) { | 6255 if (_newSources.isEmpty) { |
| 6256 return false; | 6256 return false; |
| 6257 } | 6257 } |
| 6258 currentTarget = _newSources.removeLast(); | 6258 currentTarget = _newSources.removeLast(); |
| 6259 return true; | 6259 return true; |
| 6260 } | 6260 } |
| 6261 } | 6261 } |
| OLD | NEW |