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

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

Issue 1573693002: dart2js cps: Hoist loop-invariant branches from loop entry. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
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 import '../common/names.dart'; 9 import '../common/names.dart';
10 import '../universe/selector.dart'; 10 import '../universe/selector.dart';
11 11
12 export 'type_propagation.dart' show TypePropagator; 12 export 'type_propagation.dart' show TypePropagator;
13 export 'scalar_replacement.dart' show ScalarReplacer; 13 export 'scalar_replacement.dart' show ScalarReplacer;
14 export 'redundant_phi.dart' show RedundantPhiEliminator; 14 export 'redundant_phi.dart' show RedundantPhiEliminator;
15 export 'redundant_join.dart' show RedundantJoinEliminator; 15 export 'redundant_join.dart' show RedundantJoinEliminator;
16 export 'shrinking_reductions.dart' show ShrinkingReducer; 16 export 'shrinking_reductions.dart' show ShrinkingReducer;
17 export 'mutable_ssa.dart' show MutableVariableEliminator; 17 export 'mutable_ssa.dart' show MutableVariableEliminator;
18 export 'insert_refinements.dart' show InsertRefinements; 18 export 'insert_refinements.dart' show InsertRefinements;
19 export 'update_refinements.dart' show UpdateRefinements; 19 export 'update_refinements.dart' show UpdateRefinements;
20 export 'redundant_refinement.dart' show RedundantRefinementEliminator; 20 export 'redundant_refinement.dart' show RedundantRefinementEliminator;
21 export 'optimize_interceptors.dart' show OptimizeInterceptors; 21 export 'optimize_interceptors.dart' show OptimizeInterceptors;
22 export 'bounds_checker.dart' show BoundsChecker; 22 export 'bounds_checker.dart' show BoundsChecker;
23 export 'backward_null_check_remover.dart' show BackwardNullCheckRemover; 23 export 'backward_null_check_remover.dart' show BackwardNullCheckRemover;
24 export 'gvn.dart' show GVN; 24 export 'gvn.dart' show GVN;
25 export 'inline.dart' show Inliner; 25 export 'inline.dart' show Inliner;
26 export 'eagerly_load_statics.dart' show EagerlyLoadStatics; 26 export 'eagerly_load_statics.dart' show EagerlyLoadStatics;
27 export 'loop_invariant_branch.dart' show LoopInvariantBranchMotion;
27 export 'parent_visitor.dart' show ParentVisitor; 28 export 'parent_visitor.dart' show ParentVisitor;
28 29
29 /// An optimization pass over the CPS IR. 30 /// An optimization pass over the CPS IR.
30 abstract class Pass { 31 abstract class Pass {
31 /// Applies optimizations to root, rewriting it in the process. 32 /// Applies optimizations to root, rewriting it in the process.
32 void rewrite(FunctionDefinition root); 33 void rewrite(FunctionDefinition root);
33 34
34 String get passName; 35 String get passName;
35 } 36 }
36 37
(...skipping 15 matching lines...) Expand all
52 /// For non-strict, this is the opposite of [isFalsyConstant]. 53 /// For non-strict, this is the opposite of [isFalsyConstant].
53 bool isTruthyConstant(ConstantValue value, {bool strict: false}) { 54 bool isTruthyConstant(ConstantValue value, {bool strict: false}) {
54 return strict ? value.isTrue : !isFalsyConstant(value); 55 return strict ? value.isTrue : !isFalsyConstant(value);
55 } 56 }
56 57
57 /// Selectors that do not throw when invoked on the null value. 58 /// Selectors that do not throw when invoked on the null value.
58 final List<Selector> selectorsOnNull = <Selector>[ 59 final List<Selector> selectorsOnNull = <Selector>[
59 Selectors.equals, Selectors.hashCode_, Selectors.runtimeType_, 60 Selectors.equals, Selectors.hashCode_, Selectors.runtimeType_,
60 Selectors.toString_, Selectors.toStringGetter, 61 Selectors.toString_, Selectors.toStringGetter,
61 Selectors.noSuchMethodGetter]; 62 Selectors.noSuchMethodGetter];
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698