| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_allocator.h" | 5 #include "vm/flow_graph_allocator.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/il_printer.h" | 9 #include "vm/il_printer.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 | 737 |
| 738 // Create and update live ranges corresponding to instruction's inputs, | 738 // Create and update live ranges corresponding to instruction's inputs, |
| 739 // temporaries and output. | 739 // temporaries and output. |
| 740 void FlowGraphAllocator::ProcessOneInstruction(BlockEntryInstr* block, | 740 void FlowGraphAllocator::ProcessOneInstruction(BlockEntryInstr* block, |
| 741 Instruction* current) { | 741 Instruction* current) { |
| 742 const intptr_t pos = current->lifetime_position(); | 742 const intptr_t pos = current->lifetime_position(); |
| 743 ASSERT(IsInstructionStartPosition(pos)); | 743 ASSERT(IsInstructionStartPosition(pos)); |
| 744 | 744 |
| 745 LocationSummary* locs = current->locs(); | 745 LocationSummary* locs = current->locs(); |
| 746 | 746 |
| 747 // TODO(vegorov): number of inputs must match number of input locations. | 747 // Number of input locations and number of input operands have to agree. |
| 748 if (locs->input_count() != current->InputCount()) { | 748 ASSERT(locs->input_count() == current->InputCount()); |
| 749 builder_->Bailout("ssa allocator: number of input locations mismatch"); | |
| 750 } | |
| 751 | 749 |
| 752 // Normalize same-as-first-input output if input is specified as | 750 // Normalize same-as-first-input output if input is specified as |
| 753 // fixed register. | 751 // fixed register. |
| 754 if (locs->out().IsUnallocated() && | 752 if (locs->out().IsUnallocated() && |
| 755 (locs->out().policy() == Location::kSameAsFirstInput) && | 753 (locs->out().policy() == Location::kSameAsFirstInput) && |
| 756 (locs->in(0).IsRegister())) { | 754 (locs->in(0).IsRegister())) { |
| 757 locs->set_out(locs->in(0)); | 755 locs->set_out(locs->in(0)); |
| 758 } | 756 } |
| 759 | 757 |
| 760 const bool output_same_as_first_input = | 758 const bool output_same_as_first_input = |
| (...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2035 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", | 2033 OS::Print("-- [after ssa allocator] ir [%s] -------------\n", |
| 2036 function.ToFullyQualifiedCString()); | 2034 function.ToFullyQualifiedCString()); |
| 2037 FlowGraphPrinter printer(Function::Handle(), block_order_, true); | 2035 FlowGraphPrinter printer(Function::Handle(), block_order_, true); |
| 2038 printer.PrintBlocks(); | 2036 printer.PrintBlocks(); |
| 2039 OS::Print("----------------------------------------------\n"); | 2037 OS::Print("----------------------------------------------\n"); |
| 2040 } | 2038 } |
| 2041 } | 2039 } |
| 2042 | 2040 |
| 2043 | 2041 |
| 2044 } // namespace dart | 2042 } // namespace dart |
| OLD | NEW |