Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: bin/debug_info.dart

Issue 2201903004: add tool to get breakdown of deferred libraries by size (Closed) Base URL: git@github.com:dart-lang/dart2js_info.git@master
Patch Set: add TODO Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « bin/coverage_log_server.dart ('k') | bin/deferred_library_check.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /// Tool used mainly by dart2js developers to debug the generated info and check 5 /// Tool used mainly by dart2js developers to debug the generated info and check
6 /// that it is consistent and that it covers all the data we expect it to cover. 6 /// that it is consistent and that it covers all the data we expect it to cover.
7 library dart2js_info.bin.debug_info; 7 library dart2js_info.bin.debug_info;
8 8
9 import 'dart:convert';
10 import 'dart:io'; 9 import 'dart:io';
11 10
12 import 'package:dart2js_info/info.dart'; 11 import 'package:dart2js_info/info.dart';
13 import 'package:dart2js_info/src/graph.dart'; 12 import 'package:dart2js_info/src/graph.dart';
14 import 'package:dart2js_info/src/util.dart'; 13 import 'package:dart2js_info/src/util.dart';
15 14
16 main(args) { 15 main(args) async {
17 if (args.length < 1) { 16 if (args.length < 1) {
18 print('usage: dart tool/debug_info.dart path-to-info.json ' 17 print('usage: dart tool/debug_info.dart path-to-info.json '
19 '[--show-library libname]'); 18 '[--show-library libname]');
20 exit(1); 19 exit(1);
21 } 20 }
22 21
23 var filename = args[0]; 22 var info = await infoFromFile(args.first);
24 var json = JSON.decode(new File(filename).readAsStringSync());
25 var info = new AllInfoJsonCodec().decode(json);
26 var debugLibName; 23 var debugLibName;
27 24
28 if (args.length > 2 && args[1] == '--show-library') { 25 if (args.length > 2 && args[1] == '--show-library') {
29 debugLibName = args[2]; 26 debugLibName = args[2];
30 } 27 }
31 28
32 validateSize(info, debugLibName); 29 validateSize(info, debugLibName);
33 compareGraphs(info); 30 compareGraphs(info);
34 verifyDeps(info); 31 verifyDeps(info);
35 } 32 }
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (unreachables.isNotEmpty) { 274 if (unreachables.isNotEmpty) {
278 _fail('${unreachables.length} elements are unreachable from the ' 275 _fail('${unreachables.length} elements are unreachable from the '
279 'entrypoint'); 276 'entrypoint');
280 } else { 277 } else {
281 _pass('all elements are reachable from the entrypoint'); 278 _pass('all elements are reachable from the entrypoint');
282 } 279 }
283 } 280 }
284 281
285 _pass(String msg) => print('\x1b[32mPASS\x1b[0m: $msg'); 282 _pass(String msg) => print('\x1b[32mPASS\x1b[0m: $msg');
286 _fail(String msg) => print('\x1b[31mFAIL\x1b[0m: $msg'); 283 _fail(String msg) => print('\x1b[31mFAIL\x1b[0m: $msg');
OLDNEW
« no previous file with comments | « bin/coverage_log_server.dart ('k') | bin/deferred_library_check.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698