Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 11419056: Forgot to change the condition to be true in a do/while loop that has phi updates: the condition ha… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/do_while3_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/do_while3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698