Chromium Code Reviews| Index: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart |
| diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart |
| index 34cd076d3c0941f0a6eec0baa1e8520d82735286..159f1502c793825c6e6a83b48ea6768624391a17 100644 |
| --- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart |
| +++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart |
| @@ -198,15 +198,28 @@ class SExpressionStringifier extends Indentation implements Visitor<String> { |
| } |
| String visitInvokeConstructor(InvokeConstructor node) { |
| + String className; |
| + // TODO(karlklose): for illegal nodes constructed for tests or unresolved |
| + // cosntructor calls in the DartBackend, we get an element with no enclosing |
| + // class. Clean this up by introducing a name field to the node and |
| + // removing [ErroneousElement]s from the IR. |
| + if (node.type != null) { |
| + className = node.type.toString(); |
| + } else { |
| + className = node.target.enclosingClass.name; |
| + } |
| String callName; |
| if (node.target.name.isEmpty) { |
| - callName = '${node.type}'; |
| + callName = '${className}'; |
| } else { |
| - callName = '${node.type}.${node.target.name}'; |
| + callName = '${className}.${node.target.name}'; |
| } |
| String cont = access(node.continuation); |
| String args = formatArguments(node); |
| - return '$indentation(InvokeConstructor $callName $args $cont)'; |
| + String typeArguments = node.typeArguments.isEmpty ? '' |
| + : ' <${node.typeArguments.map(access).join(', ')}>'; |
| + return '$indentation(InvokeConstructor $callName $args$typeArguments' |
| + ' $cont)'; |
| } |
| String visitConcatenateStrings(ConcatenateStrings node) { |
| @@ -338,6 +351,12 @@ class SExpressionStringifier extends Indentation implements Visitor<String> { |
| String visitReadTypeVariable(ReadTypeVariable node) { |
| return '(ReadTypeVariable ${access(node.target)}.${node.variable})'; |
| } |
| + |
| + @override |
| + String visitTypeExpression(TypeExpression node) { |
| + String args = node.arguments.map(access).join(', '); |
| + return '(TypeExpression ${node.dartType.toString()} $args)'; |
|
asgerf
2015/03/18 10:18:06
Redundant toString call
|
| + } |
| } |
| class ConstantStringifier extends ConstantValueVisitor<String, Null> { |