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

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

Issue 11366085: Fix control flow graph in the presence of aborting instructions in a try/catch/finally. (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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (revision 14518)
+++ sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (working copy)
@@ -19,6 +19,7 @@
R visitDivide(HDivide node);
R visitEquals(HEquals node);
R visitExit(HExit node);
+ R visitExitTry(HExitTry node);
R visitFieldGet(HFieldGet node);
R visitFieldSet(HFieldSet node);
R visitForeign(HForeign node);
@@ -279,6 +280,7 @@
visitDivide(HDivide node) => visitBinaryArithmetic(node);
visitEquals(HEquals node) => visitRelational(node);
visitExit(HExit node) => visitControlFlow(node);
+ visitExitTry(HExitTry node) => visitControlFlow(node);
visitFieldGet(HFieldGet node) => visitFieldAccess(node);
visitFieldSet(HFieldSet node) => visitFieldAccess(node);
visitForeign(HForeign node) => visitInstruction(node);
@@ -2033,6 +2035,18 @@
HBasicBlock get joinBlock => this.block.successors.last;
}
+// An [HExitTry] control flow node is used when the body of a try or
+// the body of a catch contains a return, break or continue. To build
+// the control flow graph, we explicitely mark the body that
+// leads to one of this instruction a predecessor of catch and
+// finally.
+class HExitTry extends HControlFlow {
+ HExitTry() : super(const <HInstruction>[]);
+ toString() => 'exit try';
+ accept(HVisitor visitor) => visitor.visitExitTry(this);
+ HBasicBlock get bodyTrySuccessor => block.successors[0];
+}
+
class HIf extends HConditionalBranch {
HBlockFlow blockInformation = null;
HIf(HInstruction condition) : super(<HInstruction>[condition]);
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | sdk/lib/_internal/compiler/implementation/ssa/tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698