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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 271 } |
272 | 272 |
273 MethodElement method; | 273 MethodElement method; |
274 if (element is LocalFunctionElement) { | 274 if (element is LocalFunctionElement) { |
275 method = element.callMethod; | 275 method = element.callMethod; |
276 } else { | 276 } else { |
277 method = element; | 277 method = element; |
278 } | 278 } |
279 | 279 |
280 String inferredReturnType = '${_resultOfMember(method).returnType}'; | 280 String inferredReturnType = '${_resultOfMember(method).returnType}'; |
281 String sideEffects = '${closedWorld.getSideEffectsOfElement(element)}'; | 281 String sideEffects = '${closedWorld.getSideEffectsOfElement(method)}'; |
282 | 282 |
283 int inlinedCount = compiler.dumpInfoTask.inlineCount[element]; | 283 int inlinedCount = compiler.dumpInfoTask.inlineCount[element]; |
284 if (inlinedCount == null) inlinedCount = 0; | 284 if (inlinedCount == null) inlinedCount = 0; |
285 | 285 |
286 FunctionInfo info = new FunctionInfo( | 286 FunctionInfo info = new FunctionInfo( |
287 name: name, | 287 name: name, |
288 functionKind: kind, | 288 functionKind: kind, |
289 modifiers: modifiers, | 289 modifiers: modifiers, |
290 returnType: returnType, | 290 returnType: returnType, |
291 inferredReturnType: inferredReturnType, | 291 inferredReturnType: inferredReturnType, |
(...skipping 325 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 |