| OLD | NEW |
| 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 final SourceInformationStrategy sourceInformationFactory; | 10 final SourceInformationStrategy sourceInformationFactory; |
| (...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 if (target != null && !node.isInterceptedCall) { | 1541 if (target != null && !node.isInterceptedCall) { |
| 1542 if (target == backend.jsArrayAdd) { | 1542 if (target == backend.jsArrayAdd) { |
| 1543 methodName = 'push'; | 1543 methodName = 'push'; |
| 1544 } else if (target == backend.jsArrayRemoveLast) { | 1544 } else if (target == backend.jsArrayRemoveLast) { |
| 1545 methodName = 'pop'; | 1545 methodName = 'pop'; |
| 1546 } else if (target == backend.jsStringSplit) { | 1546 } else if (target == backend.jsStringSplit) { |
| 1547 methodName = 'split'; | 1547 methodName = 'split'; |
| 1548 // Split returns a List, so we make sure the backend knows the | 1548 // Split returns a List, so we make sure the backend knows the |
| 1549 // list class is instantiated. | 1549 // list class is instantiated. |
| 1550 registry.registerInstantiatedClass(compiler.listClass); | 1550 registry.registerInstantiatedClass(compiler.listClass); |
| 1551 } else if (target.isNative && target.isFunction | 1551 } else if (backend.isNative(target) && target.isFunction |
| 1552 && !node.isInterceptedCall) { | 1552 && !node.isInterceptedCall) { |
| 1553 // A direct (i.e. non-interceptor) native call is the result of | 1553 // A direct (i.e. non-interceptor) native call is the result of |
| 1554 // optimization. The optimization ensures any type checks or | 1554 // optimization. The optimization ensures any type checks or |
| 1555 // conversions have been satisified. | 1555 // conversions have been satisified. |
| 1556 methodName = target.fixedBackendName; | 1556 methodName = backend.getFixedBackendName(target); |
| 1557 } | 1557 } |
| 1558 } | 1558 } |
| 1559 | 1559 |
| 1560 js.Name methodLiteral; | 1560 js.Name methodLiteral; |
| 1561 if (methodName == null) { | 1561 if (methodName == null) { |
| 1562 methodLiteral = backend.namer.invocationName(node.selector); | 1562 methodLiteral = backend.namer.invocationName(node.selector); |
| 1563 registerMethodInvoke(node); | 1563 registerMethodInvoke(node); |
| 1564 } else { | 1564 } else { |
| 1565 methodLiteral = backend.namer.asName(methodName); | 1565 methodLiteral = backend.namer.asName(methodName); |
| 1566 } | 1566 } |
| (...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2880 } | 2880 } |
| 2881 registry.registerStaticUse(helper); | 2881 registry.registerStaticUse(helper); |
| 2882 return backend.emitter.staticFunctionAccess(helper); | 2882 return backend.emitter.staticFunctionAccess(helper); |
| 2883 } | 2883 } |
| 2884 | 2884 |
| 2885 @override | 2885 @override |
| 2886 void visitRef(HRef node) { | 2886 void visitRef(HRef node) { |
| 2887 visit(node.value); | 2887 visit(node.value); |
| 2888 } | 2888 } |
| 2889 } | 2889 } |
| OLD | NEW |