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 e20007188ea40389cbfc4b6e67e0917be91ca588..8383af08dcac576f9382aef117f84b1294d5f130 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 |
@@ -7,6 +7,7 @@ library dart2js.ir_nodes_sexpr; |
import '../constants/values.dart'; |
import '../util/util.dart'; |
import 'cps_ir_nodes.dart'; |
+import '../universe/universe.dart' show Selector, CallStructure; |
/// A [Decorator] is a function used by [SExpressionStringifier] to augment the |
/// output produced for a node or reference. It can be provided to the |
@@ -115,14 +116,15 @@ class SExpressionStringifier extends Indentation implements Visitor<String> { |
return '$indentation(LetMutable ($name $value)\n$body)'; |
} |
- String formatArguments(Invoke node) { |
- int positionalArgumentCount = node.selector.positionalArgumentCount; |
+ String formatArguments(CallStructure call, |
+ List<Reference<Primitive>> arguments) { |
+ int positionalArgumentCount = call.positionalArgumentCount; |
List<String> args = new List<String>(); |
- args.addAll( |
- node.arguments.getRange(0, positionalArgumentCount).map(access)); |
- for (int i = 0; i < node.selector.namedArgumentCount; ++i) { |
- String name = node.selector.namedArguments[i]; |
- String arg = access(node.arguments[positionalArgumentCount + i]); |
+ args.addAll(arguments.getRange(0, positionalArgumentCount).map(access)); |
+ List<String> argumentNames = call.getOrderedNamedArguments(); |
+ for (int i = 0; i < argumentNames.length; ++i) { |
+ String name = argumentNames[i]; |
+ String arg = access(arguments[positionalArgumentCount + i]); |
args.add("($name: $arg)"); |
} |
return '(${args.join(' ')})'; |
@@ -131,7 +133,7 @@ class SExpressionStringifier extends Indentation implements Visitor<String> { |
String visitInvokeStatic(InvokeStatic node) { |
String name = node.target.name; |
String cont = access(node.continuation); |
- String args = formatArguments(node); |
+ String args = formatArguments(node.selector.callStructure, node.arguments); |
return '$indentation(InvokeStatic $name $args $cont)'; |
} |
@@ -139,7 +141,7 @@ class SExpressionStringifier extends Indentation implements Visitor<String> { |
String name = node.selector.name; |
String rcv = access(node.receiver); |
String cont = access(node.continuation); |
- String args = formatArguments(node); |
+ String args = formatArguments(node.selector.callStructure, node.arguments); |
return '$indentation(InvokeMethod $rcv $name $args $cont)'; |
} |
@@ -147,7 +149,7 @@ class SExpressionStringifier extends Indentation implements Visitor<String> { |
String receiver = access(node.receiver); |
String name = node.selector.name; |
String cont = access(node.continuation); |
- String args = formatArguments(node); |
+ String args = formatArguments(node.selector.callStructure, node.arguments); |
return '$indentation(InvokeMethodDirectly $receiver $name $args $cont)'; |
} |
@@ -169,7 +171,7 @@ class SExpressionStringifier extends Indentation implements Visitor<String> { |
callName = '${className}.${node.target.name}'; |
} |
String cont = access(node.continuation); |
- String args = formatArguments(node); |
+ String args = formatArguments(node.selector.callStructure, node.arguments); |
return '$indentation(InvokeConstructor $callName $args $cont)'; |
} |