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 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1534 world.registerDynamicInvocation(name, selector); | 1534 world.registerDynamicInvocation(name, selector); |
1535 } | 1535 } |
1536 } | 1536 } |
1537 push(jsPropertyCall(object, methodName, arguments), node); | 1537 push(jsPropertyCall(object, methodName, arguments), node); |
1538 } | 1538 } |
1539 | 1539 |
1540 Selector getOptimizedSelectorFor(HInvokeDynamic node, | 1540 Selector getOptimizedSelectorFor(HInvokeDynamic node, |
1541 Selector defaultSelector) { | 1541 Selector defaultSelector) { |
1542 // TODO(4434): For private members we need to use the untyped selector. | 1542 // TODO(4434): For private members we need to use the untyped selector. |
1543 if (defaultSelector.name.isPrivate()) return defaultSelector; | 1543 if (defaultSelector.name.isPrivate()) return defaultSelector; |
1544 // If [JSInvocationMirror.invokeOn] has been called, we must not create a | |
1545 // typed selector based on the receiver type. | |
1546 if (node.element == null && // Invocation is not exact. | |
1547 backend.compiler.enabledInvokeOn) { | |
1548 return defaultSelector; | |
1549 } | |
1550 HType receiverHType = types[node.inputs[0]]; | 1544 HType receiverHType = types[node.inputs[0]]; |
1551 DartType receiverType = receiverHType.computeType(compiler); | 1545 DartType receiverType = receiverHType.computeType(compiler); |
1552 if (receiverType != null) { | 1546 if (receiverType != null) { |
1553 return new TypedSelector(receiverType, defaultSelector); | 1547 return new TypedSelector(receiverType, defaultSelector); |
1554 } else { | 1548 } else { |
1555 return defaultSelector; | 1549 return defaultSelector; |
1556 } | 1550 } |
1557 } | 1551 } |
1558 | 1552 |
1559 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { | 1553 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { |
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3026 if (leftType.canBeNull() && rightType.canBeNull()) { | 3020 if (leftType.canBeNull() && rightType.canBeNull()) { |
3027 if (left.isConstantNull() || right.isConstantNull() || | 3021 if (left.isConstantNull() || right.isConstantNull() || |
3028 (leftType.isPrimitive() && leftType == rightType)) { | 3022 (leftType.isPrimitive() && leftType == rightType)) { |
3029 return '=='; | 3023 return '=='; |
3030 } | 3024 } |
3031 return null; | 3025 return null; |
3032 } else { | 3026 } else { |
3033 return '==='; | 3027 return '==='; |
3034 } | 3028 } |
3035 } | 3029 } |
OLD | NEW |