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

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

Issue 9351020: Implement try/catch without finally, and without type checks. (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 | « frog/leg/ssa/optimize.dart ('k') | frog/leg/typechecker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/tracer.dart
===================================================================
--- frog/leg/ssa/tracer.dart (revision 4024)
+++ frog/leg/ssa/tracer.dart (working copy)
@@ -382,6 +382,24 @@
return visitInvokeStatic(node);
}
+ String visitTry(HTry node) {
+ List<HBasicBlock> successors = currentBlock.successors;
+ String tryBlock = 'B${successors[0].id}';
+ StringBuffer catchBlocks = new StringBuffer();
+ for (int i = 1; i < successors.length - 1; i++) {
+ catchBlocks.add('B${successors[i].id}, ');
+ }
+
+ String finallyBlock;
+ if (node.finallyBlock != null) {
+ finallyBlock = 'B${node.finallyBlock.id}';
+ } else {
+ catchBlocks.add('B${successors[successors.length - 1].id}');
+ finallyBlock = 'none';
+ }
+ return "Try: $tryBlock, Catch: $catchBlocks, Finally: $finallyBlock";
+ }
+
String visitTypeGuard(HTypeGuard node) {
String type;
switch (node.type) {
« no previous file with comments | « frog/leg/ssa/optimize.dart ('k') | frog/leg/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698