Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: runtime/vm/flow_graph_range_analysis.cc

Issue 881063003: Cleanups: parsed_function()->function() => function() (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/il_printer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 } 1521 }
1522 1522
1523 RangeAnalysis* range_analysis_; 1523 RangeAnalysis* range_analysis_;
1524 FlowGraph* flow_graph_; 1524 FlowGraph* flow_graph_;
1525 Scheduler scheduler_; 1525 Scheduler scheduler_;
1526 }; 1526 };
1527 1527
1528 1528
1529 void RangeAnalysis::EliminateRedundantBoundsChecks() { 1529 void RangeAnalysis::EliminateRedundantBoundsChecks() {
1530 if (FLAG_array_bounds_check_elimination) { 1530 if (FLAG_array_bounds_check_elimination) {
1531 const Function& function = flow_graph_->parsed_function()->function(); 1531 const Function& function = flow_graph_->function();
1532 const bool try_generalization = 1532 const bool try_generalization =
1533 function.allows_bounds_check_generalization(); 1533 function.allows_bounds_check_generalization();
1534 1534
1535 BoundsCheckGeneralizer generalizer(this, flow_graph_); 1535 BoundsCheckGeneralizer generalizer(this, flow_graph_);
1536 1536
1537 for (intptr_t i = 0; i < bounds_checks_.length(); i++) { 1537 for (intptr_t i = 0; i < bounds_checks_.length(); i++) {
1538 CheckArrayBoundInstr* check = bounds_checks_[i]; 1538 CheckArrayBoundInstr* check = bounds_checks_[i];
1539 RangeBoundary array_length = 1539 RangeBoundary array_length =
1540 RangeBoundary::FromDefinition(check->length()->definition()); 1540 RangeBoundary::FromDefinition(check->length()->definition());
1541 if (check->IsRedundant(array_length)) { 1541 if (check->IsRedundant(array_length)) {
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
3143 } 3143 }
3144 } while (CanonicalizeMaxBoundary(&max) || 3144 } while (CanonicalizeMaxBoundary(&max) ||
3145 CanonicalizeMinBoundary(&canonical_length)); 3145 CanonicalizeMinBoundary(&canonical_length));
3146 3146
3147 // Failed to prove that maximum is bounded with array length. 3147 // Failed to prove that maximum is bounded with array length.
3148 return false; 3148 return false;
3149 } 3149 }
3150 3150
3151 3151
3152 } // namespace dart 3152 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/il_printer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698