| 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 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 world.registerDynamicInvocation(name, selector); | 1508 world.registerDynamicInvocation(name, selector); |
| 1509 } | 1509 } |
| 1510 } | 1510 } |
| 1511 push(jsPropertyCall(object, methodName, arguments), node); | 1511 push(jsPropertyCall(object, methodName, arguments), node); |
| 1512 } | 1512 } |
| 1513 | 1513 |
| 1514 Selector getOptimizedSelectorFor(HInvokeDynamic node, | 1514 Selector getOptimizedSelectorFor(HInvokeDynamic node, |
| 1515 Selector defaultSelector) { | 1515 Selector defaultSelector) { |
| 1516 // TODO(4434): For private members we need to use the untyped selector. | 1516 // TODO(4434): For private members we need to use the untyped selector. |
| 1517 if (defaultSelector.name.isPrivate()) return defaultSelector; | 1517 if (defaultSelector.name.isPrivate()) return defaultSelector; |
| 1518 // If [JSInvocationMirror.invokeOn] has been called, we must not create a | |
| 1519 // typed selector based on the receiver type. | |
| 1520 if (node.element == null && // Invocation is not exact. | |
| 1521 backend.compiler.enabledInvokeOn) { | |
| 1522 return defaultSelector; | |
| 1523 } | |
| 1524 HType receiverHType = types[node.inputs[0]]; | 1518 HType receiverHType = types[node.inputs[0]]; |
| 1525 DartType receiverType = receiverHType.computeType(compiler); | 1519 DartType receiverType = receiverHType.computeType(compiler); |
| 1526 if (receiverType != null) { | 1520 if (receiverType != null) { |
| 1527 return new TypedSelector(receiverType, defaultSelector); | 1521 return new TypedSelector(receiverType, defaultSelector); |
| 1528 } else { | 1522 } else { |
| 1529 return defaultSelector; | 1523 return defaultSelector; |
| 1530 } | 1524 } |
| 1531 } | 1525 } |
| 1532 | 1526 |
| 1533 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { | 1527 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { |
| (...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3000 if (leftType.canBeNull() && rightType.canBeNull()) { | 2994 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 3001 if (left.isConstantNull() || right.isConstantNull() || | 2995 if (left.isConstantNull() || right.isConstantNull() || |
| 3002 (leftType.isPrimitive() && leftType == rightType)) { | 2996 (leftType.isPrimitive() && leftType == rightType)) { |
| 3003 return '=='; | 2997 return '=='; |
| 3004 } | 2998 } |
| 3005 return null; | 2999 return null; |
| 3006 } else { | 3000 } else { |
| 3007 return '==='; | 3001 return '==='; |
| 3008 } | 3002 } |
| 3009 } | 3003 } |
| OLD | NEW |