| 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 class SsaCodeGeneratorTask extends CompilerTask { | 5 class SsaCodeGeneratorTask extends CompilerTask { |
| 6 | 6 |
| 7 final JavaScriptBackend backend; | 7 final JavaScriptBackend backend; |
| 8 | 8 |
| 9 SsaCodeGeneratorTask(JavaScriptBackend backend) | 9 SsaCodeGeneratorTask(JavaScriptBackend backend) |
| 10 : this.backend = backend, | 10 : this.backend = backend, |
| (...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 } | 1542 } |
| 1543 | 1543 |
| 1544 visitInvokeClosure(HInvokeClosure node) { | 1544 visitInvokeClosure(HInvokeClosure node) { |
| 1545 use(node.receiver); | 1545 use(node.receiver); |
| 1546 push(jsPropertyCall(pop(), | 1546 push(jsPropertyCall(pop(), |
| 1547 backend.namer.closureInvocationName(node.selector), | 1547 backend.namer.closureInvocationName(node.selector), |
| 1548 visitArguments(node.inputs)), | 1548 visitArguments(node.inputs)), |
| 1549 node); | 1549 node); |
| 1550 Selector call = new Selector.callClosureFrom(node.selector); | 1550 Selector call = new Selector.callClosureFrom(node.selector); |
| 1551 world.registerDynamicInvocation(call.name, call); | 1551 world.registerDynamicInvocation(call.name, call); |
| 1552 // A closure can also be invoked through [HInvokeDynamicMethod] by |
| 1553 // explicitly calling the [:call:] method. Therefore, we must also |
| 1554 // register types here to let the backend invalidate wrong |
| 1555 // optimizations. |
| 1556 backend.registerDynamicInvocation(node, call, types); |
| 1552 } | 1557 } |
| 1553 | 1558 |
| 1554 visitInvokeStatic(HInvokeStatic node) { | 1559 visitInvokeStatic(HInvokeStatic node) { |
| 1555 if (true && | 1560 if (true && |
| 1556 (node.typeCode() == HInstruction.INVOKE_STATIC_TYPECODE || | 1561 (node.typeCode() == HInstruction.INVOKE_STATIC_TYPECODE || |
| 1557 node.typeCode() == HInstruction.INVOKE_INTERCEPTOR_TYPECODE)) { | 1562 node.typeCode() == HInstruction.INVOKE_INTERCEPTOR_TYPECODE)) { |
| 1558 // Register this invocation to collect the types used at all call sites. | 1563 // Register this invocation to collect the types used at all call sites. |
| 1559 backend.registerStaticInvocation(node, types); | 1564 backend.registerStaticInvocation(node, types); |
| 1560 } | 1565 } |
| 1561 use(node.target); | 1566 use(node.target); |
| (...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2983 if (leftType.canBeNull() && rightType.canBeNull()) { | 2988 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 2984 if (left.isConstantNull() || right.isConstantNull() || | 2989 if (left.isConstantNull() || right.isConstantNull() || |
| 2985 (leftType.isPrimitive() && leftType == rightType)) { | 2990 (leftType.isPrimitive() && leftType == rightType)) { |
| 2986 return '=='; | 2991 return '=='; |
| 2987 } | 2992 } |
| 2988 return null; | 2993 return null; |
| 2989 } else { | 2994 } else { |
| 2990 return '==='; | 2995 return '==='; |
| 2991 } | 2996 } |
| 2992 } | 2997 } |
| OLD | NEW |