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

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

Issue 11363119: Fix for do/while: if there are phi copies after the condition, emit the non-pretty while loop. (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
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 abstract class HVisitor<R> { 7 abstract class HVisitor<R> {
8 R visitAdd(HAdd node); 8 R visitAdd(HAdd node);
9 R visitBailoutTarget(HBailoutTarget node); 9 R visitBailoutTarget(HBailoutTarget node);
10 R visitBitAnd(HBitAnd node); 10 R visitBitAnd(HBitAnd node);
(...skipping 2909 matching lines...) Expand 10 before | Expand all | Expand 10 after
2920 } 2920 }
2921 return condition.start; 2921 return condition.start;
2922 } 2922 }
2923 2923
2924 HBasicBlock get loopHeader { 2924 HBasicBlock get loopHeader {
2925 return kind == DO_WHILE_LOOP ? body.start : condition.start; 2925 return kind == DO_WHILE_LOOP ? body.start : condition.start;
2926 } 2926 }
2927 2927
2928 HBasicBlock get end { 2928 HBasicBlock get end {
2929 if (updates != null) return updates.end; 2929 if (updates != null) return updates.end;
2930 if (kind == DO_WHILE_LOOP) { 2930 if (kind == DO_WHILE_LOOP && condition != null) {
2931 return condition.end; 2931 return condition.end;
2932 } 2932 }
2933 return body.end; 2933 return body.end;
2934 } 2934 }
2935 2935
2936 static int loopType(Node node) { 2936 static int loopType(Node node) {
2937 return node.accept(const LoopTypeVisitor()); 2937 return node.accept(const LoopTypeVisitor());
2938 } 2938 }
2939 2939
2940 bool accept(HStatementInformationVisitor visitor) => 2940 bool accept(HStatementInformationVisitor visitor) =>
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
3015 HBasicBlock get start => expression.start; 3015 HBasicBlock get start => expression.start;
3016 HBasicBlock get end { 3016 HBasicBlock get end {
3017 // We don't create a switch block if there are no cases. 3017 // We don't create a switch block if there are no cases.
3018 assert(!statements.isEmpty); 3018 assert(!statements.isEmpty);
3019 return statements.last.end; 3019 return statements.last.end;
3020 } 3020 }
3021 3021
3022 bool accept(HStatementInformationVisitor visitor) => 3022 bool accept(HStatementInformationVisitor visitor) =>
3023 visitor.visitSwitchInfo(this); 3023 visitor.visitSwitchInfo(this);
3024 } 3024 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | tests/language/do_while2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698