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

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

Issue 9432022: Make sure the merge block after a try/catch has its dominator the block that contains HTry. This wa… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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 | frog/leg/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/builder.dart
===================================================================
--- frog/leg/ssa/builder.dart (revision 4445)
+++ frog/leg/ssa/builder.dart (working copy)
@@ -2009,13 +2009,13 @@
close(new HGoto()).addSuccessor(enterBlock);
open(enterBlock);
HTry tryInstruction = new HTry();
- close(tryInstruction);
+ List<HBasicBlock> blocks = <HBasicBlock>[];
+ blocks.add(close(tryInstruction));
HBasicBlock tryBody = graph.addNewBlock();
enterBlock.addSuccessor(tryBody);
open(tryBody);
visit(node.tryBlock);
- List<HBasicBlock> blocks = <HBasicBlock>[];
if (!isAborted()) blocks.add(close(new HGoto()));
if (!node.catchBlocks.isEmpty()) {
@@ -2079,17 +2079,13 @@
tryInstruction.finallyBlock = finallyBlock;
}
- // If no block is going to an exit block, the Dart code after the
- // try is dead code.
- if (!blocks.isEmpty()) {
- HBasicBlock exitBlock = graph.addNewBlock();
+ HBasicBlock exitBlock = graph.addNewBlock();
- for (HBasicBlock block in blocks) {
- block.addSuccessor(exitBlock);
- }
-
- open(exitBlock);
+ for (HBasicBlock block in blocks) {
+ block.addSuccessor(exitBlock);
}
+
+ open(exitBlock);
}
visitScriptTag(ScriptTag node) {
« no previous file with comments | « no previous file | frog/leg/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698