OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 int LAllocator::FixedDoubleLiveRangeID(int index) { | 618 int LAllocator::FixedDoubleLiveRangeID(int index) { |
619 return -index - 1 - Register::kMaxNumAllocatableRegisters; | 619 return -index - 1 - Register::kMaxNumAllocatableRegisters; |
620 } | 620 } |
621 | 621 |
622 | 622 |
623 LOperand* LAllocator::AllocateFixed(LUnallocated* operand, | 623 LOperand* LAllocator::AllocateFixed(LUnallocated* operand, |
624 int pos, | 624 int pos, |
625 bool is_tagged) { | 625 bool is_tagged) { |
626 TraceAlloc("Allocating fixed reg for op %d\n", operand->virtual_register()); | 626 TraceAlloc("Allocating fixed reg for op %d\n", operand->virtual_register()); |
627 ASSERT(operand->HasFixedPolicy()); | 627 ASSERT(operand->HasFixedPolicy()); |
628 if (operand->policy() == LUnallocated::FIXED_SLOT) { | 628 if (operand->HasFixedSlotPolicy()) { |
629 operand->ConvertTo(LOperand::STACK_SLOT, operand->fixed_index()); | 629 operand->ConvertTo(LOperand::STACK_SLOT, operand->fixed_slot_index()); |
630 } else if (operand->policy() == LUnallocated::FIXED_REGISTER) { | 630 } else if (operand->HasFixedRegisterPolicy()) { |
631 int reg_index = operand->fixed_index(); | 631 int reg_index = operand->fixed_register_index(); |
632 operand->ConvertTo(LOperand::REGISTER, reg_index); | 632 operand->ConvertTo(LOperand::REGISTER, reg_index); |
633 } else if (operand->policy() == LUnallocated::FIXED_DOUBLE_REGISTER) { | 633 } else if (operand->HasFixedDoubleRegisterPolicy()) { |
634 int reg_index = operand->fixed_index(); | 634 int reg_index = operand->fixed_register_index(); |
635 operand->ConvertTo(LOperand::DOUBLE_REGISTER, reg_index); | 635 operand->ConvertTo(LOperand::DOUBLE_REGISTER, reg_index); |
636 } else { | 636 } else { |
637 UNREACHABLE(); | 637 UNREACHABLE(); |
638 } | 638 } |
639 if (is_tagged) { | 639 if (is_tagged) { |
640 TraceAlloc("Fixed reg is tagged at %d\n", pos); | 640 TraceAlloc("Fixed reg is tagged at %d\n", pos); |
641 LInstruction* instr = InstructionAt(pos); | 641 LInstruction* instr = InstructionAt(pos); |
642 if (instr->HasPointerMap()) { | 642 if (instr->HasPointerMap()) { |
643 instr->pointer_map()->RecordPointer(operand, zone()); | 643 instr->pointer_map()->RecordPointer(operand, zone()); |
644 } | 644 } |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 839 |
840 // Handle fixed input operands of second instruction. | 840 // Handle fixed input operands of second instruction. |
841 if (second != NULL) { | 841 if (second != NULL) { |
842 for (UseIterator it(second); !it.Done(); it.Advance()) { | 842 for (UseIterator it(second); !it.Done(); it.Advance()) { |
843 LUnallocated* cur_input = LUnallocated::cast(it.Current()); | 843 LUnallocated* cur_input = LUnallocated::cast(it.Current()); |
844 if (cur_input->HasFixedPolicy()) { | 844 if (cur_input->HasFixedPolicy()) { |
845 LUnallocated* input_copy = cur_input->CopyUnconstrained(zone()); | 845 LUnallocated* input_copy = cur_input->CopyUnconstrained(zone()); |
846 bool is_tagged = HasTaggedValue(cur_input->virtual_register()); | 846 bool is_tagged = HasTaggedValue(cur_input->virtual_register()); |
847 AllocateFixed(cur_input, gap_index + 1, is_tagged); | 847 AllocateFixed(cur_input, gap_index + 1, is_tagged); |
848 AddConstraintsGapMove(gap_index, input_copy, cur_input); | 848 AddConstraintsGapMove(gap_index, input_copy, cur_input); |
849 } else if (cur_input->policy() == LUnallocated::WRITABLE_REGISTER) { | 849 } else if (cur_input->HasWritableRegisterPolicy()) { |
850 // The live range of writable input registers always goes until the end | 850 // The live range of writable input registers always goes until the end |
851 // of the instruction. | 851 // of the instruction. |
852 ASSERT(!cur_input->IsUsedAtStart()); | 852 ASSERT(!cur_input->IsUsedAtStart()); |
853 | 853 |
854 LUnallocated* input_copy = cur_input->CopyUnconstrained(zone()); | 854 LUnallocated* input_copy = cur_input->CopyUnconstrained(zone()); |
855 int vreg = GetVirtualRegister(); | 855 int vreg = GetVirtualRegister(); |
856 if (!AllocationOk()) return; | 856 if (!AllocationOk()) return; |
857 cur_input->set_virtual_register(vreg); | 857 cur_input->set_virtual_register(vreg); |
858 | 858 |
859 if (RequiredRegisterKind(input_copy->virtual_register()) == | 859 if (RequiredRegisterKind(input_copy->virtual_register()) == |
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2188 LiveRange* current = live_ranges()->at(i); | 2188 LiveRange* current = live_ranges()->at(i); |
2189 if (current != NULL) current->Verify(); | 2189 if (current != NULL) current->Verify(); |
2190 } | 2190 } |
2191 } | 2191 } |
2192 | 2192 |
2193 | 2193 |
2194 #endif | 2194 #endif |
2195 | 2195 |
2196 | 2196 |
2197 } } // namespace v8::internal | 2197 } } // namespace v8::internal |
OLD | NEW |