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

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

Issue 1285743002: dart2js: add visitors and parsing support to infos (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | « no previous file | pkg/compiler/lib/src/info/info.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 'elements/elements.dart'; 10 import 'elements/elements.dart';
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 for (Selection selection in uses) { 472 for (Selection selection in uses) {
473 // Don't register dart2js builtin functions that are not recorded. 473 // Don't register dart2js builtin functions that are not recorded.
474 Info useInfo = infoCollector._elementToInfo[selection.selectedElement]; 474 Info useInfo = infoCollector._elementToInfo[selection.selectedElement];
475 if (useInfo == null) continue; 475 if (useInfo == null) continue;
476 info.uses.add(new DependencyInfo(useInfo, '${selection.mask}')); 476 info.uses.add(new DependencyInfo(useInfo, '${selection.mask}'));
477 } 477 }
478 } 478 }
479 479
480 // Track dependencies that come from inlining. 480 // Track dependencies that come from inlining.
481 for (Element element in inlineMap.keys) { 481 for (Element element in inlineMap.keys) {
482 FunctionInfo functionInfo = infoCollector._elementToInfo[element]; 482 Info outerInfo = infoCollector._elementToInfo[element];
Siggi Cherem (dart-lang) 2015/08/11 16:16:43 oops - I noticed this error while testing things o
483 if (functionInfo == null) continue; 483 if (outerInfo == null) continue;
484 for (Element held in inlineMap[element]) { 484 for (Element inlined in inlineMap[element]) {
485 Info heldInfo = infoCollector._elementToInfo[held]; 485 Info inlinedInfo = infoCollector._elementToInfo[inlined];
486 if (heldInfo == null) continue; 486 if (inlinedInfo == null) continue;
487 functionInfo.uses.add(new DependencyInfo(heldInfo, 'inlined')); 487 outerInfo.uses.add(new DependencyInfo(inlinedInfo, 'inlined'));
488 } 488 }
489 } 489 }
490 490
491 AllInfo result = infoCollector.result; 491 AllInfo result = infoCollector.result;
492 result.deferredFiles = compiler.deferredLoadTask.computeDeferredMap(); 492 result.deferredFiles = compiler.deferredLoadTask.computeDeferredMap();
493 stopwatch.stop(); 493 stopwatch.stop();
494 result.program = new ProgramInfo( 494 result.program = new ProgramInfo(
495 size: _programSize, 495 size: _programSize,
496 dart2jsVersion: compiler.hasBuildId ? compiler.buildId : null, 496 dart2jsVersion: compiler.hasBuildId ? compiler.buildId : null,
497 compilationMoment: new DateTime.now(), 497 compilationMoment: new DateTime.now(),
498 compilationDuration: compiler.totalCompileTime.elapsed, 498 compilationDuration: compiler.totalCompileTime.elapsed,
499 toJsonDuration: stopwatch.elapsedMilliseconds, 499 toJsonDuration: stopwatch.elapsedMilliseconds,
500 dumpInfoDuration: this.timing, 500 dumpInfoDuration: this.timing,
501 noSuchMethodEnabled: compiler.backend.enabledNoSuchMethod, 501 noSuchMethodEnabled: compiler.backend.enabledNoSuchMethod,
502 minified: compiler.enableMinification); 502 minified: compiler.enableMinification);
503 503
504 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( 504 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion(
505 new StringConversionSink.fromStringSink(buffer)); 505 new StringConversionSink.fromStringSink(buffer));
506 sink.add(result.toJson()); 506 sink.add(result.toJson());
507 compiler.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { 507 compiler.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, {
508 'text': "View the dumped .info.json file at " 508 'text': "View the dumped .info.json file at "
509 "https://dart-lang.github.io/dump-info-visualizer" 509 "https://dart-lang.github.io/dump-info-visualizer"
510 }); 510 });
511 } 511 }
512 } 512 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/info/info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698