| 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 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 } | 1765 } |
| 1766 pushStatement(new js.LiteralStatement(code), node); | 1766 pushStatement(new js.LiteralStatement(code), node); |
| 1767 } else { | 1767 } else { |
| 1768 List<js.Expression> data = <js.Expression>[]; | 1768 List<js.Expression> data = <js.Expression>[]; |
| 1769 for (int i = 0; i < inputs.length; i++) { | 1769 for (int i = 0; i < inputs.length; i++) { |
| 1770 use(inputs[i]); | 1770 use(inputs[i]); |
| 1771 data.add(pop()); | 1771 data.add(pop()); |
| 1772 } | 1772 } |
| 1773 push(new js.LiteralExpression.withData(code, data), node); | 1773 push(new js.LiteralExpression.withData(code, data), node); |
| 1774 } | 1774 } |
| 1775 // TODO(sra): Tell world.nativeEnqueuer about the types created here. |
| 1775 } | 1776 } |
| 1776 | 1777 |
| 1777 visitForeignNew(HForeignNew node) { | 1778 visitForeignNew(HForeignNew node) { |
| 1778 visitedForeignCode = true; | 1779 visitedForeignCode = true; |
| 1779 String jsClassReference = backend.namer.isolateAccess(node.element); | 1780 String jsClassReference = backend.namer.isolateAccess(node.element); |
| 1780 List<HInstruction> inputs = node.inputs; | 1781 List<HInstruction> inputs = node.inputs; |
| 1781 // We can't use 'visitArguments', since our arguments start at input[0]. | 1782 // We can't use 'visitArguments', since our arguments start at input[0]. |
| 1782 List<js.Expression> arguments = <js.Expression>[]; | 1783 List<js.Expression> arguments = <js.Expression>[]; |
| 1783 for (int i = 0; i < inputs.length; i++) { | 1784 for (int i = 0; i < inputs.length; i++) { |
| 1784 use(inputs[i]); | 1785 use(inputs[i]); |
| (...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3101 if (leftType.canBeNull() && rightType.canBeNull()) { | 3102 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 3102 if (left.isConstantNull() || right.isConstantNull() || | 3103 if (left.isConstantNull() || right.isConstantNull() || |
| 3103 (leftType.isPrimitive() && leftType == rightType)) { | 3104 (leftType.isPrimitive() && leftType == rightType)) { |
| 3104 return '=='; | 3105 return '=='; |
| 3105 } | 3106 } |
| 3106 return null; | 3107 return null; |
| 3107 } else { | 3108 } else { |
| 3108 return '==='; | 3109 return '==='; |
| 3109 } | 3110 } |
| 3110 } | 3111 } |
| OLD | NEW |