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

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

Issue 11316241: Put back the unit test on optimizing removeLast to pop. Also don't forget that jsArrayRemoveLast mi… (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
« no previous file with comments | « no previous file | tests/compiler/dart2js/value_range_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 15500)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1546,23 +1546,27 @@
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();
- } 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 {
+ if (target != null) {
+ // Avoid adding the generative constructor name to the list of
+ // seen selectors.
+ if (target.isGenerativeConstructorBody()) {
+ methodName = name.slowToString();
+ } 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;
+ }
+ }
+
+ if (methodName == null) {
methodName = backend.namer.instanceMethodInvocationName(
node.selector.library, name, node.selector);
bool inLoop = node.block.enclosingLoopHeader != null;
« no previous file with comments | « no previous file | tests/compiler/dart2js/value_range_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698