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

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

Issue 12082074: Fix another bailout problem where not all blocks were visiting when propagating bailout information… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | tests/language/bailout6_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (revision 17870)
+++ sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (working copy)
@@ -1857,6 +1857,23 @@
bool isDoWhile() {
return identical(kind, DO_WHILE_LOOP);
}
+
+ HBasicBlock computeLoopHeader() {
+ HBasicBlock result;
+ if (isDoWhile()) {
+ // In case of a do/while, the successor is a block that avoids
+ // a critical edge and branchs to the loop header.
+ result = block.successors[0].successors[0];
+ } else {
+ // For other loops, the loop header might be up the dominator
+ // tree if the loop condition has control flow.
+ result = block;
+ while (!result.isLoopHeader()) result = result.dominator;
+ }
+
+ assert(result.isLoopHeader());
+ return result;
+ }
}
class HConstant extends HInstruction {
@@ -2618,6 +2635,8 @@
return node.accept(const LoopTypeVisitor());
}
+ bool isDoWhile() => kind == DO_WHILE_LOOP;
+
bool accept(HStatementInformationVisitor visitor) =>
visitor.visitLoopInfo(this);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | tests/language/bailout6_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698