| 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 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 push(generateExpression(condition)); | 977 push(generateExpression(condition)); |
| 978 } else { | 978 } else { |
| 979 generateStatements(condition); | 979 generateStatements(condition); |
| 980 use(condition.conditionExpression); | 980 use(condition.conditionExpression); |
| 981 } | 981 } |
| 982 js.Expression jsCondition = pop(); | 982 js.Expression jsCondition = pop(); |
| 983 if (hasPhiUpdates) { | 983 if (hasPhiUpdates) { |
| 984 updateBody.statements.add(new js.Continue(null)); | 984 updateBody.statements.add(new js.Continue(null)); |
| 985 body.statements.add( | 985 body.statements.add( |
| 986 new js.If(jsCondition, updateBody, new js.Break(null))); | 986 new js.If(jsCondition, updateBody, new js.Break(null))); |
| 987 jsCondition = newLiteralBool(true); |
| 987 } | 988 } |
| 988 loop = new js.Do(unwrapStatement(body), jsCondition); | 989 loop = new js.Do(unwrapStatement(body), jsCondition); |
| 989 currentContainer = oldContainer; | 990 currentContainer = oldContainer; |
| 990 break; | 991 break; |
| 991 default: | 992 default: |
| 992 compiler.internalError( | 993 compiler.internalError( |
| 993 'Unexpected loop kind: ${info.kind}', | 994 'Unexpected loop kind: ${info.kind}', |
| 994 instruction: condition.conditionExpression); | 995 instruction: condition.conditionExpression); |
| 995 } | 996 } |
| 996 attachLocationRange(loop, info.sourcePosition, info.endSourcePosition); | 997 attachLocationRange(loop, info.sourcePosition, info.endSourcePosition); |
| (...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3103 if (leftType.canBeNull() && rightType.canBeNull()) { | 3104 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 3104 if (left.isConstantNull() || right.isConstantNull() || | 3105 if (left.isConstantNull() || right.isConstantNull() || |
| 3105 (leftType.isPrimitive() && leftType == rightType)) { | 3106 (leftType.isPrimitive() && leftType == rightType)) { |
| 3106 return '=='; | 3107 return '=='; |
| 3107 } | 3108 } |
| 3108 return null; | 3109 return null; |
| 3109 } else { | 3110 } else { |
| 3110 return '==='; | 3111 return '==='; |
| 3111 } | 3112 } |
| 3112 } | 3113 } |
| OLD | NEW |