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

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

Issue 1434103004: dart2js: report output unit imports to dump-info (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/deferred_load.dart ('k') | tools/deps/dartium.deps/DEPS » ('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 HtmlEscape, JsonEncoder, StringConversionSink, ChunkedConversionSink; 8 show HtmlEscape, JsonEncoder, StringConversionSink, ChunkedConversionSink;
9 9
10 import 'package:dart2js_info/info.dart'; 10 import 'package:dart2js_info/info.dart';
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 319 }
320 320
321 OutputUnitInfo _infoFromOutputUnit(OutputUnit outputUnit) { 321 OutputUnitInfo _infoFromOutputUnit(OutputUnit outputUnit) {
322 return _outputToInfo.putIfAbsent(outputUnit, () { 322 return _outputToInfo.putIfAbsent(outputUnit, () {
323 // Dump-info currently only works with the full emitter. If another 323 // Dump-info currently only works with the full emitter. If another
324 // emitter is used it will fail here. 324 // emitter is used it will fail here.
325 JavaScriptBackend backend = compiler.backend; 325 JavaScriptBackend backend = compiler.backend;
326 full.Emitter emitter = backend.emitter.emitter; 326 full.Emitter emitter = backend.emitter.emitter;
327 OutputUnitInfo info = new OutputUnitInfo( 327 OutputUnitInfo info = new OutputUnitInfo(
328 outputUnit.name, emitter.outputBuffers[outputUnit].length); 328 outputUnit.name, emitter.outputBuffers[outputUnit].length);
329 info.imports.addAll(outputUnit.imports
330 .map((d) => compiler.deferredLoadTask.importDeferName[d]));
329 result.outputUnits.add(info); 331 result.outputUnits.add(info);
330 return info; 332 return info;
331 }); 333 });
332 } 334 }
333 335
334 OutputUnitInfo _unitInfoForElement(Element element) { 336 OutputUnitInfo _unitInfoForElement(Element element) {
335 return _infoFromOutputUnit( 337 return _infoFromOutputUnit(
336 compiler.deferredLoadTask.outputUnitForElement(element)); 338 compiler.deferredLoadTask.outputUnitForElement(element));
337 } 339 }
338 340
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 573
572 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( 574 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion(
573 new StringConversionSink.fromStringSink(buffer)); 575 new StringConversionSink.fromStringSink(buffer));
574 sink.add(new AllInfoJsonCodec().encode(result)); 576 sink.add(new AllInfoJsonCodec().encode(result));
575 reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { 577 reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, {
576 'text': "View the dumped .info.json file at " 578 'text': "View the dumped .info.json file at "
577 "https://dart-lang.github.io/dump-info-visualizer" 579 "https://dart-lang.github.io/dump-info-visualizer"
578 }); 580 });
579 } 581 }
580 } 582 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | tools/deps/dartium.deps/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698