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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 */ | 254 */ |
255 void pushStatement(js.Statement statement, [HInstruction instruction]) { | 255 void pushStatement(js.Statement statement, [HInstruction instruction]) { |
256 assert(expressionStack.isEmpty); | 256 assert(expressionStack.isEmpty); |
257 if (instruction != null) { | 257 if (instruction != null) { |
258 attachLocation(statement, instruction); | 258 attachLocation(statement, instruction); |
259 } | 259 } |
260 currentContainer.statements.add(statement); | 260 currentContainer.statements.add(statement); |
261 } | 261 } |
262 | 262 |
263 void insertStatementAtStart(js.Statement statement) { | 263 void insertStatementAtStart(js.Statement statement) { |
264 currentContainer.statements.insertRange(0, 1, statement); | 264 currentContainer.statements.insert(0, statement); |
265 } | 265 } |
266 | 266 |
267 /** | 267 /** |
268 * If the [instruction] is not `null` it will be used to attach the position | 268 * If the [instruction] is not `null` it will be used to attach the position |
269 * to the [expression]. | 269 * to the [expression]. |
270 */ | 270 */ |
271 pushExpressionAsStatement(js.Expression expression, | 271 pushExpressionAsStatement(js.Expression expression, |
272 [HInstruction instruction]) { | 272 [HInstruction instruction]) { |
273 pushStatement(new js.ExpressionStatement(expression), instruction); | 273 pushStatement(new js.ExpressionStatement(expression), instruction); |
274 } | 274 } |
(...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2987 if (leftType.canBeNull() && rightType.canBeNull()) { | 2987 if (leftType.canBeNull() && rightType.canBeNull()) { |
2988 if (left.isConstantNull() || right.isConstantNull() || | 2988 if (left.isConstantNull() || right.isConstantNull() || |
2989 (leftType.isPrimitive() && leftType == rightType)) { | 2989 (leftType.isPrimitive() && leftType == rightType)) { |
2990 return '=='; | 2990 return '=='; |
2991 } | 2991 } |
2992 return null; | 2992 return null; |
2993 } else { | 2993 } else { |
2994 return '==='; | 2994 return '==='; |
2995 } | 2995 } |
2996 } | 2996 } |
OLD | NEW |