| OLD | NEW |
| 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'; |
| 10 import '../universe/selector.dart'; |
| 9 | 11 |
| 10 export 'type_propagation.dart' show TypePropagator; | 12 export 'type_propagation.dart' show TypePropagator; |
| 11 export 'scalar_replacement.dart' show ScalarReplacer; | 13 export 'scalar_replacement.dart' show ScalarReplacer; |
| 12 export 'redundant_phi.dart' show RedundantPhiEliminator; | 14 export 'redundant_phi.dart' show RedundantPhiEliminator; |
| 13 export 'redundant_join.dart' show RedundantJoinEliminator; | 15 export 'redundant_join.dart' show RedundantJoinEliminator; |
| 14 export 'shrinking_reductions.dart' show ShrinkingReducer; | 16 export 'shrinking_reductions.dart' show ShrinkingReducer; |
| 15 export 'mutable_ssa.dart' show MutableVariableEliminator; | 17 export 'mutable_ssa.dart' show MutableVariableEliminator; |
| 16 export 'insert_refinements.dart' show InsertRefinements; | 18 export 'insert_refinements.dart' show InsertRefinements; |
| 17 export 'update_refinements.dart' show UpdateRefinements; | 19 export 'update_refinements.dart' show UpdateRefinements; |
| 18 export 'redundant_refinement.dart' show RedundantRefinementEliminator; | 20 export 'redundant_refinement.dart' show RedundantRefinementEliminator; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 44 value is StringConstantValue && value.primitiveValue.isEmpty; | 46 value is StringConstantValue && value.primitiveValue.isEmpty; |
| 45 } | 47 } |
| 46 | 48 |
| 47 /// Returns true if [value] satisfies a branching condition with the | 49 /// Returns true if [value] satisfies a branching condition with the |
| 48 /// given strictness. | 50 /// given strictness. |
| 49 /// | 51 /// |
| 50 /// For non-strict, this is the opposite of [isFalsyConstant]. | 52 /// For non-strict, this is the opposite of [isFalsyConstant]. |
| 51 bool isTruthyConstant(ConstantValue value, {bool strict: false}) { | 53 bool isTruthyConstant(ConstantValue value, {bool strict: false}) { |
| 52 return strict ? value.isTrue : !isFalsyConstant(value); | 54 return strict ? value.isTrue : !isFalsyConstant(value); |
| 53 } | 55 } |
| 56 |
| 57 /// Selector that do not throw when invoked on the null class. |
| 58 final List<Selector> selectorsOnNull = <Selector>[ |
| 59 Selectors.equals, Selectors.hashCode_, Selectors.runtimeType_, |
| 60 Selectors.toString_]; |
| OLD | NEW |