| 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 // Create an artificial type mask to make sure only | 1534 // Create an artificial type mask to make sure only |
| 1535 // [node.element] will be enqueued. We're not using the receiver | 1535 // [node.element] will be enqueued. We're not using the receiver |
| 1536 // type because our optimizations might end up in a state where the | 1536 // type because our optimizations might end up in a state where the |
| 1537 // invoke dynamic knows more than the receiver. | 1537 // invoke dynamic knows more than the receiver. |
| 1538 ClassElement enclosing = node.element.getEnclosingClass(); | 1538 ClassElement enclosing = node.element.getEnclosingClass(); |
| 1539 HType receiverType = new HType.fromMask( | 1539 HType receiverType = new HType.fromMask( |
| 1540 new TypeMask.nonNullExact(enclosing.declaration), | 1540 new TypeMask.nonNullExact(enclosing.declaration), |
| 1541 compiler); | 1541 compiler); |
| 1542 return receiverType.refine(selector, compiler); | 1542 return receiverType.refine(selector, compiler); |
| 1543 } | 1543 } |
| 1544 // If [JSInvocationMirror._invokeOn] has been called, we must not create a | 1544 // If [JSInvocationMirror._invokeOn] is enabled, and this call |
| 1545 // typed selector based on the receiver type. | 1545 // might hit a `noSuchMethod`, we register an untyped selector. |
| 1546 return backend.compiler.enabledInvokeOn ? selector.asUntyped : selector; | 1546 return selector.extendIfReachesAll(compiler); |
| 1547 } | 1547 } |
| 1548 | 1548 |
| 1549 void registerMethodInvoke(HInvokeDynamic node) { | 1549 void registerMethodInvoke(HInvokeDynamic node) { |
| 1550 Selector selector = getOptimizedSelectorFor(node, node.selector); | 1550 Selector selector = getOptimizedSelectorFor(node, node.selector); |
| 1551 | 1551 |
| 1552 // If we don't know what we're calling or if we are calling a getter, | 1552 // If we don't know what we're calling or if we are calling a getter, |
| 1553 // we need to register that fact that we may be calling a closure | 1553 // we need to register that fact that we may be calling a closure |
| 1554 // with the same arguments. | 1554 // with the same arguments. |
| 1555 Element target = node.element; | 1555 Element target = node.element; |
| 1556 if (target == null || target.isGetter()) { | 1556 if (target == null || target.isGetter()) { |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2589 if (leftType.canBeNull() && rightType.canBeNull()) { | 2589 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 2590 if (left.isConstantNull() || right.isConstantNull() || | 2590 if (left.isConstantNull() || right.isConstantNull() || |
| 2591 (leftType.isPrimitive(compiler) && leftType == rightType)) { | 2591 (leftType.isPrimitive(compiler) && leftType == rightType)) { |
| 2592 return '=='; | 2592 return '=='; |
| 2593 } | 2593 } |
| 2594 return null; | 2594 return null; |
| 2595 } else { | 2595 } else { |
| 2596 return '==='; | 2596 return '==='; |
| 2597 } | 2597 } |
| 2598 } | 2598 } |
| OLD | NEW |