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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 11348281: Put back manual inlining of List.add, List.removeLast, String.split and String.concat. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 15496)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1543,18 +1543,28 @@
js.Expression object = pop();
SourceString name = node.selector.name;
String methodName;
- List<js.Expression> arguments;
+ List<js.Expression> arguments = visitArguments(node.inputs);
Element target = node.element;
// Avoid adding the generative constructor name to the list of
// seen selectors.
if (target != null && target.isGenerativeConstructorBody()) {
methodName = name.slowToString();
- arguments = visitArguments(node.inputs);
+ } else if (target == backend.jsArrayAdd) {
+ methodName = 'push';
+ } else if (target == backend.jsArrayRemoveLast) {
+ methodName = 'pop';
+ } else if (target == backend.jsStringSplit) {
+ methodName = 'split';
+ // Split returns a List, so we make sure the backend knows the
+ // list class is instantiated.
+ world.registerInstantiatedClass(compiler.listClass);
+ } else if (target == backend.jsStringConcat) {
+ push(new js.Binary('+', object, arguments[0]), node);
+ return;
} else {
methodName = backend.namer.instanceMethodInvocationName(
node.selector.library, name, node.selector);
- arguments = visitArguments(node.inputs);
bool inLoop = node.block.enclosingLoopHeader != null;
Selector selector = getOptimizedSelectorFor(node, node.selector);

Powered by Google App Engine
This is Rietveld 408576698