OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/register-allocator.h" | 5 #include "src/compiler/register-allocator.h" |
6 | 6 |
7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/base/adapters.h" | 8 #include "src/base/adapters.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/string-stream.h" | 10 #include "src/string-stream.h" |
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 InstructionOperand* output = second->OutputAt(i); | 1770 InstructionOperand* output = second->OutputAt(i); |
1771 if (!output->IsUnallocated()) continue; | 1771 if (!output->IsUnallocated()) continue; |
1772 UnallocatedOperand* second_output = UnallocatedOperand::cast(output); | 1772 UnallocatedOperand* second_output = UnallocatedOperand::cast(output); |
1773 if (!second_output->HasSameAsInputPolicy()) continue; | 1773 if (!second_output->HasSameAsInputPolicy()) continue; |
1774 DCHECK(i == 0); // Only valid for first output. | 1774 DCHECK(i == 0); // Only valid for first output. |
1775 UnallocatedOperand* cur_input = | 1775 UnallocatedOperand* cur_input = |
1776 UnallocatedOperand::cast(second->InputAt(0)); | 1776 UnallocatedOperand::cast(second->InputAt(0)); |
1777 int output_vreg = second_output->virtual_register(); | 1777 int output_vreg = second_output->virtual_register(); |
1778 int input_vreg = cur_input->virtual_register(); | 1778 int input_vreg = cur_input->virtual_register(); |
1779 UnallocatedOperand input_copy(UnallocatedOperand::ANY, input_vreg); | 1779 UnallocatedOperand input_copy(UnallocatedOperand::ANY, input_vreg); |
1780 cur_input->set_virtual_register(second_output->virtual_register()); | 1780 *cur_input = |
| 1781 UnallocatedOperand(*cur_input, second_output->virtual_register()); |
1781 MoveOperands* gap_move = data()->AddGapMove(instr_index, Instruction::END, | 1782 MoveOperands* gap_move = data()->AddGapMove(instr_index, Instruction::END, |
1782 input_copy, *cur_input); | 1783 input_copy, *cur_input); |
1783 if (code()->IsReference(input_vreg) && !code()->IsReference(output_vreg)) { | 1784 if (code()->IsReference(input_vreg) && !code()->IsReference(output_vreg)) { |
1784 if (second->HasReferenceMap()) { | 1785 if (second->HasReferenceMap()) { |
1785 RegisterAllocationData::DelayedReference delayed_reference = { | 1786 RegisterAllocationData::DelayedReference delayed_reference = { |
1786 second->reference_map(), &gap_move->source()}; | 1787 second->reference_map(), &gap_move->source()}; |
1787 data()->delayed_references().push_back(delayed_reference); | 1788 data()->delayed_references().push_back(delayed_reference); |
1788 } | 1789 } |
1789 } else if (!code()->IsReference(input_vreg) && | 1790 } else if (!code()->IsReference(input_vreg) && |
1790 code()->IsReference(output_vreg)) { | 1791 code()->IsReference(output_vreg)) { |
(...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4012 } | 4013 } |
4013 } | 4014 } |
4014 } | 4015 } |
4015 } | 4016 } |
4016 } | 4017 } |
4017 | 4018 |
4018 | 4019 |
4019 } // namespace compiler | 4020 } // namespace compiler |
4020 } // namespace internal | 4021 } // namespace internal |
4021 } // namespace v8 | 4022 } // namespace v8 |
OLD | NEW |