| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 } while (changed && (iteration < max_iterations)); | 571 } while (changed && (iteration < max_iterations)); |
| 572 } | 572 } |
| 573 | 573 |
| 574 | 574 |
| 575 void RangeAnalysis::InferRanges() { | 575 void RangeAnalysis::InferRanges() { |
| 576 if (FLAG_trace_range_analysis) { | 576 if (FLAG_trace_range_analysis) { |
| 577 FlowGraphPrinter::PrintGraph("Range Analysis (BEFORE)", flow_graph_); | 577 FlowGraphPrinter::PrintGraph("Range Analysis (BEFORE)", flow_graph_); |
| 578 } | 578 } |
| 579 | 579 |
| 580 // Initialize bitvector for quick filtering of int values. | 580 // Initialize bitvector for quick filtering of int values. |
| 581 BitVector* set = new(I) BitVector(flow_graph_->current_ssa_temp_index()); | 581 BitVector* set = new(I) BitVector(I, flow_graph_->current_ssa_temp_index()); |
| 582 for (intptr_t i = 0; i < values_.length(); i++) { | 582 for (intptr_t i = 0; i < values_.length(); i++) { |
| 583 set->Add(values_[i]->ssa_temp_index()); | 583 set->Add(values_[i]->ssa_temp_index()); |
| 584 } | 584 } |
| 585 for (intptr_t i = 0; i < constraints_.length(); i++) { | 585 for (intptr_t i = 0; i < constraints_.length(); i++) { |
| 586 set->Add(constraints_[i]->ssa_temp_index()); | 586 set->Add(constraints_[i]->ssa_temp_index()); |
| 587 } | 587 } |
| 588 | 588 |
| 589 // Collect integer definitions (including constraints) in the reverse | 589 // Collect integer definitions (including constraints) in the reverse |
| 590 // postorder. This improves convergence speed compared to iterating | 590 // postorder. This improves convergence speed compared to iterating |
| 591 // values_ and constraints_ array separately. | 591 // values_ and constraints_ array separately. |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 } | 739 } |
| 740 | 740 |
| 741 | 741 |
| 742 IntegerInstructionSelector::IntegerInstructionSelector(FlowGraph* flow_graph) | 742 IntegerInstructionSelector::IntegerInstructionSelector(FlowGraph* flow_graph) |
| 743 : flow_graph_(flow_graph), | 743 : flow_graph_(flow_graph), |
| 744 isolate_(NULL) { | 744 isolate_(NULL) { |
| 745 ASSERT(flow_graph_ != NULL); | 745 ASSERT(flow_graph_ != NULL); |
| 746 isolate_ = flow_graph_->isolate(); | 746 isolate_ = flow_graph_->isolate(); |
| 747 ASSERT(isolate_ != NULL); | 747 ASSERT(isolate_ != NULL); |
| 748 selected_uint32_defs_ = | 748 selected_uint32_defs_ = |
| 749 new(I) BitVector(flow_graph_->current_ssa_temp_index()); | 749 new(I) BitVector(I, flow_graph_->current_ssa_temp_index()); |
| 750 } | 750 } |
| 751 | 751 |
| 752 | 752 |
| 753 void IntegerInstructionSelector::Select() { | 753 void IntegerInstructionSelector::Select() { |
| 754 if (FLAG_trace_integer_ir_selection) { | 754 if (FLAG_trace_integer_ir_selection) { |
| 755 OS::Print("---- starting integer ir selection -------\n"); | 755 OS::Print("---- starting integer ir selection -------\n"); |
| 756 } | 756 } |
| 757 FindPotentialUint32Definitions(); | 757 FindPotentialUint32Definitions(); |
| 758 FindUint32NarrowingDefinitions(); | 758 FindUint32NarrowingDefinitions(); |
| 759 Propagate(); | 759 Propagate(); |
| (...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 } | 2189 } |
| 2190 } while (CanonicalizeMaxBoundary(&max) || | 2190 } while (CanonicalizeMaxBoundary(&max) || |
| 2191 CanonicalizeMinBoundary(&canonical_length)); | 2191 CanonicalizeMinBoundary(&canonical_length)); |
| 2192 | 2192 |
| 2193 // Failed to prove that maximum is bounded with array length. | 2193 // Failed to prove that maximum is bounded with array length. |
| 2194 return false; | 2194 return false; |
| 2195 } | 2195 } |
| 2196 | 2196 |
| 2197 | 2197 |
| 2198 } // namespace dart | 2198 } // namespace dart |
| OLD | NEW |