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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 reporter.log('Inferred $overallRefineCount types.'); | 467 reporter.log('Inferred $overallRefineCount types.'); |
468 | 468 |
469 processLoopInformation(); | 469 processLoopInformation(); |
470 } | 470 } |
471 | 471 |
472 void analyze(ResolvedAst resolvedAst, ArgumentsTypes arguments) { | 472 void analyze(ResolvedAst resolvedAst, ArgumentsTypes arguments) { |
473 AstElement element = resolvedAst.element.implementation; | 473 AstElement element = resolvedAst.element.implementation; |
474 if (analyzedElements.contains(element)) return; | 474 if (analyzedElements.contains(element)) return; |
475 analyzedElements.add(element); | 475 analyzedElements.add(element); |
476 | 476 |
477 var visitor = compiler.options.kernelGlobalInference | 477 dynamic visitor = compiler.options.kernelGlobalInference |
478 ? new KernelTypeGraphBuilder(element, resolvedAst, compiler, this) | 478 ? new KernelTypeGraphBuilder(element, resolvedAst, compiler, this) |
479 : new ElementGraphBuilder(element, resolvedAst, compiler, this); | 479 : new ElementGraphBuilder(element, resolvedAst, compiler, this); |
480 TypeInformation type; | 480 TypeInformation type; |
481 reporter.withCurrentElement(element, () { | 481 reporter.withCurrentElement(element, () { |
| 482 // ignore: UNDEFINED_METHOD |
482 type = visitor.run(); | 483 type = visitor.run(); |
483 }); | 484 }); |
484 addedInGraph++; | 485 addedInGraph++; |
485 | 486 |
486 if (element.isField) { | 487 if (element.isField) { |
487 VariableElement fieldElement = element; | 488 VariableElement fieldElement = element; |
488 ast.Node node = resolvedAst.node; | 489 ast.Node node = resolvedAst.node; |
489 ast.Node initializer = resolvedAst.body; | 490 ast.Node initializer = resolvedAst.body; |
490 if (element.isFinal || element.isConst) { | 491 if (element.isFinal || element.isConst) { |
491 // If [element] is final and has an initializer, we record | 492 // If [element] is final and has an initializer, we record |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 /** | 1057 /** |
1057 * Records that the captured variable [local] is read. | 1058 * Records that the captured variable [local] is read. |
1058 */ | 1059 */ |
1059 void recordCapturedLocalRead(Local local) {} | 1060 void recordCapturedLocalRead(Local local) {} |
1060 | 1061 |
1061 /** | 1062 /** |
1062 * Records that the variable [local] is being updated. | 1063 * Records that the variable [local] is being updated. |
1063 */ | 1064 */ |
1064 void recordLocalUpdate(Local local, TypeInformation type) {} | 1065 void recordLocalUpdate(Local local, TypeInformation type) {} |
1065 } | 1066 } |
OLD | NEW |