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 | 10 |
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1553 registerGetter(node); | 1553 registerGetter(node); |
1554 } else if (selector.isSetter()) { | 1554 } else if (selector.isSetter()) { |
1555 registerSetter(node); | 1555 registerSetter(node); |
1556 } else { | 1556 } else { |
1557 registerMethodInvoke(node); | 1557 registerMethodInvoke(node); |
1558 } | 1558 } |
1559 } | 1559 } |
1560 | 1560 |
1561 Selector getOptimizedSelectorFor(HInvokeDynamic node, | 1561 Selector getOptimizedSelectorFor(HInvokeDynamic node, |
1562 Selector defaultSelector) { | 1562 Selector defaultSelector) { |
1563 // TODO(4434): For private members we need to use the untyped selector. | |
1564 if (defaultSelector.name.isPrivate()) return defaultSelector; | |
1565 // TODO(ngeoffray): Type intercepted calls. | 1563 // TODO(ngeoffray): Type intercepted calls. |
1566 if (node.isInterceptorCall) return defaultSelector; | 1564 if (node.isInterceptorCall) return defaultSelector; |
1567 // If [JSInvocationMirror.invokeOn] has been called, we must not create a | 1565 // If [JSInvocationMirror.invokeOn] has been called, we must not create a |
1568 // typed selector based on the receiver type. | 1566 // typed selector based on the receiver type. |
1569 if (node.element == null && // Invocation is not exact. | 1567 if (node.element == null && // Invocation is not exact. |
1570 backend.compiler.enabledInvokeOn) { | 1568 backend.compiler.enabledInvokeOn) { |
1571 return defaultSelector; | 1569 return defaultSelector; |
1572 } | 1570 } |
1573 HType receiverHType = types[node.inputs[0]]; | 1571 HType receiverHType = types[node.inputs[0]]; |
1574 DartType receiverType = receiverHType.computeType(compiler); | 1572 DartType receiverType = receiverHType.computeType(compiler); |
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3003 if (leftType.canBeNull() && rightType.canBeNull()) { | 3001 if (leftType.canBeNull() && rightType.canBeNull()) { |
3004 if (left.isConstantNull() || right.isConstantNull() || | 3002 if (left.isConstantNull() || right.isConstantNull() || |
3005 (leftType.isPrimitive() && leftType == rightType)) { | 3003 (leftType.isPrimitive() && leftType == rightType)) { |
3006 return '=='; | 3004 return '=='; |
3007 } | 3005 } |
3008 return null; | 3006 return null; |
3009 } else { | 3007 } else { |
3010 return '==='; | 3008 return '==='; |
3011 } | 3009 } |
3012 } | 3010 } |
OLD | NEW |