| 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 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 int len = node.inputs.length; | 2159 int len = node.inputs.length; |
| 2160 List<js.ArrayElement> elements = <js.ArrayElement>[]; | 2160 List<js.ArrayElement> elements = <js.ArrayElement>[]; |
| 2161 for (int i = 0; i < len; i++) { | 2161 for (int i = 0; i < len; i++) { |
| 2162 use(node.inputs[i]); | 2162 use(node.inputs[i]); |
| 2163 elements.add(new js.ArrayElement(i, pop())); | 2163 elements.add(new js.ArrayElement(i, pop())); |
| 2164 } | 2164 } |
| 2165 push(new js.ArrayInitializer(len, elements), node); | 2165 push(new js.ArrayInitializer(len, elements), node); |
| 2166 } | 2166 } |
| 2167 | 2167 |
| 2168 void visitIndex(HIndex node) { | 2168 void visitIndex(HIndex node) { |
| 2169 if (node.isBuiltin(types)) { | 2169 use(node.receiver); |
| 2170 use(node.inputs[1]); | 2170 js.Expression receiver = pop(); |
| 2171 js.Expression receiver = pop(); | 2171 use(node.index); |
| 2172 use(node.inputs[2]); | 2172 push(new js.PropertyAccess(receiver, pop()), node); |
| 2173 push(new js.PropertyAccess(receiver, pop()), node); | |
| 2174 } else { | |
| 2175 visitInvokeStatic(node); | |
| 2176 } | |
| 2177 } | 2173 } |
| 2178 | 2174 |
| 2179 void visitIndexAssign(HIndexAssign node) { | 2175 void visitIndexAssign(HIndexAssign node) { |
| 2180 if (node.isBuiltin(types)) { | 2176 if (node.isBuiltin(types)) { |
| 2181 use(node.inputs[1]); | 2177 use(node.inputs[1]); |
| 2182 js.Expression receiver = pop(); | 2178 js.Expression receiver = pop(); |
| 2183 use(node.inputs[2]); | 2179 use(node.inputs[2]); |
| 2184 js.Expression index = pop(); | 2180 js.Expression index = pop(); |
| 2185 use(node.inputs[3]); | 2181 use(node.inputs[3]); |
| 2186 push(new js.Assignment(new js.PropertyAccess(receiver, index), pop()), | 2182 push(new js.Assignment(new js.PropertyAccess(receiver, index), pop()), |
| (...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3050 if (leftType.canBeNull() && rightType.canBeNull()) { | 3046 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 3051 if (left.isConstantNull() || right.isConstantNull() || | 3047 if (left.isConstantNull() || right.isConstantNull() || |
| 3052 (leftType.isPrimitive() && leftType == rightType)) { | 3048 (leftType.isPrimitive() && leftType == rightType)) { |
| 3053 return '=='; | 3049 return '=='; |
| 3054 } | 3050 } |
| 3055 return null; | 3051 return null; |
| 3056 } else { | 3052 } else { |
| 3057 return '==='; | 3053 return '==='; |
| 3058 } | 3054 } |
| 3059 } | 3055 } |
| OLD | NEW |