| 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' | 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 } | 412 } |
| 413 | 413 |
| 414 void reportInlined(Element element, Element inlinedFrom) { | 414 void reportInlined(Element element, Element inlinedFrom) { |
| 415 inlineCount.putIfAbsent(element, () => 0); | 415 inlineCount.putIfAbsent(element, () => 0); |
| 416 inlineCount[element] += 1; | 416 inlineCount[element] += 1; |
| 417 inlineMap.putIfAbsent(inlinedFrom, () => new List<Element>()); | 417 inlineMap.putIfAbsent(inlinedFrom, () => new List<Element>()); |
| 418 inlineMap[inlinedFrom].add(element); | 418 inlineMap[inlinedFrom].add(element); |
| 419 } | 419 } |
| 420 | 420 |
| 421 final Map<Element, Set<Element>> _dependencies = {}; | 421 final Map<Element, Set<Element>> _dependencies = {}; |
| 422 void registerDependency(Element source, Element target) { | 422 void registerDependency(Element target) { |
| 423 if (compiler.options.dumpInfo) { | 423 if (compiler.options.dumpInfo) { |
| 424 _dependencies.putIfAbsent(source, () => new Set()).add(target); | 424 _dependencies |
| 425 .putIfAbsent(compiler.currentElement, () => new Set()) |
| 426 .add(target); |
| 425 } | 427 } |
| 426 } | 428 } |
| 427 | 429 |
| 428 void registerImpact(Element element, WorldImpact impact) { | 430 void registerImpact(Element element, WorldImpact impact) { |
| 429 if (compiler.options.dumpInfo) { | 431 if (compiler.options.dumpInfo) { |
| 430 impacts[element] = impact; | 432 impacts[element] = impact; |
| 431 } | 433 } |
| 432 } | 434 } |
| 433 | 435 |
| 434 void unregisterImpact(var impactSource) { | 436 void unregisterImpact(var impactSource) { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 | 600 |
| 599 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( | 601 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( |
| 600 new StringConversionSink.fromStringSink(buffer)); | 602 new StringConversionSink.fromStringSink(buffer)); |
| 601 sink.add(new AllInfoJsonCodec().encode(result)); | 603 sink.add(new AllInfoJsonCodec().encode(result)); |
| 602 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { | 604 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { |
| 603 'text': "View the dumped .info.json file at " | 605 'text': "View the dumped .info.json file at " |
| 604 "https://dart-lang.github.io/dump-info-visualizer" | 606 "https://dart-lang.github.io/dump-info-visualizer" |
| 605 }); | 607 }); |
| 606 } | 608 } |
| 607 } | 609 } |
| OLD | NEW |