OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'package:front_end/src/base/instrumentation.dart'; | 5 import 'package:front_end/src/base/instrumentation.dart'; |
6 import 'package:front_end/src/dependency_walker.dart' as dependencyWalker; | 6 import 'package:front_end/src/dependency_walker.dart' as dependencyWalker; |
7 import 'package:front_end/src/fasta/problems.dart' show unhandled; | 7 import 'package:front_end/src/fasta/problems.dart' show unhandled; |
8 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'; | 8 import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'; |
9 import 'package:front_end/src/fasta/type_inference/type_inference_listener.dart'
; | 9 import 'package:front_end/src/fasta/type_inference/type_inference_listener.dart'
; |
10 import 'package:front_end/src/fasta/type_inference/type_inferrer.dart'; | 10 import 'package:front_end/src/fasta/type_inference/type_inferrer.dart'; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 abstract class TypeInferenceEngine { | 133 abstract class TypeInferenceEngine { |
134 ClassHierarchy get classHierarchy; | 134 ClassHierarchy get classHierarchy; |
135 | 135 |
136 CoreTypes get coreTypes; | 136 CoreTypes get coreTypes; |
137 | 137 |
138 /// Creates a type inferrer for use inside of a method body declared in a file | 138 /// Creates a type inferrer for use inside of a method body declared in a file |
139 /// with the given [uri]. | 139 /// with the given [uri]. |
140 TypeInferrer createLocalTypeInferrer( | 140 TypeInferrer createLocalTypeInferrer( |
141 Uri uri, TypeInferenceListener listener, InterfaceType thisType); | 141 Uri uri, TypeInferenceListener listener, InterfaceType thisType); |
142 | 142 |
| 143 /// Creates a disabled type inferrer (intended for debugging and profiling |
| 144 /// only). |
| 145 TypeInferrer createDisabledTypeInferrer(); |
| 146 |
143 /// Creates a [TypeInferrer] object which is ready to perform type inference | 147 /// Creates a [TypeInferrer] object which is ready to perform type inference |
144 /// on the given [field]. | 148 /// on the given [field]. |
145 TypeInferrer createTopLevelTypeInferrer(TypeInferenceListener listener, | 149 TypeInferrer createTopLevelTypeInferrer(TypeInferenceListener listener, |
146 InterfaceType thisType, KernelMember member); | 150 InterfaceType thisType, KernelMember member); |
147 | 151 |
148 /// Performs the second phase of top level initializer inference, which is to | 152 /// Performs the second phase of top level initializer inference, which is to |
149 /// visit all accessors and top level variables that were passed to | 153 /// visit all accessors and top level variables that were passed to |
150 /// [recordAccessor] in topologically-sorted order and assign their types. | 154 /// [recordAccessor] in topologically-sorted order and assign their types. |
151 void finishTopLevel(); | 155 void finishTopLevel(); |
152 | 156 |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 } | 644 } |
641 | 645 |
642 @override | 646 @override |
643 void evaluateScc(List<AccessorNode> scc) { | 647 void evaluateScc(List<AccessorNode> scc) { |
644 // Mark every accessor as part of a circularity. | 648 // Mark every accessor as part of a circularity. |
645 for (var f in scc) { | 649 for (var f in scc) { |
646 f._typeInferenceEngine.inferAccessorCircular(f); | 650 f._typeInferenceEngine.inferAccessorCircular(f); |
647 } | 651 } |
648 } | 652 } |
649 } | 653 } |
OLD | NEW |