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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart

Issue 1537663002: dart2js: Initial implementation of inlining. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebaseline test expectations and fix a bug (typo). Created 5 years 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 | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/inline.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bf857f991c19fdf715b9b2cfebf96c2c1ac22610..bde9b0efe129baa445d836b5ca3c896151bfa035 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
@@ -48,6 +48,7 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
/// Main entry point for creating a [String] from a [Node]. All recursive
/// calls must go through this method.
String visit(Node node) {
+ if (node == null) return '**** NULL ****';
String s = node.accept(this);
return decorator(node, s);
}
@@ -112,20 +113,25 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
}
String formatArguments(CallStructure call,
- List<Reference<Primitive>> arguments,
- [CallingConvention callingConvention = CallingConvention.Normal]) {
+ List<Reference<Primitive>> arguments,
+ [CallingConvention callingConvention = CallingConvention.Normal]) {
int positionalArgumentCount = call.positionalArgumentCount;
- if (callingConvention == CallingConvention.Intercepted) {
+ if (callingConvention == CallingConvention.Intercepted ||
+ callingConvention == CallingConvention.DummyIntercepted) {
++positionalArgumentCount;
}
List<String> args =
- arguments.getRange(0, positionalArgumentCount).map(access).toList();
+ arguments.take(positionalArgumentCount).map(access).toList();
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)");
}
+ // Constructors can have type parameter after the named arguments.
+ args.addAll(
+ arguments.skip(positionalArgumentCount + argumentNames.length)
+ .map(access));
return '(${args.join(' ')})';
}
@@ -170,7 +176,8 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
String name = access(node.continuation);
if (node.isRecursive) name = 'rec $name';
String args = node.arguments.map(access).join(' ');
- return '$indentation(InvokeContinuation $name ($args))';
+ String escaping = node.isEscapingTry ? ' escape' : '';
+ return '$indentation(InvokeContinuation $name ($args)$escaping)';
}
String visitThrow(Throw node) {
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/inline.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698