| 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 /// Utility to display statistics about "sends" as a table on the command line. | 5 /// Utility to display statistics about "sends" as a table on the command line. |
| 6 library compiler.tool.stats.print_summary; | 6 library compiler.tool.stats.print_summary; |
| 7 | 7 |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'package:dart2js_info/info.dart'; | 10 import 'package:dart2js_info/info.dart'; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 var uri = info.uri; | 74 var uri = info.uri; |
| 75 var bundle = uri.scheme == 'package' | 75 var bundle = uri.scheme == 'package' |
| 76 ? uri.pathSegments.first | 76 ? uri.pathSegments.first |
| 77 : uri.scheme == 'file' ? uri.pathSegments.last : '$uri'; | 77 : uri.scheme == 'file' ? uri.pathSegments.last : '$uri'; |
| 78 currentBundleTotals = | 78 currentBundleTotals = |
| 79 bundleTotals.putIfAbsent(bundle, () => new Measurements()); | 79 bundleTotals.putIfAbsent(bundle, () => new Measurements()); |
| 80 super.visitLibrary(info); | 80 super.visitLibrary(info); |
| 81 totals.addFrom(currentBundleTotals); | 81 totals.addFrom(currentBundleTotals); |
| 82 } | 82 } |
| 83 | 83 |
| 84 visitFunction(FunctionInfo function) { | 84 Null visitFunction(FunctionInfo function) { |
| 85 var measurements = function.measurements; | 85 var measurements = function.measurements; |
| 86 if (measurements == null) return; | 86 if (measurements == null) return null; |
| 87 currentBundleTotals.addFrom(measurements); | 87 currentBundleTotals.addFrom(measurements); |
| 88 return null; |
| 88 } | 89 } |
| 89 } | 90 } |
| 90 | 91 |
| 91 const _groupColors = const [_YELLOW_COLOR, _NO_COLOR]; | 92 const _groupColors = const [_YELLOW_COLOR, _NO_COLOR]; |
| 92 | 93 |
| 93 const _NO_COLOR = "\x1b[0m"; | 94 const _NO_COLOR = "\x1b[0m"; |
| 94 const _GREEN_COLOR = "\x1b[32m"; | 95 const _GREEN_COLOR = "\x1b[32m"; |
| 95 const _YELLOW_COLOR = "\x1b[33m"; | 96 const _YELLOW_COLOR = "\x1b[33m"; |
| 96 const _WHITE_COLOR = "\x1b[37m"; | 97 const _WHITE_COLOR = "\x1b[37m"; |
| OLD | NEW |