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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 */ | 227 */ |
228 void pushStatement(js.Statement statement, [HInstruction instruction]) { | 228 void pushStatement(js.Statement statement, [HInstruction instruction]) { |
229 assert(expressionStack.isEmpty); | 229 assert(expressionStack.isEmpty); |
230 if (instruction != null) { | 230 if (instruction != null) { |
231 attachLocation(statement, instruction); | 231 attachLocation(statement, instruction); |
232 } | 232 } |
233 currentContainer.statements.add(statement); | 233 currentContainer.statements.add(statement); |
234 } | 234 } |
235 | 235 |
236 void insertStatementAtStart(js.Statement statement) { | 236 void insertStatementAtStart(js.Statement statement) { |
237 currentContainer.statements.insertRange(0, 1, statement); | 237 currentContainer.statements.insert(0, statement); |
238 } | 238 } |
239 | 239 |
240 /** | 240 /** |
241 * If the [instruction] is not `null` it will be used to attach the position | 241 * If the [instruction] is not `null` it will be used to attach the position |
242 * to the [expression]. | 242 * to the [expression]. |
243 */ | 243 */ |
244 pushExpressionAsStatement(js.Expression expression, | 244 pushExpressionAsStatement(js.Expression expression, |
245 [HInstruction instruction]) { | 245 [HInstruction instruction]) { |
246 pushStatement(new js.ExpressionStatement(expression), instruction); | 246 pushStatement(new js.ExpressionStatement(expression), instruction); |
247 } | 247 } |
(...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2960 if (leftType.canBeNull() && rightType.canBeNull()) { | 2960 if (leftType.canBeNull() && rightType.canBeNull()) { |
2961 if (left.isConstantNull() || right.isConstantNull() || | 2961 if (left.isConstantNull() || right.isConstantNull() || |
2962 (leftType.isPrimitive() && leftType == rightType)) { | 2962 (leftType.isPrimitive() && leftType == rightType)) { |
2963 return '=='; | 2963 return '=='; |
2964 } | 2964 } |
2965 return null; | 2965 return null; |
2966 } else { | 2966 } else { |
2967 return '==='; | 2967 return '==='; |
2968 } | 2968 } |
2969 } | 2969 } |
OLD | NEW |