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

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

Issue 23496037: Turn a Dart String + String into a JavaScript String + String. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of ssa; 5 part of ssa;
6 6
7 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 10
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 if (target == backend.jsArrayAdd) { 1499 if (target == backend.jsArrayAdd) {
1500 methodName = 'push'; 1500 methodName = 'push';
1501 } else if (target == backend.jsArrayRemoveLast) { 1501 } else if (target == backend.jsArrayRemoveLast) {
1502 methodName = 'pop'; 1502 methodName = 'pop';
1503 } else if (target == backend.jsStringSplit) { 1503 } else if (target == backend.jsStringSplit) {
1504 methodName = 'split'; 1504 methodName = 'split';
1505 // Split returns a List, so we make sure the backend knows the 1505 // Split returns a List, so we make sure the backend knows the
1506 // list class is instantiated. 1506 // list class is instantiated.
1507 world.registerInstantiatedClass( 1507 world.registerInstantiatedClass(
1508 compiler.listClass, work.resolutionTree); 1508 compiler.listClass, work.resolutionTree);
1509 } else if (target == backend.jsStringConcat) { 1509 } else if (target == backend.jsStringOperatorAdd) {
1510 push(new js.Binary('+', object, arguments[0]), node); 1510 push(new js.Binary('+', object, arguments[0]), node);
1511 return; 1511 return;
1512 } else if (target.isNative() && target.isFunction() 1512 } else if (target.isNative() && target.isFunction()
1513 && !node.isInterceptedCall) { 1513 && !node.isInterceptedCall) {
1514 // A direct (i.e. non-interceptor) native call is the result of 1514 // A direct (i.e. non-interceptor) native call is the result of
1515 // optimization. The optimization ensures any type checks or 1515 // optimization. The optimization ensures any type checks or
1516 // conversions have been satisified. 1516 // conversions have been satisified.
1517 methodName = target.fixedBackendName(); 1517 methodName = target.fixedBackendName();
1518 } 1518 }
1519 } 1519 }
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after
2991 if (leftType.canBeNull() && rightType.canBeNull()) { 2991 if (leftType.canBeNull() && rightType.canBeNull()) {
2992 if (left.isConstantNull() || right.isConstantNull() || 2992 if (left.isConstantNull() || right.isConstantNull() ||
2993 (leftType.isPrimitive(compiler) && leftType == rightType)) { 2993 (leftType.isPrimitive(compiler) && leftType == rightType)) {
2994 return '=='; 2994 return '==';
2995 } 2995 }
2996 return null; 2996 return null;
2997 } else { 2997 } else {
2998 return '==='; 2998 return '===';
2999 } 2999 }
3000 } 3000 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698