Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 15471) |
| +++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy) |
| @@ -1543,18 +1543,26 @@ |
| 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'; |
| + world.registerInstantiatedClass(compiler.listClass); |
|
kasperl
2012/11/29 08:10:48
Add a comment that explains why you need to instan
ngeoffray
2012/11/29 08:46:51
Done.
|
| + } 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); |