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'; |
11 | 11 |
12 import 'common/tasks.dart' show CompilerTask; | 12 import 'common/tasks.dart' show CompilerTask; |
13 import 'common.dart'; | 13 import 'common.dart'; |
14 import 'compiler.dart' show Compiler; | 14 import 'compiler.dart' show Compiler; |
15 import 'constants/values.dart' show ConstantValue, InterceptorConstantValue; | 15 import 'constants/values.dart' show ConstantValue, InterceptorConstantValue; |
16 import 'deferred_load.dart' show OutputUnit; | 16 import 'deferred_load.dart' show OutputUnit; |
17 import 'elements/elements.dart'; | 17 import 'elements/elements.dart'; |
18 import 'elements/visitor.dart'; | 18 import 'elements/visitor.dart'; |
19 import 'js/js.dart' as jsAst; | 19 import 'js/js.dart' as jsAst; |
20 import 'js_backend/js_backend.dart' show JavaScriptBackend; | 20 import 'js_backend/js_backend.dart' show JavaScriptBackend; |
21 import 'js_emitter/full_emitter/emitter.dart' as full show Emitter; | 21 import 'js_emitter/full_emitter/emitter.dart' as full show Emitter; |
22 import 'types/types.dart' show TypeMask; | 22 import 'types/types.dart' show TypeMask; |
23 import 'universe/universe.dart' show ReceiverConstraint; | 23 import 'universe/world_builder.dart' show ReceiverConstraint; |
24 import 'universe/world_impact.dart' | 24 import 'universe/world_impact.dart' |
25 show ImpactUseCase, WorldImpact, WorldImpactVisitorImpl; | 25 show ImpactUseCase, WorldImpact, WorldImpactVisitorImpl; |
26 | 26 |
27 class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> { | 27 class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> { |
28 final Compiler compiler; | 28 final Compiler compiler; |
29 | 29 |
30 final AllInfo result = new AllInfo(); | 30 final AllInfo result = new AllInfo(); |
31 final Map<Element, Info> _elementToInfo = <Element, Info>{}; | 31 final Map<Element, Info> _elementToInfo = <Element, Info>{}; |
32 final Map<ConstantValue, Info> _constantToInfo = <ConstantValue, Info>{}; | 32 final Map<ConstantValue, Info> _constantToInfo = <ConstantValue, Info>{}; |
33 final Map<OutputUnit, OutputUnitInfo> _outputToInfo = {}; | 33 final Map<OutputUnit, OutputUnitInfo> _outputToInfo = {}; |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 | 587 |
588 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( | 588 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( |
589 new StringConversionSink.fromStringSink(buffer)); | 589 new StringConversionSink.fromStringSink(buffer)); |
590 sink.add(new AllInfoJsonCodec().encode(result)); | 590 sink.add(new AllInfoJsonCodec().encode(result)); |
591 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { | 591 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { |
592 'text': "View the dumped .info.json file at " | 592 'text': "View the dumped .info.json file at " |
593 "https://dart-lang.github.io/dump-info-visualizer" | 593 "https://dart-lang.github.io/dump-info-visualizer" |
594 }); | 594 }); |
595 } | 595 } |
596 } | 596 } |
OLD | NEW |