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

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

Issue 1011403003: cps-ir: Set runtime type information for new objects that require it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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
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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 Expression visitReifyRuntimeType(ReifyRuntimeType node) { 504 Expression visitReifyRuntimeType(ReifyRuntimeType node) {
505 node.value = visitExpression(node.value); 505 node.value = visitExpression(node.value);
506 return node; 506 return node;
507 } 507 }
508 508
509 Expression visitReadTypeVariable(ReadTypeVariable node) { 509 Expression visitReadTypeVariable(ReadTypeVariable node) {
510 node.target = visitExpression(node.target); 510 node.target = visitExpression(node.target);
511 return node; 511 return node;
512 } 512 }
513 513
514 @override
515 Expression visitTypeExpression(TypeExpression node) {
516 for (int i = node.arguments.length - 1; i >= 0; --i) {
517 node.arguments[i] = visitExpression(node.arguments[i]);
518 }
519 return node;
520 }
521
514 /// If [s] and [t] are similar statements we extract their subexpressions 522 /// If [s] and [t] are similar statements we extract their subexpressions
515 /// and returns a new statement of the same type using expressions combined 523 /// and returns a new statement of the same type using expressions combined
516 /// with the [combine] callback. For example: 524 /// with the [combine] callback. For example:
517 /// 525 ///
518 /// combineStatements(Return E1, Return E2) = Return combine(E1, E2) 526 /// combineStatements(Return E1, Return E2) = Return combine(E1, E2)
519 /// 527 ///
520 /// If [combine] returns E1 then the unified statement is equivalent to [s], 528 /// If [combine] returns E1 then the unified statement is equivalent to [s],
521 /// and if [combine] returns E2 the unified statement is equivalence to [t]. 529 /// and if [combine] returns E2 the unified statement is equivalence to [t].
522 /// 530 ///
523 /// It is guaranteed that no side effects occur between the beginning of the 531 /// It is guaranteed that no side effects occur between the beginning of the
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 } 679 }
672 680
673 Expression makeCondition(Expression e, bool polarity) { 681 Expression makeCondition(Expression e, bool polarity) {
674 return polarity ? e : new Not(e); 682 return polarity ? e : new Not(e);
675 } 683 }
676 684
677 Statement getBranch(If node, bool polarity) { 685 Statement getBranch(If node, bool polarity) {
678 return polarity ? node.thenStatement : node.elseStatement; 686 return polarity ? node.thenStatement : node.elseStatement;
679 } 687 }
680 } 688 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.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