Chromium Code Reviews| Index: pkg/compiler/lib/src/dump_info.dart |
| diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart |
| index a3ee0f0465bf0de35bb01f2a8800d84e39e7e2b3..caf06213a9c33e101e0f6cc6fdf8f07cf444230b 100644 |
| --- a/pkg/compiler/lib/src/dump_info.dart |
| +++ b/pkg/compiler/lib/src/dump_info.dart |
| @@ -323,23 +323,25 @@ class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> { |
| kind = "constructor"; |
| } |
| - if (emittedCode != null) { |
| + if (element.hasFunctionSignature) { |
| FunctionSignature signature = element.functionSignature; |
| - returnType = signature.type.returnType.toString(); |
| signature.forEachParameter((parameter) { |
| parameters.add({ |
| 'name': parameter.name, |
| - 'type': compiler.typesTask |
| - .getGuaranteedTypeOfElement(parameter).toString(), |
| - 'declaredType': parameter.node.type.toString() |
| + 'type': '${compiler.typesTask.getGuaranteedTypeOfElement(parameter)}', |
| + 'declaredType': '${parameter.node.type}' |
| }); |
| }); |
| - inferredReturnType = compiler.typesTask |
| - .getGuaranteedReturnTypeOfElement(element).toString(); |
| - sideEffects = compiler.world.getSideEffectsOfElement(element).toString(); |
| - code = emittedCode.toString(); |
| } |
| + if (element.isInstanceMember && !element.isAbstract && |
| + compiler.world.allFunctions.contains(element)) { |
| + returnType = '${element.type.returnType}'; |
| + } |
| + inferredReturnType = |
| + '${compiler.typesTask.getGuaranteedReturnTypeOfElement(element)}'; |
| + sideEffects = compiler.world.getSideEffectsOfElement(element).toString(); |
| + |
| if (element is MemberElement) { |
| MemberElement member = element as MemberElement; |
| for (Element closure in member.nestedClosures) { |
| @@ -376,7 +378,7 @@ class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> { |
| 'parameters': parameters, |
| 'sideEffects': sideEffects, |
| 'inlinedCount': inlinedCount, |
| - 'code': code, |
| + 'code': emittedCode == null ? null : '$emittedCode', |
| 'type': element.type.toString(), |
| 'outputUnit': mapper._outputUnit.add(outputUnit) |
| }; |
| @@ -551,7 +553,7 @@ class DumpInfoTask extends CompilerTask { |
| void dumpInfoJson(StringSink buffer) { |
| - JsonEncoder encoder = const JsonEncoder(); |
| + JsonEncoder encoder = const JsonEncoder.withIndent(' '); |
|
Siggi Cherem (dart-lang)
2015/04/17 15:52:55
this is not needed, but makes the output easier to
|
| DateTime startToJsonTime = new DateTime.now(); |
| Map<String, List<Map<String, String>>> holding = |