| 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 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 | 1789 |
| 1790 // TODO(sra): Tell world.nativeEnqueuer about the types created here. | 1790 // TODO(sra): Tell world.nativeEnqueuer about the types created here. |
| 1791 registerForeignTypes(node); | 1791 registerForeignTypes(node); |
| 1792 } | 1792 } |
| 1793 | 1793 |
| 1794 visitForeignNew(HForeignNew node) { | 1794 visitForeignNew(HForeignNew node) { |
| 1795 String jsClassReference = backend.namer.isolateAccess(node.element); | 1795 String jsClassReference = backend.namer.isolateAccess(node.element); |
| 1796 List<js.Expression> arguments = visitArguments(node.inputs, start: 0); | 1796 List<js.Expression> arguments = visitArguments(node.inputs, start: 0); |
| 1797 // TODO(floitsch): jsClassReference is an Access. We shouldn't treat it | 1797 // TODO(floitsch): jsClassReference is an Access. We shouldn't treat it |
| 1798 // as if it was a string. | 1798 // as if it was a string. |
| 1799 js.Expression constructor = new js.VariableUse(jsClassReference); | 1799 push(new js.New(new js.VariableUse(jsClassReference), arguments), node); |
| 1800 push(new js.New(constructor, arguments), node); | |
| 1801 registerForeignTypes(node); | 1800 registerForeignTypes(node); |
| 1802 if (node.instantiatedTypes == null) { | 1801 if (node.instantiatedTypes == null) { |
| 1803 return; | 1802 return; |
| 1804 } | 1803 } |
| 1805 node.instantiatedTypes.forEach((type) { | 1804 node.instantiatedTypes.forEach((type) { |
| 1806 world.registerInstantiatedType(type, work.resolutionTree); | 1805 world.registerInstantiatedType(type, work.resolutionTree); |
| 1807 }); | 1806 }); |
| 1808 } | 1807 } |
| 1809 | 1808 |
| 1810 js.Expression newLiteralBool(bool value) { | 1809 js.Expression newLiteralBool(bool value) { |
| (...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3053 if (leftType.canBeNull() && rightType.canBeNull()) { | 3052 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 3054 if (left.isConstantNull() || right.isConstantNull() || | 3053 if (left.isConstantNull() || right.isConstantNull() || |
| 3055 (leftType.isPrimitive(compiler) && leftType == rightType)) { | 3054 (leftType.isPrimitive(compiler) && leftType == rightType)) { |
| 3056 return '=='; | 3055 return '=='; |
| 3057 } | 3056 } |
| 3058 return null; | 3057 return null; |
| 3059 } else { | 3058 } else { |
| 3060 return '==='; | 3059 return '==='; |
| 3061 } | 3060 } |
| 3062 } | 3061 } |
| OLD | NEW |