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

Unified Diff: dart/frog/leg/ssa/builder.dart

Issue 9688016: Hack around aborting loop body. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | « no previous file | dart/frog/tests/leg/leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/ssa/builder.dart
diff --git a/dart/frog/leg/ssa/builder.dart b/dart/frog/leg/ssa/builder.dart
index 9d022554f50a5c631849663b5998dbe9b58f2436..45043b4c0a9af7e155515bcb9ee46d8253cd9b48 100644
--- a/dart/frog/leg/ssa/builder.dart
+++ b/dart/frog/leg/ssa/builder.dart
@@ -1089,11 +1089,7 @@ class SsaBuilder implements Visitor {
open(bodyBlock);
localsHandler.enterLoopBody(loop);
- visit(body);
- if (isAborted()) {
- compiler.unimplemented("SsaBuilder for loop with aborting body",
- node: body);
- }
+ hackAroundPossiblyAbortingBody(body);
bodyBlock = close(new HGoto());
// Update.
@@ -1138,10 +1134,7 @@ class SsaBuilder implements Visitor {
HBasicBlock loopEntryBlock = current;
localsHandler.enterLoopBody(node);
- visit(node.body);
- if (isAborted()) {
- compiler.unimplemented("SsaBuilder for loop with aborting body");
- }
+ hackAroundPossiblyAbortingBody(node.body);
// If there are no continues we could avoid the creation of the condition
// block. This could also lead to a block having multiple entries and exits.
@@ -2201,11 +2194,7 @@ class SsaBuilder implements Visitor {
}
localsHandler.updateLocal(variable, pop());
- visit(node.body);
- if (isAborted()) {
- compiler.unimplemented("SsaBuilder for loop with aborting body",
- node: node);
- }
+ hackAroundPossiblyAbortingBody(node.body);
bodyBlock = close(new HGoto());
// Update.
@@ -2249,12 +2238,8 @@ class SsaBuilder implements Visitor {
HBasicBlock entryBlock = graph.addNewBlock();
goto(current, entryBlock);
open(entryBlock);
- visit(body);
+ hackAroundPossiblyAbortingBody(body);
SubGraph bodyGraph = new SubGraph(entryBlock, lastOpenedBlock);
- if (isAborted()) {
- compiler.unimplemented(
- "SsaBuilder for labeled statement with aborting body", node: node);
- }
HBasicBlock joinBlock = graph.addNewBlock();
List<LocalsHandler> breakLocals = <LocalsHandler>[];
@@ -2492,4 +2477,16 @@ class SsaBuilder implements Visitor {
stack.add(graph.addConstantNull());
}
}
+
+ /** HACK HACK HACK */
+ void hackAroundPossiblyAbortingBody(Node body) {
+ stack.add(graph.addConstantBool(true));
+ buildBody() {
+ visit(body);
+ if (isAborted()) {
floitsch 2012/03/12 15:48:24 Add TODO that this will need to take into account
ahe 2012/03/12 16:55:34 Done.
+ compiler.reportWarning(body, "aborting loop body");
+ }
+ }
+ handleIf(buildBody, (){});
floitsch 2012/03/12 15:48:24 you should be able to pass 'null' for the else bra
ahe 2012/03/12 16:55:34 Done.
+ }
}
« no previous file with comments | « no previous file | dart/frog/tests/leg/leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698