| 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'; | |
| 8 import 'optimizers.dart' show Pass; | |
| 9 import 'octagon.dart'; | |
| 10 import '../constants/values.dart'; | 7 import '../constants/values.dart'; |
| 11 import 'cps_fragment.dart'; | |
| 12 import 'type_mask_system.dart'; | |
| 13 import '../types/types.dart'; | 8 import '../types/types.dart'; |
| 14 import '../world.dart'; | 9 import '../world.dart'; |
| 10 import 'cps_fragment.dart'; |
| 11 import 'cps_ir_nodes.dart'; |
| 12 import 'effects.dart'; |
| 15 import 'loop_effects.dart'; | 13 import 'loop_effects.dart'; |
| 16 import 'effects.dart'; | 14 import 'octagon.dart'; |
| 15 import 'optimizers.dart' show Pass; |
| 16 import 'type_mask_system.dart'; |
| 17 | 17 |
| 18 /// Eliminates bounds checks when they can be proven safe. | 18 /// Eliminates bounds checks when they can be proven safe. |
| 19 /// | 19 /// |
| 20 /// 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 |
| 21 /// 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. |
| 22 /// | 22 /// |
| 23 /// The analysis uses an [Octagon] abstract domain. Unlike traditional octagon | 23 /// The analysis uses an [Octagon] abstract domain. Unlike traditional octagon |
| 24 /// 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 |
| 25 /// a bucket of constraints. Constraints can therefore be added and removed | 25 /// a bucket of constraints. Constraints can therefore be added and removed |
| 26 /// on-the-fly without significant overhead. | 26 /// on-the-fly without significant overhead. |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 } | 701 } |
| 702 return node.body; | 702 return node.body; |
| 703 } | 703 } |
| 704 } | 704 } |
| 705 | 705 |
| 706 /// Lattice representing the known (weak) monotonicity of a loop variable. | 706 /// Lattice representing the known (weak) monotonicity of a loop variable. |
| 707 /// | 707 /// |
| 708 /// The lattice bottom is represented by `null` and represents the case where | 708 /// The lattice bottom is represented by `null` and represents the case where |
| 709 /// the loop variable never changes value during the loop. | 709 /// the loop variable never changes value during the loop. |
| 710 enum Monotonicity { NotMonotone, Increasing, Decreasing, } | 710 enum Monotonicity { NotMonotone, Increasing, Decreasing, } |
| OLD | NEW |