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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart

Issue 923013002: dart2dart: Implementation of simple try/catch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.ir_tracer; 5 library dart2js.ir_tracer;
6 6
7 import 'dart:async' show EventSink; 7 import 'dart:async' show EventSink;
8 8
9 import 'cps_ir_nodes.dart' as cps_ir hide Function; 9 import 'cps_ir_nodes.dart' as cps_ir hide Function;
10 import '../tracer.dart'; 10 import '../tracer.dart';
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 if (IR_TRACE_LET_CONT) { 113 if (IR_TRACE_LET_CONT) {
114 String dummy = names.name(node); 114 String dummy = names.name(node);
115 for (cps_ir.Continuation continuation in node.continuations) { 115 for (cps_ir.Continuation continuation in node.continuations) {
116 String id = names.name(continuation); 116 String id = names.name(continuation);
117 printStmt(dummy, "LetCont $id = <$id>"); 117 printStmt(dummy, "LetCont $id = <$id>");
118 } 118 }
119 } 119 }
120 visit(node.body); 120 visit(node.body);
121 } 121 }
122 122
123 visitLetHandler(cps_ir.LetHandler node) {
124 if (IR_TRACE_LET_CONT) {
125 String dummy = names.name(node);
126 String id = names.name(node.handler);
127 printStmt(dummy, "LetHandler $id = <$id>");
128 }
129 visit(node.body);
130 }
131
123 visitLetMutable(cps_ir.LetMutable node) { 132 visitLetMutable(cps_ir.LetMutable node) {
124 String id = names.name(node.variable); 133 String id = names.name(node.variable);
125 printStmt(id, "${node.runtimeType} $id = ${formatReference(node.value)}"); 134 printStmt(id, "${node.runtimeType} $id = ${formatReference(node.value)}");
126 visit(node.body); 135 visit(node.body);
127 } 136 }
128 137
129 visitInvokeStatic(cps_ir.InvokeStatic node) { 138 visitInvokeStatic(cps_ir.InvokeStatic node) {
130 String dummy = names.name(node); 139 String dummy = names.name(node);
131 String callName = node.selector.name; 140 String callName = node.selector.name;
132 String args = node.arguments.map(formatReference).join(', '); 141 String args = node.arguments.map(formatReference).join(', ');
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 437
429 visitLetPrim(cps_ir.LetPrim exp) { 438 visitLetPrim(cps_ir.LetPrim exp) {
430 visit(exp.body); 439 visit(exp.body);
431 } 440 }
432 441
433 visitLetCont(cps_ir.LetCont exp) { 442 visitLetCont(cps_ir.LetCont exp) {
434 exp.continuations.forEach(visit); 443 exp.continuations.forEach(visit);
435 visit(exp.body); 444 visit(exp.body);
436 } 445 }
437 446
447 visitLetHandler(cps_ir.LetHandler exp) {
448 visit(exp.handler);
449 visit(exp.body);
450 }
451
452 visitLetMutable(cps_ir.LetMutable exp) {
453 visit(exp.body);
454 }
455
438 void addEdgeToContinuation(cps_ir.Reference continuation) { 456 void addEdgeToContinuation(cps_ir.Reference continuation) {
439 cps_ir.Definition target = continuation.definition; 457 cps_ir.Definition target = continuation.definition;
440 if (target is cps_ir.Continuation && !target.isReturnContinuation) { 458 if (target is cps_ir.Continuation && !target.isReturnContinuation) {
441 current_block.addEdgeTo(getBlock(target)); 459 current_block.addEdgeTo(getBlock(target));
442 } 460 }
443 } 461 }
444 462
445 visitInvokeStatic(cps_ir.InvokeStatic exp) { 463 visitInvokeStatic(cps_ir.InvokeStatic exp) {
446 addEdgeToContinuation(exp.continuation); 464 addEdgeToContinuation(exp.continuation);
447 } 465 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 } 503 }
486 } 504 }
487 505
488 visitContinuation(cps_ir.Continuation c) { 506 visitContinuation(cps_ir.Continuation c) {
489 var old_node = current_block; 507 var old_node = current_block;
490 current_block = getBlock(c); 508 current_block = getBlock(c);
491 visit(c.body); 509 visit(c.body);
492 current_block = old_node; 510 current_block = old_node;
493 } 511 }
494 } 512 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698