| 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'; | 9 import '../common/names.dart'; |
| 10 import '../universe/selector.dart'; | 10 import '../universe/selector.dart'; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 /// Returns true if [value] satisfies a branching condition with the | 49 /// Returns true if [value] satisfies a branching condition with the |
| 50 /// given strictness. | 50 /// given strictness. |
| 51 /// | 51 /// |
| 52 /// For non-strict, this is the opposite of [isFalsyConstant]. | 52 /// For non-strict, this is the opposite of [isFalsyConstant]. |
| 53 bool isTruthyConstant(ConstantValue value, {bool strict: false}) { | 53 bool isTruthyConstant(ConstantValue value, {bool strict: false}) { |
| 54 return strict ? value.isTrue : !isFalsyConstant(value); | 54 return strict ? value.isTrue : !isFalsyConstant(value); |
| 55 } | 55 } |
| 56 | 56 |
| 57 /// Selector that do not throw when invoked on the null class. | 57 /// Selectors that do not throw when invoked on the null value. |
| 58 final List<Selector> selectorsOnNull = <Selector>[ | 58 final List<Selector> selectorsOnNull = <Selector>[ |
| 59 Selectors.equals, Selectors.hashCode_, Selectors.runtimeType_, | 59 Selectors.equals, Selectors.hashCode_, Selectors.runtimeType_, |
| 60 Selectors.toString_]; | 60 Selectors.toString_, Selectors.toStringGetter, |
| 61 Selectors.noSuchMethodGetter]; |
| OLD | NEW |