Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: pkg/compiler/lib/src/dump_info.dart

Issue 1090243002: Fix dumpInfo: include information for methods that are not in the generated (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698