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 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1831 } else if (constant.isSentinel()) { | 1831 } else if (constant.isSentinel()) { |
1832 // TODO(floitsch): get rid of the code buffer. | 1832 // TODO(floitsch): get rid of the code buffer. |
1833 CodeBuffer buffer = new CodeBuffer(); | 1833 CodeBuffer buffer = new CodeBuffer(); |
1834 backend.emitter.writeConstantToBuffer(constant, buffer); | 1834 backend.emitter.writeConstantToBuffer(constant, buffer); |
1835 push(new js.VariableUse(buffer.toString())); | 1835 push(new js.VariableUse(buffer.toString())); |
1836 } else { | 1836 } else { |
1837 compiler.internalError( | 1837 compiler.internalError( |
1838 "The compiler does not know how generate code for " | 1838 "The compiler does not know how generate code for " |
1839 "constant $constant"); | 1839 "constant $constant"); |
1840 } | 1840 } |
1841 } else if (constant.isType) { | |
floitsch
2012/11/16 13:53:31
isn't this doing exactly the same thing as the 'el
karlklose
2012/11/19 15:08:58
Yes. Removed.
| |
1842 String name = namer.constantName(constant); | |
1843 js.VariableUse currentIsolateUse = | |
1844 new js.VariableUse(backend.namer.CURRENT_ISOLATE); | |
1845 push(new js.PropertyAccess.field(currentIsolateUse, name)); | |
1841 } else { | 1846 } else { |
1842 String name = namer.constantName(constant); | 1847 String name = namer.constantName(constant); |
1843 js.VariableUse currentIsolateUse = | 1848 js.VariableUse currentIsolateUse = |
1844 new js.VariableUse(backend.namer.CURRENT_ISOLATE); | 1849 new js.VariableUse(backend.namer.CURRENT_ISOLATE); |
1845 push(new js.PropertyAccess.field(currentIsolateUse, name)); | 1850 push(new js.PropertyAccess.field(currentIsolateUse, name)); |
1846 } | 1851 } |
1847 } | 1852 } |
1848 | 1853 |
1849 visitConstant(HConstant node) { | 1854 visitConstant(HConstant node) { |
1850 assert(isGenerateAtUseSite(node)); | 1855 assert(isGenerateAtUseSite(node)); |
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3104 if (leftType.canBeNull() && rightType.canBeNull()) { | 3109 if (leftType.canBeNull() && rightType.canBeNull()) { |
3105 if (left.isConstantNull() || right.isConstantNull() || | 3110 if (left.isConstantNull() || right.isConstantNull() || |
3106 (leftType.isPrimitive() && leftType == rightType)) { | 3111 (leftType.isPrimitive() && leftType == rightType)) { |
3107 return '=='; | 3112 return '=='; |
3108 } | 3113 } |
3109 return null; | 3114 return null; |
3110 } else { | 3115 } else { |
3111 return '==='; | 3116 return '==='; |
3112 } | 3117 } |
3113 } | 3118 } |
OLD | NEW |