Chromium Code Reviews| 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 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1748 } | 1748 } |
| 1749 pushStatement(new js.LiteralStatement(code), node); | 1749 pushStatement(new js.LiteralStatement(code), node); |
| 1750 } else { | 1750 } else { |
| 1751 List<js.Expression> data = <js.Expression>[]; | 1751 List<js.Expression> data = <js.Expression>[]; |
| 1752 for (int i = 0; i < inputs.length; i++) { | 1752 for (int i = 0; i < inputs.length; i++) { |
| 1753 use(inputs[i]); | 1753 use(inputs[i]); |
| 1754 data.add(pop()); | 1754 data.add(pop()); |
| 1755 } | 1755 } |
| 1756 push(new js.LiteralExpression.withData(code, data), node); | 1756 push(new js.LiteralExpression.withData(code, data), node); |
| 1757 } | 1757 } |
| 1758 // TODO(sra): Tell world.nativeEnqueuer about the types created here. | |
| 1759 //print('JS: ${node} $code'); | |
| 1760 //enqueuer.codegen.nativeEnqueuer.xxx | |
|
ngeoffray
2012/11/08 08:18:01
That is the right place to do it for the codegen e
| |
| 1758 } | 1761 } |
| 1759 | 1762 |
| 1760 visitForeignNew(HForeignNew node) { | 1763 visitForeignNew(HForeignNew node) { |
| 1761 visitedForeignCode = true; | 1764 visitedForeignCode = true; |
| 1762 String jsClassReference = backend.namer.isolateAccess(node.element); | 1765 String jsClassReference = backend.namer.isolateAccess(node.element); |
| 1763 List<HInstruction> inputs = node.inputs; | 1766 List<HInstruction> inputs = node.inputs; |
| 1764 // We can't use 'visitArguments', since our arguments start at input[0]. | 1767 // We can't use 'visitArguments', since our arguments start at input[0]. |
| 1765 List<js.Expression> arguments = <js.Expression>[]; | 1768 List<js.Expression> arguments = <js.Expression>[]; |
| 1766 for (int i = 0; i < inputs.length; i++) { | 1769 for (int i = 0; i < inputs.length; i++) { |
| 1767 use(inputs[i]); | 1770 use(inputs[i]); |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3080 if (leftType.canBeNull() && rightType.canBeNull()) { | 3083 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 3081 if (left.isConstantNull() || right.isConstantNull() || | 3084 if (left.isConstantNull() || right.isConstantNull() || |
| 3082 (leftType.isPrimitive() && leftType == rightType)) { | 3085 (leftType.isPrimitive() && leftType == rightType)) { |
| 3083 return '=='; | 3086 return '=='; |
| 3084 } | 3087 } |
| 3085 return null; | 3088 return null; |
| 3086 } else { | 3089 } else { |
| 3087 return '==='; | 3090 return '==='; |
| 3088 } | 3091 } |
| 3089 } | 3092 } |
| OLD | NEW |