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

Side by Side Diff: pkg/compiler/lib/src/dump_info.dart

Issue 2637383005: enable --dump-info with the --fast-startup emitter (Closed)
Patch Set: Created 3 years, 11 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 | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/io/code_output.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) 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' 7 import 'dart:convert'
8 show ChunkedConversionSink, JsonEncoder, StringConversionSink; 8 show ChunkedConversionSink, JsonEncoder, StringConversionSink;
9 9
10 import 'package:dart2js_info/info.dart'; 10 import 'package:dart2js_info/info.dart';
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 if (info is FieldInfo) info.closures = nestedClosures; 322 if (info is FieldInfo) info.closures = nestedClosures;
323 323
324 return size; 324 return size;
325 } 325 }
326 326
327 OutputUnitInfo _infoFromOutputUnit(OutputUnit outputUnit) { 327 OutputUnitInfo _infoFromOutputUnit(OutputUnit outputUnit) {
328 return _outputToInfo.putIfAbsent(outputUnit, () { 328 return _outputToInfo.putIfAbsent(outputUnit, () {
329 // Dump-info currently only works with the full emitter. If another 329 // Dump-info currently only works with the full emitter. If another
330 // emitter is used it will fail here. 330 // emitter is used it will fail here.
331 JavaScriptBackend backend = compiler.backend; 331 JavaScriptBackend backend = compiler.backend;
332 full.Emitter emitter = backend.emitter.emitter;
333 assert(outputUnit.name != null || outputUnit.isMainOutput); 332 assert(outputUnit.name != null || outputUnit.isMainOutput);
334 OutputUnitInfo info = new OutputUnitInfo( 333 OutputUnitInfo info = new OutputUnitInfo(
335 outputUnit.name, emitter.outputBuffers[outputUnit].length); 334 outputUnit.name, backend.emitter.emitter.generatedSize(outputUnit));
336 info.imports.addAll(outputUnit.imports 335 info.imports.addAll(outputUnit.imports
337 .map((d) => compiler.deferredLoadTask.importDeferName[d])); 336 .map((d) => compiler.deferredLoadTask.importDeferName[d]));
338 result.outputUnits.add(info); 337 result.outputUnits.add(info);
339 return info; 338 return info;
340 }); 339 });
341 } 340 }
342 341
343 OutputUnitInfo _unitInfoForElement(Element element) { 342 OutputUnitInfo _unitInfoForElement(Element element) {
344 return _infoFromOutputUnit( 343 return _infoFromOutputUnit(
345 compiler.deferredLoadTask.outputUnitForElement(element)); 344 compiler.deferredLoadTask.outputUnitForElement(element));
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 600
602 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( 601 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion(
603 new StringConversionSink.fromStringSink(buffer)); 602 new StringConversionSink.fromStringSink(buffer));
604 sink.add(new AllInfoJsonCodec().encode(result)); 603 sink.add(new AllInfoJsonCodec().encode(result));
605 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { 604 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, {
606 'text': "View the dumped .info.json file at " 605 'text': "View the dumped .info.json file at "
607 "https://dart-lang.github.io/dump-info-visualizer" 606 "https://dart-lang.github.io/dump-info-visualizer"
608 }); 607 });
609 } 608 }
610 } 609 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/io/code_output.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698