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

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

Issue 807573003: Fix some bugs that blocked optimizations in the new IRs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 11 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 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 List<Assign> savedEnvironment = environment; 402 List<Assign> savedEnvironment = environment;
403 environment = <Assign>[]; 403 environment = <Assign>[];
404 node.next = visitStatement(node.next); 404 node.next = visitStatement(node.next);
405 assert(environment.isEmpty); 405 assert(environment.isEmpty);
406 environment = savedEnvironment; 406 environment = savedEnvironment;
407 return node; 407 return node;
408 } 408 }
409 409
410 Statement visitSetField(SetField node) { 410 Statement visitSetField(SetField node) {
411 node.next = visitStatement(node.next); 411 node.next = visitStatement(node.next);
412 node.value = visitExpression(node.value);
412 node.object = visitExpression(node.object); 413 node.object = visitExpression(node.object);
413 node.value = visitExpression(node.value);
414 return node; 414 return node;
415 } 415 }
416 416
417 Expression visitGetField(GetField node) { 417 Expression visitGetField(GetField node) {
418 node.object = visitExpression(node.object); 418 node.object = visitExpression(node.object);
419 return node; 419 return node;
420 } 420 }
421 421
422 Expression visitCreateBox(CreateBox node) { 422 Expression visitCreateBox(CreateBox node) {
423 return node; 423 return node;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 } 589 }
590 590
591 Expression makeCondition(Expression e, bool polarity) { 591 Expression makeCondition(Expression e, bool polarity) {
592 return polarity ? e : new Not(e); 592 return polarity ? e : new Not(e);
593 } 593 }
594 594
595 Statement getBranch(If node, bool polarity) { 595 Statement getBranch(If node, bool polarity) {
596 return polarity ? node.thenStatement : node.elseStatement; 596 return polarity ? node.thenStatement : node.elseStatement;
597 } 597 }
598 } 598 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698