| 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 /// Computes measurements about sends in a function. | 5 /// Computes measurements about sends in a function. |
| 6 library compiler.src.info.send_info; | 6 library compiler.src.info.send_info; |
| 7 | 7 |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:dart2js_info/src/measurements.dart'; | 10 import 'package:dart2js_info/src/measurements.dart'; |
| 11 import 'package:dart2js_info/src/util.dart' show | 11 import 'package:dart2js_info/src/util.dart' show |
| 12 recursiveDiagnosticString; | 12 recursiveDiagnosticString; |
| 13 | 13 |
| 14 import '../common.dart'; | 14 import '../common.dart'; |
| 15 import '../common/tasks.dart' show | 15 import '../common/tasks.dart' show |
| 16 CompilerTask; | 16 CompilerTask; |
| 17 import '../compiler.dart' show | 17 import '../compiler.dart' show |
| 18 Compiler; | 18 Compiler; |
| 19 import '../dart_types.dart'; | 19 import '../dart_types.dart'; |
| 20 import '../closure.dart'; | 20 import '../closure.dart'; |
| 21 import '../elements/elements.dart'; | 21 import '../elements/elements.dart'; |
| 22 import '../elements/visitor.dart' show | 22 import '../elements/visitor.dart' show |
| 23 ElementVisitor; | 23 ElementVisitor; |
| 24 import '../resolution/operators.dart'; | 24 import '../resolution/operators.dart'; |
| 25 import '../resolution/semantic_visitor.dart'; | 25 import '../resolution/semantic_visitor.dart'; |
| 26 import '../resolution/send_resolver.dart'; | |
| 27 import '../resolution/tree_elements.dart'; | 26 import '../resolution/tree_elements.dart'; |
| 28 import '../constants/expressions.dart'; | 27 import '../constants/expressions.dart'; |
| 29 import '../parser/partial_elements.dart' show | 28 import '../parser/partial_elements.dart' show |
| 30 PartialElement; | 29 PartialElement; |
| 31 import '../tree/tree.dart'; | 30 import '../tree/tree.dart'; |
| 32 import '../universe/call_structure.dart' show | 31 import '../universe/call_structure.dart' show |
| 33 CallStructure; | 32 CallStructure; |
| 34 import '../universe/selector.dart' show | 33 import '../universe/selector.dart' show |
| 35 Selector; | 34 Selector; |
| 36 | 35 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 }); | 76 }); |
| 78 } | 77 } |
| 79 | 78 |
| 80 _qualifiedName(FunctionElement f) { | 79 _qualifiedName(FunctionElement f) { |
| 81 var cls = f.enclosingClass; | 80 var cls = f.enclosingClass; |
| 82 return (cls != null) ? '${cls.name}.${f.name}' : f.name; | 81 return (cls != null) ? '${cls.name}.${f.name}' : f.name; |
| 83 } | 82 } |
| 84 | 83 |
| 85 /// Visitor that categorizes data about an individual send. | 84 /// Visitor that categorizes data about an individual send. |
| 86 class _StatsVisitor<T> extends Visitor | 85 class _StatsVisitor<T> extends Visitor |
| 87 with SendResolverMixin, SemanticSendResolvedMixin<dynamic, T> | 86 with SemanticSendResolvedMixin<dynamic, T> |
| 88 implements SemanticSendVisitor<dynamic, T> { | 87 implements SemanticSendVisitor<dynamic, T> { |
| 89 | 88 |
| 90 // TODO(sigmund): consider passing in several AnalysisResults at once, so we | 89 // TODO(sigmund): consider passing in several AnalysisResults at once, so we |
| 91 // can compute the different metrics together. | 90 // can compute the different metrics together. |
| 92 /// Information we know about the program from static analysis. | 91 /// Information we know about the program from static analysis. |
| 93 final AnalysisResult info; | 92 final AnalysisResult info; |
| 94 | 93 |
| 95 /// Results from this function. | 94 /// Results from this function. |
| 96 final Measurements measurements; | 95 final Measurements measurements; |
| 97 | 96 |
| (...skipping 2283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2381 @override | 2380 @override |
| 2382 R visitClosureFieldElement(ClosureFieldElement e, A arg) { | 2381 R visitClosureFieldElement(ClosureFieldElement e, A arg) { |
| 2383 return visitVariableElement(e, arg); | 2382 return visitVariableElement(e, arg); |
| 2384 } | 2383 } |
| 2385 } | 2384 } |
| 2386 | 2385 |
| 2387 // TODO(sigmund): get rid of debug messages. | 2386 // TODO(sigmund): get rid of debug messages. |
| 2388 _debug(String message) { | 2387 _debug(String message) { |
| 2389 print('[33mdebug:[0m $message'); | 2388 print('[33mdebug:[0m $message'); |
| 2390 } | 2389 } |
| OLD | NEW |