| 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
| 9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * An inferencing engine that computes a call graph of | 41 * An inferencing engine that computes a call graph of |
| 42 * [TypeInformation] nodes by visiting the AST of the application, and | 42 * [TypeInformation] nodes by visiting the AST of the application, and |
| 43 * then does the inferencing on the graph. | 43 * then does the inferencing on the graph. |
| 44 */ | 44 */ |
| 45 class InferrerEngine { | 45 class InferrerEngine { |
| 46 final Map<Element, TypeInformation> defaultTypeOfParameter = | 46 final Map<Element, TypeInformation> defaultTypeOfParameter = |
| 47 new Map<Element, TypeInformation>(); | 47 new Map<Element, TypeInformation>(); |
| 48 final WorkQueue workQueue = new WorkQueue(); | 48 final WorkQueue workQueue = new WorkQueue(); |
| 49 final Element mainElement; | 49 final FunctionEntity mainElement; |
| 50 final Set<Element> analyzedElements = new Set<Element>(); | 50 final Set<Element> analyzedElements = new Set<Element>(); |
| 51 | 51 |
| 52 /// The maximum number of times we allow a node in the graph to | 52 /// The maximum number of times we allow a node in the graph to |
| 53 /// change types. If a node reaches that limit, we give up | 53 /// change types. If a node reaches that limit, we give up |
| 54 /// inferencing on it and give it the dynamic type. | 54 /// inferencing on it and give it the dynamic type. |
| 55 final int MAX_CHANGE_COUNT = 6; | 55 final int MAX_CHANGE_COUNT = 6; |
| 56 | 56 |
| 57 int overallRefineCount = 0; | 57 int overallRefineCount = 0; |
| 58 int addedInGraph = 0; | 58 int addedInGraph = 0; |
| 59 | 59 |
| (...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 /** | 1084 /** |
| 1085 * Records that the captured variable [local] is read. | 1085 * Records that the captured variable [local] is read. |
| 1086 */ | 1086 */ |
| 1087 void recordCapturedLocalRead(Local local) {} | 1087 void recordCapturedLocalRead(Local local) {} |
| 1088 | 1088 |
| 1089 /** | 1089 /** |
| 1090 * Records that the variable [local] is being updated. | 1090 * Records that the variable [local] is being updated. |
| 1091 */ | 1091 */ |
| 1092 void recordLocalUpdate(Local local, TypeInformation type) {} | 1092 void recordLocalUpdate(Local local, TypeInformation type) {} |
| 1093 } | 1093 } |
| OLD | NEW |