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

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

Issue 1398393002: Decouple SSA builder from codegen-work-item (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/common/codegen.dart ('k') | pkg/compiler/lib/src/enqueue.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 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 }); 338 });
339 } 339 }
340 } 340 }
341 341
342 class Selection { 342 class Selection {
343 final Element selectedElement; 343 final Element selectedElement;
344 final TypeMask mask; 344 final TypeMask mask;
345 Selection(this.selectedElement, this.mask); 345 Selection(this.selectedElement, this.mask);
346 } 346 }
347 347
348 class DumpInfoTask extends CompilerTask { 348 /// Interface used to record information from different parts of the compiler so
349 /// we can emit them in the dump-info task.
350 // TODO(sigmund,het): move more features here. Ideallly the dump-info task
351 // shouldn't reach into internals of other parts of the compiler. For example,
352 // we currently reach into the full emitter and as a result we don't support
353 // dump-info when using the startup-emitter (issue #24190).
354 abstract class InfoReporter {
355 void reportInlined(Element element, Element inlinedFrom);
356 }
357
358 class DumpInfoTask extends CompilerTask implements InfoReporter {
349 DumpInfoTask(Compiler compiler) : super(compiler); 359 DumpInfoTask(Compiler compiler) : super(compiler);
350 360
351 String get name => "Dump Info"; 361 String get name => "Dump Info";
352 362
353 ElementInfoCollector infoCollector; 363 ElementInfoCollector infoCollector;
354 364
355 /// The size of the generated output. 365 /// The size of the generated output.
356 int _programSize; 366 int _programSize;
357 367
358 // A set of javascript AST nodes that we care about the size of. 368 // A set of javascript AST nodes that we care about the size of.
(...skipping 13 matching lines...) Expand all
372 final Map<Element, int> inlineCount = <Element, int>{}; 382 final Map<Element, int> inlineCount = <Element, int>{};
373 // A mapping from an element to a list of elements that are 383 // A mapping from an element to a list of elements that are
374 // inlined inside of it. 384 // inlined inside of it.
375 final Map<Element, List<Element>> inlineMap = <Element, List<Element>>{}; 385 final Map<Element, List<Element>> inlineMap = <Element, List<Element>>{};
376 386
377 /// Register the size of the generated output. 387 /// Register the size of the generated output.
378 void reportSize(int programSize) { 388 void reportSize(int programSize) {
379 _programSize = programSize; 389 _programSize = programSize;
380 } 390 }
381 391
382 void registerInlined(Element element, Element inlinedFrom) { 392 void reportInlined(Element element, Element inlinedFrom) {
383 inlineCount.putIfAbsent(element, () => 0); 393 inlineCount.putIfAbsent(element, () => 0);
384 inlineCount[element] += 1; 394 inlineCount[element] += 1;
385 inlineMap.putIfAbsent(inlinedFrom, () => new List<Element>()); 395 inlineMap.putIfAbsent(inlinedFrom, () => new List<Element>());
386 inlineMap[inlinedFrom].add(element); 396 inlineMap[inlinedFrom].add(element);
387 } 397 }
388 398
389 /** 399 /**
390 * Registers that a function uses a selector in the 400 * Registers that a function uses a selector in the
391 * function body 401 * function body
392 */ 402 */
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 566
557 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( 567 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion(
558 new StringConversionSink.fromStringSink(buffer)); 568 new StringConversionSink.fromStringSink(buffer));
559 sink.add(result.toJson()); 569 sink.add(result.toJson());
560 reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { 570 reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, {
561 'text': "View the dumped .info.json file at " 571 'text': "View the dumped .info.json file at "
562 "https://dart-lang.github.io/dump-info-visualizer" 572 "https://dart-lang.github.io/dump-info-visualizer"
563 }); 573 });
564 } 574 }
565 } 575 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698