| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library dump_info; | 5 library dump_info; |
| 6 | 6 |
| 7 import 'dart:convert' show | 7 import 'dart:convert' show |
| 8 HtmlEscape, | 8 HtmlEscape, |
| 9 JsonEncoder, | 9 JsonEncoder, |
| 10 StringConversionSink, | 10 StringConversionSink, |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 | 647 |
| 648 Duration toJsonDuration = new DateTime.now().difference(startToJsonTime); | 648 Duration toJsonDuration = new DateTime.now().difference(startToJsonTime); |
| 649 | 649 |
| 650 Map<String, dynamic> generalProgramInfo = <String, dynamic> { | 650 Map<String, dynamic> generalProgramInfo = <String, dynamic> { |
| 651 'size': _programSize, | 651 'size': _programSize, |
| 652 'dart2jsVersion': infoCollector.dart2jsVersion, | 652 'dart2jsVersion': infoCollector.dart2jsVersion, |
| 653 'compilationMoment': new DateTime.now().toString(), | 653 'compilationMoment': new DateTime.now().toString(), |
| 654 'compilationDuration': compiler.totalCompileTime.elapsed.toString(), | 654 'compilationDuration': compiler.totalCompileTime.elapsed.toString(), |
| 655 'toJsonDuration': 0, | 655 'toJsonDuration': 0, |
| 656 'dumpInfoDuration': this.timing.toString(), | 656 'dumpInfoDuration': this.timing.toString(), |
| 657 'noSuchMethodEnabled': compiler.enabledNoSuchMethod | 657 'noSuchMethodEnabled': backend.enabledNoSuchMethod |
| 658 }; | 658 }; |
| 659 | 659 |
| 660 outJson['program'] = generalProgramInfo; | 660 outJson['program'] = generalProgramInfo; |
| 661 | 661 |
| 662 ChunkedConversionSink<Object> sink = | 662 ChunkedConversionSink<Object> sink = |
| 663 encoder.startChunkedConversion( | 663 encoder.startChunkedConversion( |
| 664 new StringConversionSink.fromStringSink(buffer)); | 664 new StringConversionSink.fromStringSink(buffer)); |
| 665 sink.add(outJson); | 665 sink.add(outJson); |
| 666 compiler.reportInfo(NO_LOCATION_SPANNABLE, | 666 compiler.reportInfo(NO_LOCATION_SPANNABLE, |
| 667 const MessageKind( | 667 const MessageKind( |
| 668 "View the dumped .info.json file at " | 668 "View the dumped .info.json file at " |
| 669 "https://dart-lang.github.io/dump-info-visualizer")); | 669 "https://dart-lang.github.io/dump-info-visualizer")); |
| 670 } | 670 } |
| 671 } | 671 } |
| OLD | NEW |