| 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 WorldImpact impact = impacts[element]; | 456 WorldImpact impact = impacts[element]; |
| 457 if (impact == null) return const <Selection>[]; | 457 if (impact == null) return const <Selection>[]; |
| 458 | 458 |
| 459 var selections = <Selection>[]; | 459 var selections = <Selection>[]; |
| 460 compiler.impactStrategy.visitImpact( | 460 compiler.impactStrategy.visitImpact( |
| 461 element, | 461 element, |
| 462 impact, | 462 impact, |
| 463 new WorldImpactVisitorImpl(visitDynamicUse: (dynamicUse) { | 463 new WorldImpactVisitorImpl(visitDynamicUse: (dynamicUse) { |
| 464 selections.addAll(closedWorld.allFunctions | 464 selections.addAll(closedWorld.allFunctions |
| 465 .filter(dynamicUse.selector, dynamicUse.mask) | 465 .filter(dynamicUse.selector, dynamicUse.mask) |
| 466 .map((e) => new Selection(e, dynamicUse.mask))); | 466 .map((MemberElement e) => new Selection(e, dynamicUse.mask))); |
| 467 }, visitStaticUse: (staticUse) { | 467 }, visitStaticUse: (staticUse) { |
| 468 selections.add(new Selection(staticUse.element, null)); | 468 selections.add(new Selection(staticUse.element, null)); |
| 469 }), | 469 }), |
| 470 IMPACT_USE); | 470 IMPACT_USE); |
| 471 return selections; | 471 return selections; |
| 472 } | 472 } |
| 473 | 473 |
| 474 // Returns true if we care about tracking the size of | 474 // Returns true if we care about tracking the size of |
| 475 // this node. | 475 // this node. |
| 476 bool isTracking(jsAst.Node code) { | 476 bool isTracking(jsAst.Node code) { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 | 617 |
| 618 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( | 618 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( |
| 619 new StringConversionSink.fromStringSink(buffer)); | 619 new StringConversionSink.fromStringSink(buffer)); |
| 620 sink.add(new AllInfoJsonCodec().encode(result)); | 620 sink.add(new AllInfoJsonCodec().encode(result)); |
| 621 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { | 621 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { |
| 622 'text': "View the dumped .info.json file at " | 622 'text': "View the dumped .info.json file at " |
| 623 "https://dart-lang.github.io/dump-info-visualizer" | 623 "https://dart-lang.github.io/dump-info-visualizer" |
| 624 }); | 624 }); |
| 625 } | 625 } |
| 626 } | 626 } |
| OLD | NEW |