| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 signature.forEachParameter((parameter) { | 255 signature.forEachParameter((parameter) { |
| 256 parameters.add(new ParameterInfo(parameter.name, | 256 parameters.add(new ParameterInfo(parameter.name, |
| 257 '${_resultOf(parameter).type}', '${parameter.node.type}')); | 257 '${_resultOf(parameter).type}', '${parameter.node.type}')); |
| 258 }); | 258 }); |
| 259 } | 259 } |
| 260 | 260 |
| 261 String returnType = null; | 261 String returnType = null; |
| 262 // TODO(sigmund): why all these checks? | 262 // TODO(sigmund): why all these checks? |
| 263 if (element.isInstanceMember && | 263 if (element.isInstanceMember && |
| 264 !element.isAbstract && | 264 !element.isAbstract && |
| 265 closedWorld.allFunctions.contains(element)) { | 265 closedWorld.allFunctions.contains(element as MemberElement)) { |
| 266 returnType = '${element.type.returnType}'; | 266 returnType = '${element.type.returnType}'; |
| 267 } | 267 } |
| 268 String inferredReturnType = '${_resultOf(element).returnType}'; | 268 String inferredReturnType = '${_resultOf(element).returnType}'; |
| 269 String sideEffects = '${closedWorld.getSideEffectsOfElement(element)}'; | 269 String sideEffects = '${closedWorld.getSideEffectsOfElement(element)}'; |
| 270 | 270 |
| 271 int inlinedCount = compiler.dumpInfoTask.inlineCount[element]; | 271 int inlinedCount = compiler.dumpInfoTask.inlineCount[element]; |
| 272 if (inlinedCount == null) inlinedCount = 0; | 272 if (inlinedCount == null) inlinedCount = 0; |
| 273 | 273 |
| 274 FunctionInfo info = new FunctionInfo( | 274 FunctionInfo info = new FunctionInfo( |
| 275 name: name, | 275 name: name, |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 | 601 |
| 602 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( | 602 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( |
| 603 new StringConversionSink.fromStringSink(buffer)); | 603 new StringConversionSink.fromStringSink(buffer)); |
| 604 sink.add(new AllInfoJsonCodec().encode(result)); | 604 sink.add(new AllInfoJsonCodec().encode(result)); |
| 605 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { | 605 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { |
| 606 'text': "View the dumped .info.json file at " | 606 'text': "View the dumped .info.json file at " |
| 607 "https://dart-lang.github.io/dump-info-visualizer" | 607 "https://dart-lang.github.io/dump-info-visualizer" |
| 608 }); | 608 }); |
| 609 } | 609 } |
| 610 } | 610 } |
| OLD | NEW |