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

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

Issue 1537663002: dart2js: Initial implementation of inlining. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 dart2js.cps_ir.optimizers; 5 library dart2js.cps_ir.optimizers;
6 6
7 import 'cps_ir_nodes.dart'; 7 import 'cps_ir_nodes.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 9
10 export 'type_propagation.dart' show TypePropagator; 10 export 'type_propagation.dart' show TypePropagator;
11 export 'scalar_replacement.dart' show ScalarReplacer; 11 export 'scalar_replacement.dart' show ScalarReplacer;
12 export 'redundant_phi.dart' show RedundantPhiEliminator; 12 export 'redundant_phi.dart' show RedundantPhiEliminator;
13 export 'redundant_join.dart' show RedundantJoinEliminator; 13 export 'redundant_join.dart' show RedundantJoinEliminator;
14 export 'shrinking_reductions.dart' show ShrinkingReducer; 14 export 'shrinking_reductions.dart' show ShrinkingReducer;
15 export 'mutable_ssa.dart' show MutableVariableEliminator; 15 export 'mutable_ssa.dart' show MutableVariableEliminator;
16 export 'insert_refinements.dart' show InsertRefinements; 16 export 'insert_refinements.dart' show InsertRefinements;
17 export 'update_refinements.dart' show UpdateRefinements; 17 export 'update_refinements.dart' show UpdateRefinements;
18 export 'redundant_refinement.dart' show RedundantRefinementEliminator; 18 export 'redundant_refinement.dart' show RedundantRefinementEliminator;
19 export 'optimize_interceptors.dart' show OptimizeInterceptors; 19 export 'optimize_interceptors.dart' show OptimizeInterceptors;
20 export 'bounds_checker.dart' show BoundsChecker; 20 export 'bounds_checker.dart' show BoundsChecker;
21 export 'gvn.dart' show GVN; 21 export 'gvn.dart' show GVN;
22 export 'inline.dart' show Inliner;
22 export 'eagerly_load_statics.dart' show EagerlyLoadStatics; 23 export 'eagerly_load_statics.dart' show EagerlyLoadStatics;
23 export 'parent_visitor.dart' show ParentVisitor; 24 export 'parent_visitor.dart' show ParentVisitor;
24 25
25 /// An optimization pass over the CPS IR. 26 /// An optimization pass over the CPS IR.
26 abstract class Pass { 27 abstract class Pass {
27 /// Applies optimizations to root, rewriting it in the process. 28 /// Applies optimizations to root, rewriting it in the process.
28 void rewrite(FunctionDefinition root); 29 void rewrite(FunctionDefinition root);
29 30
30 String get passName; 31 String get passName;
31 } 32 }
(...skipping 10 matching lines...) Expand all
42 value is StringConstantValue && value.primitiveValue.isEmpty; 43 value is StringConstantValue && value.primitiveValue.isEmpty;
43 } 44 }
44 45
45 /// Returns true if [value] satisfies a branching condition with the 46 /// Returns true if [value] satisfies a branching condition with the
46 /// given strictness. 47 /// given strictness.
47 /// 48 ///
48 /// For non-strict, this is the opposite of [isFalsyConstant]. 49 /// For non-strict, this is the opposite of [isFalsyConstant].
49 bool isTruthyConstant(ConstantValue value, {bool strict: false}) { 50 bool isTruthyConstant(ConstantValue value, {bool strict: false}) {
50 return strict ? value.isTrue : !isFalsyConstant(value); 51 return strict ? value.isTrue : !isFalsyConstant(value);
51 } 52 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698