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

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

Issue 1185633003: cps-ir: Support foreign code. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Status file updates. Created 5 years, 6 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
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 tree_ir.optimization.statement_rewriter; 5 library tree_ir.optimization.statement_rewriter;
6 6
7 import 'optimization.dart' show Pass; 7 import 'optimization.dart' show Pass;
8 import '../tree_ir_nodes.dart'; 8 import '../tree_ir_nodes.dart';
9 9
10 /** 10 /**
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 return false; 855 return false;
856 } 856 }
857 857
858 Expression makeCondition(Expression e, bool polarity) { 858 Expression makeCondition(Expression e, bool polarity) {
859 return polarity ? e : new Not(e); 859 return polarity ? e : new Not(e);
860 } 860 }
861 861
862 Statement getBranch(If node, bool polarity) { 862 Statement getBranch(If node, bool polarity) {
863 return polarity ? node.thenStatement : node.elseStatement; 863 return polarity ? node.thenStatement : node.elseStatement;
864 } 864 }
865
866 @override
867 Expression visitForeignExpression(ForeignExpression node) {
868 _rewriteList(node.arguments);
869 return node;
870 }
871
872 @override
873 Statement visitForeignStatement(ForeignStatement node) {
874 _rewriteList(node.arguments);
875 return node;
876 }
865 } 877 }
866 878
867 /// Result of combining two expressions, with the potential for reverting the 879 /// Result of combining two expressions, with the potential for reverting the
868 /// combination. 880 /// combination.
869 /// 881 ///
870 /// Reverting a combination is done by calling [uncombine]. In this case, 882 /// Reverting a combination is done by calling [uncombine]. In this case,
871 /// both the original expressions should remain in the tree, and the [combined] 883 /// both the original expressions should remain in the tree, and the [combined]
872 /// expression should be orphaned. 884 /// expression should be orphaned.
873 /// 885 ///
874 /// Explicitly reverting a combination is necessary to maintain variable 886 /// Explicitly reverting a combination is necessary to maintain variable
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 } 928 }
917 929
918 /// Result of combining two expressions that do not affect reference counting. 930 /// Result of combining two expressions that do not affect reference counting.
919 class GenericCombinedExpressions implements CombinedExpressions { 931 class GenericCombinedExpressions implements CombinedExpressions {
920 Expression combined; 932 Expression combined;
921 933
922 GenericCombinedExpressions(this.combined); 934 GenericCombinedExpressions(this.combined);
923 935
924 void uncombine() {} 936 void uncombine() {}
925 } 937 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698