| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.bounds_checker; | 5 library dart2js.cps_ir.bounds_checker; |
| 6 | 6 |
| 7 import 'cps_ir_nodes.dart'; | 7 import 'cps_ir_nodes.dart'; |
| 8 import 'optimizers.dart' show Pass; | 8 import 'optimizers.dart' show Pass; |
| 9 import 'octagon.dart'; | 9 import 'octagon.dart'; |
| 10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
| 11 import 'cps_fragment.dart'; | 11 import 'cps_fragment.dart'; |
| 12 import 'type_mask_system.dart'; | 12 import 'type_mask_system.dart'; |
| 13 import '../types/types.dart'; | 13 import '../types/types.dart'; |
| 14 import '../world.dart'; | 14 import '../world.dart'; |
| 15 import '../elements/elements.dart'; | |
| 16 import 'loop_effects.dart'; | 15 import 'loop_effects.dart'; |
| 17 import 'effects.dart'; | 16 import 'effects.dart'; |
| 18 | 17 |
| 19 /// Eliminates bounds checks when they can be proven safe. | 18 /// Eliminates bounds checks when they can be proven safe. |
| 20 /// | 19 /// |
| 21 /// In general, this pass will try to eliminate any branch with arithmetic | 20 /// In general, this pass will try to eliminate any branch with arithmetic |
| 22 /// in the condition, i.e. `x < y`, `x <= y`, `x == y` etc. | 21 /// in the condition, i.e. `x < y`, `x <= y`, `x == y` etc. |
| 23 /// | 22 /// |
| 24 /// The analysis uses an [Octagon] abstract domain. Unlike traditional octagon | 23 /// The analysis uses an [Octagon] abstract domain. Unlike traditional octagon |
| 25 /// analyzers, we do not use a closed matrix representation, but just maintain | 24 /// analyzers, we do not use a closed matrix representation, but just maintain |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 } | 698 } |
| 700 return node.body; | 699 return node.body; |
| 701 } | 700 } |
| 702 } | 701 } |
| 703 | 702 |
| 704 /// Lattice representing the known (weak) monotonicity of a loop variable. | 703 /// Lattice representing the known (weak) monotonicity of a loop variable. |
| 705 /// | 704 /// |
| 706 /// The lattice bottom is represented by `null` and represents the case where | 705 /// The lattice bottom is represented by `null` and represents the case where |
| 707 /// the loop variable never changes value during the loop. | 706 /// the loop variable never changes value during the loop. |
| 708 enum Monotonicity { NotMonotone, Increasing, Decreasing, } | 707 enum Monotonicity { NotMonotone, Increasing, Decreasing, } |
| OLD | NEW |