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

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
Index: frog/leg/ssa/tracer.dart
===================================================================
--- frog/leg/ssa/tracer.dart (revision 3986)
+++ frog/leg/ssa/tracer.dart (working copy)
@@ -382,6 +382,24 @@
return visitInvokeStatic(node);
}
+ String visitTry(HTry node) {
floitsch 2012/02/08 10:07:53 Did you test this in the c1visualizer?
ngeoffray 2012/02/08 10:17:17 Just did, and it works :)
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698