| 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 #include "vm/flow_graph_range_analysis.h" | 5 #include "vm/flow_graph_range_analysis.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/il_printer.h" | 8 #include "vm/il_printer.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 f->Print("v%" Pd "", index_bound->ssa_temp_index()); | 1509 f->Print("v%" Pd "", index_bound->ssa_temp_index()); |
| 1510 } | 1510 } |
| 1511 f->Print(" {%s}", Range::ToCString(index_bound->range())); | 1511 f->Print(" {%s}", Range::ToCString(index_bound->range())); |
| 1512 } | 1512 } |
| 1513 | 1513 |
| 1514 | 1514 |
| 1515 static const char* IndexBoundToCString(Definition* index_bound) { | 1515 static const char* IndexBoundToCString(Definition* index_bound) { |
| 1516 char buffer[1024]; | 1516 char buffer[1024]; |
| 1517 BufferFormatter f(buffer, sizeof(buffer)); | 1517 BufferFormatter f(buffer, sizeof(buffer)); |
| 1518 PrettyPrintIndexBoundRecursively(&f, index_bound); | 1518 PrettyPrintIndexBoundRecursively(&f, index_bound); |
| 1519 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 1519 return Thread::Current()->zone()->MakeCopyOfString(buffer); |
| 1520 } | 1520 } |
| 1521 | 1521 |
| 1522 RangeAnalysis* range_analysis_; | 1522 RangeAnalysis* range_analysis_; |
| 1523 FlowGraph* flow_graph_; | 1523 FlowGraph* flow_graph_; |
| 1524 Scheduler scheduler_; | 1524 Scheduler scheduler_; |
| 1525 }; | 1525 }; |
| 1526 | 1526 |
| 1527 | 1527 |
| 1528 void RangeAnalysis::EliminateRedundantBoundsChecks() { | 1528 void RangeAnalysis::EliminateRedundantBoundsChecks() { |
| 1529 if (FLAG_array_bounds_check_elimination) { | 1529 if (FLAG_array_bounds_check_elimination) { |
| (...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3160 } | 3160 } |
| 3161 } while (CanonicalizeMaxBoundary(&max) || | 3161 } while (CanonicalizeMaxBoundary(&max) || |
| 3162 CanonicalizeMinBoundary(&canonical_length)); | 3162 CanonicalizeMinBoundary(&canonical_length)); |
| 3163 | 3163 |
| 3164 // Failed to prove that maximum is bounded with array length. | 3164 // Failed to prove that maximum is bounded with array length. |
| 3165 return false; | 3165 return false; |
| 3166 } | 3166 } |
| 3167 | 3167 |
| 3168 | 3168 |
| 3169 } // namespace dart | 3169 } // namespace dart |
| OLD | NEW |