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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart

Issue 1000813003: cps-ir: Do not propagate assignments into try. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of tree_ir.optimization; 5 part of tree_ir.optimization;
6 6
7 /** 7 /**
8 * Performs the following transformations on the tree: 8 * Performs the following transformations on the tree:
9 * - Assignment propagation 9 * - Assignment propagation
10 * - If-to-conditional conversion 10 * - If-to-conditional conversion
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 }); 413 });
414 return node; 414 return node;
415 } 415 }
416 416
417 Statement visitWhileCondition(WhileCondition node) { 417 Statement visitWhileCondition(WhileCondition node) {
418 // Not introduced yet 418 // Not introduced yet
419 throw "Unexpected WhileCondition in StatementRewriter"; 419 throw "Unexpected WhileCondition in StatementRewriter";
420 } 420 }
421 421
422 Statement visitTry(Try node) { 422 Statement visitTry(Try node) {
423 Set<Label> saved = safeForInlining; 423 inEmptyEnvironment(() {
424 safeForInlining = new Set<Label>(); 424 Set<Label> saved = safeForInlining;
425 node.tryBody = visitStatement(node.tryBody); 425 safeForInlining = new Set<Label>();
426 safeForInlining = saved; 426 node.tryBody = visitStatement(node.tryBody);
427 node.catchBody = visitStatement(node.catchBody); 427 safeForInlining = saved;
428 node.catchBody = visitStatement(node.catchBody);
429 });
428 return node; 430 return node;
429 } 431 }
430 432
431 Expression visitConstant(Constant node) { 433 Expression visitConstant(Constant node) {
432 return node; 434 return node;
433 } 435 }
434 436
435 Expression visitThis(This node) { 437 Expression visitThis(This node) {
436 return node; 438 return node;
437 } 439 }
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 } 671 }
670 672
671 Expression makeCondition(Expression e, bool polarity) { 673 Expression makeCondition(Expression e, bool polarity) {
672 return polarity ? e : new Not(e); 674 return polarity ? e : new Not(e);
673 } 675 }
674 676
675 Statement getBranch(If node, bool polarity) { 677 Statement getBranch(If node, bool polarity) {
676 return polarity ? node.thenStatement : node.elseStatement; 678 return polarity ? node.thenStatement : node.elseStatement;
677 } 679 }
678 } 680 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698