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.dart; | 5 library analyzer.src.task.dart; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2939 // ordering. | 2939 // ordering. |
| 2940 | 2940 |
| 2941 // Require that field re-resolution be complete for all units in the | 2941 // Require that field re-resolution be complete for all units in the |
| 2942 // current library cycle. | 2942 // current library cycle. |
| 2943 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( | 2943 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( |
| 2944 (CompilationUnitElementImpl unit) => RESOLVED_UNIT8 | 2944 (CompilationUnitElementImpl unit) => RESOLVED_UNIT8 |
| 2945 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))), | 2945 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))), |
| 2946 // Require that full inference be complete for all dependencies of the | 2946 // Require that full inference be complete for all dependencies of the |
| 2947 // current library cycle. | 2947 // current library cycle. |
| 2948 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( | 2948 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( |
| 2949 (CompilationUnitElementImpl unit) => RESOLVED_UNIT9 | 2949 (CompilationUnitElementImpl unit) => |
| 2950 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))) | 2950 READY_RESOLVED_UNIT.of(unit.librarySource)) |
|
Brian Wilkerson
2015/12/18 18:52:19
I'm a little concerned by the specifics of this ch
| |
| 2951 }; | 2951 }; |
| 2952 } | 2952 } |
| 2953 | 2953 |
| 2954 /** | 2954 /** |
| 2955 * Create a [InferInstanceMembersInUnitTask] based on the given [target] in | 2955 * Create a [InferInstanceMembersInUnitTask] based on the given [target] in |
| 2956 * the given [context]. | 2956 * the given [context]. |
| 2957 */ | 2957 */ |
| 2958 static InferInstanceMembersInUnitTask createTask( | 2958 static InferInstanceMembersInUnitTask createTask( |
| 2959 AnalysisContext context, AnalysisTarget target) { | 2959 AnalysisContext context, AnalysisTarget target) { |
| 2960 return new InferInstanceMembersInUnitTask(context, target); | 2960 return new InferInstanceMembersInUnitTask(context, target); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3179 .of(variable) | 3179 .of(variable) |
| 3180 .toListOf(INFERRED_STATIC_VARIABLE), | 3180 .toListOf(INFERRED_STATIC_VARIABLE), |
| 3181 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | 3181 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 3182 UNIT_INPUT: RESOLVED_UNIT6.of(unit), | 3182 UNIT_INPUT: RESOLVED_UNIT6.of(unit), |
| 3183 // In strong mode, add additional dependencies to enforce inference | 3183 // In strong mode, add additional dependencies to enforce inference |
| 3184 // ordering. | 3184 // ordering. |
| 3185 | 3185 |
| 3186 // Require that full inference be complete for all dependencies of the | 3186 // Require that full inference be complete for all dependencies of the |
| 3187 // current library cycle. | 3187 // current library cycle. |
| 3188 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( | 3188 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( |
| 3189 (CompilationUnitElementImpl unit) => RESOLVED_UNIT9 | 3189 (CompilationUnitElementImpl unit) => |
| 3190 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))) | 3190 READY_RESOLVED_UNIT.of(unit.librarySource)) |
| 3191 }; | 3191 }; |
| 3192 } | 3192 } |
| 3193 | 3193 |
| 3194 /** | 3194 /** |
| 3195 * Create a [InferStaticVariableTypeTask] based on the given [target] in the | 3195 * Create a [InferStaticVariableTypeTask] based on the given [target] in the |
| 3196 * given [context]. | 3196 * given [context]. |
| 3197 */ | 3197 */ |
| 3198 static InferStaticVariableTypeTask createTask( | 3198 static InferStaticVariableTypeTask createTask( |
| 3199 AnalysisContext context, AnalysisTarget target) { | 3199 AnalysisContext context, AnalysisTarget target) { |
| 3200 return new InferStaticVariableTypeTask(context, target); | 3200 return new InferStaticVariableTypeTask(context, target); |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3647 'fullyBuiltLibraryElements': READY_LIBRARY_ELEMENT5.of(unit.library), | 3647 'fullyBuiltLibraryElements': READY_LIBRARY_ELEMENT5.of(unit.library), |
| 3648 LIBRARY_INPUT: LIBRARY_ELEMENT5.of(unit.library), | 3648 LIBRARY_INPUT: LIBRARY_ELEMENT5.of(unit.library), |
| 3649 UNIT_INPUT: RESOLVED_UNIT4.of(unit), | 3649 UNIT_INPUT: RESOLVED_UNIT4.of(unit), |
| 3650 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), | 3650 TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request), |
| 3651 // In strong mode, add additional dependencies to enforce inference | 3651 // In strong mode, add additional dependencies to enforce inference |
| 3652 // ordering. | 3652 // ordering. |
| 3653 | 3653 |
| 3654 // Require that full inference be complete for all dependencies of the | 3654 // Require that full inference be complete for all dependencies of the |
| 3655 // current library cycle. | 3655 // current library cycle. |
| 3656 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( | 3656 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( |
| 3657 (CompilationUnitElementImpl unit) => RESOLVED_UNIT9 | 3657 (CompilationUnitElementImpl unit) => |
| 3658 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))) | 3658 READY_RESOLVED_UNIT.of(unit.librarySource)) |
| 3659 }; | 3659 }; |
| 3660 } | 3660 } |
| 3661 | 3661 |
| 3662 /** | 3662 /** |
| 3663 * Create a [PartiallyResolveUnitReferencesTask] based on the given [target] | 3663 * Create a [PartiallyResolveUnitReferencesTask] based on the given [target] |
| 3664 * in the given [context]. | 3664 * in the given [context]. |
| 3665 */ | 3665 */ |
| 3666 static PartiallyResolveUnitReferencesTask createTask( | 3666 static PartiallyResolveUnitReferencesTask createTask( |
| 3667 AnalysisContext context, AnalysisTarget target) { | 3667 AnalysisContext context, AnalysisTarget target) { |
| 3668 return new PartiallyResolveUnitReferencesTask(context, target); | 3668 return new PartiallyResolveUnitReferencesTask(context, target); |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4432 // ordering. | 4432 // ordering. |
| 4433 | 4433 |
| 4434 // Require that static variable inference be complete for all units in | 4434 // Require that static variable inference be complete for all units in |
| 4435 // the current library cycle. | 4435 // the current library cycle. |
| 4436 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( | 4436 'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList( |
| 4437 (CompilationUnitElementImpl unit) => RESOLVED_UNIT7 | 4437 (CompilationUnitElementImpl unit) => RESOLVED_UNIT7 |
| 4438 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))), | 4438 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))), |
| 4439 // Require that full inference be complete for all dependencies of the | 4439 // Require that full inference be complete for all dependencies of the |
| 4440 // current library cycle. | 4440 // current library cycle. |
| 4441 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( | 4441 'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList( |
| 4442 (CompilationUnitElementImpl unit) => RESOLVED_UNIT9 | 4442 (CompilationUnitElementImpl unit) => |
| 4443 .of(new LibrarySpecificUnit(unit.librarySource, unit.source))) | 4443 READY_RESOLVED_UNIT.of(unit.librarySource)) |
| 4444 }; | 4444 }; |
| 4445 } | 4445 } |
| 4446 | 4446 |
| 4447 /** | 4447 /** |
| 4448 * Create a [ResolveInstanceFieldsInUnitTask] based on the given [target] in | 4448 * Create a [ResolveInstanceFieldsInUnitTask] based on the given [target] in |
| 4449 * the given [context]. | 4449 * the given [context]. |
| 4450 */ | 4450 */ |
| 4451 static ResolveInstanceFieldsInUnitTask createTask( | 4451 static ResolveInstanceFieldsInUnitTask createTask( |
| 4452 AnalysisContext context, AnalysisTarget target) { | 4452 AnalysisContext context, AnalysisTarget target) { |
| 4453 return new ResolveInstanceFieldsInUnitTask(context, target); | 4453 return new ResolveInstanceFieldsInUnitTask(context, target); |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5094 RecordingErrorListener errorListener = new RecordingErrorListener(); | 5094 RecordingErrorListener errorListener = new RecordingErrorListener(); |
| 5095 // | 5095 // |
| 5096 // Prepare inputs. | 5096 // Prepare inputs. |
| 5097 // | 5097 // |
| 5098 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); | 5098 TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT); |
| 5099 CompilationUnit unit = getRequiredInput(UNIT_INPUT); | 5099 CompilationUnit unit = getRequiredInput(UNIT_INPUT); |
| 5100 if (context.analysisOptions.strongMode) { | 5100 if (context.analysisOptions.strongMode) { |
| 5101 unit.accept(new CodeChecker( | 5101 unit.accept(new CodeChecker( |
| 5102 typeProvider, new StrongTypeSystemImpl(), errorListener)); | 5102 typeProvider, new StrongTypeSystemImpl(), errorListener)); |
| 5103 } | 5103 } |
| 5104 | |
| 5105 // | 5104 // |
| 5106 // Record outputs. | 5105 // Record outputs. |
| 5107 // | 5106 // |
| 5108 outputs[STRONG_MODE_ERRORS] = getUniqueErrors(errorListener.errors); | 5107 outputs[STRONG_MODE_ERRORS] = getUniqueErrors(errorListener.errors); |
| 5109 outputs[RESOLVED_UNIT] = unit; | 5108 outputs[RESOLVED_UNIT] = unit; |
| 5110 } | 5109 } |
| 5111 | 5110 |
| 5112 /** | 5111 /** |
| 5113 * Return a map from the names of the inputs of this kind of task to the task | 5112 * Return a map from the names of the inputs of this kind of task to the task |
| 5114 * input descriptors describing those inputs for a task with the | 5113 * input descriptors describing those inputs for a task with the |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5358 | 5357 |
| 5359 @override | 5358 @override |
| 5360 bool moveNext() { | 5359 bool moveNext() { |
| 5361 if (_newSources.isEmpty) { | 5360 if (_newSources.isEmpty) { |
| 5362 return false; | 5361 return false; |
| 5363 } | 5362 } |
| 5364 currentTarget = _newSources.removeLast(); | 5363 currentTarget = _newSources.removeLast(); |
| 5365 return true; | 5364 return true; |
| 5366 } | 5365 } |
| 5367 } | 5366 } |
| OLD | NEW |