| 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 | 627 |
| 628 LOperand* LAllocator::AllocateFixed(LUnallocated* operand, | 628 LOperand* LAllocator::AllocateFixed(LUnallocated* operand, |
| 629 int pos, | 629 int pos, |
| 630 bool is_tagged) { | 630 bool is_tagged) { |
| 631 TraceAlloc("Allocating fixed reg for op %d\n", operand->virtual_register()); | 631 TraceAlloc("Allocating fixed reg for op %d\n", operand->virtual_register()); |
| 632 ASSERT(operand->HasFixedPolicy()); | 632 ASSERT(operand->HasFixedPolicy()); |
| 633 if (operand->HasFixedSlotPolicy()) { | 633 if (operand->HasFixedSlotPolicy()) { |
| 634 operand->ConvertTo(LOperand::STACK_SLOT, operand->fixed_slot_index()); | 634 operand->ConvertTo(LOperand::STACK_SLOT, operand->fixed_slot_index()); |
| 635 } else if (operand->HasFixedRegisterPolicy()) { | 635 } else if (operand->HasFixedRegisterPolicy()) { |
| 636 int reg_index = operand->fixed_register_index(); | 636 int reg_index = operand->fixed_register_index(); |
| 637 modified_registers_ |= 1 << reg_index; |
| 637 operand->ConvertTo(LOperand::REGISTER, reg_index); | 638 operand->ConvertTo(LOperand::REGISTER, reg_index); |
| 638 } else if (operand->HasFixedDoubleRegisterPolicy()) { | 639 } else if (operand->HasFixedDoubleRegisterPolicy()) { |
| 639 int reg_index = operand->fixed_register_index(); | 640 int reg_index = operand->fixed_register_index(); |
| 641 modified_double_registers_ |= 1 << reg_index; |
| 640 operand->ConvertTo(LOperand::DOUBLE_REGISTER, reg_index); | 642 operand->ConvertTo(LOperand::DOUBLE_REGISTER, reg_index); |
| 641 } else { | 643 } else { |
| 642 UNREACHABLE(); | 644 UNREACHABLE(); |
| 643 } | 645 } |
| 644 if (is_tagged) { | 646 if (is_tagged) { |
| 645 TraceAlloc("Fixed reg is tagged at %d\n", pos); | 647 TraceAlloc("Fixed reg is tagged at %d\n", pos); |
| 646 LInstruction* instr = InstructionAt(pos); | 648 LInstruction* instr = InstructionAt(pos); |
| 647 if (instr->HasPointerMap()) { | 649 if (instr->HasPointerMap()) { |
| 648 instr->pointer_map()->RecordPointer(operand, chunk()->zone()); | 650 instr->pointer_map()->RecordPointer(operand, chunk()->zone()); |
| 649 } | 651 } |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 | 1096 |
| 1095 bool LAllocator::Allocate(LChunk* chunk) { | 1097 bool LAllocator::Allocate(LChunk* chunk) { |
| 1096 ASSERT(chunk_ == NULL); | 1098 ASSERT(chunk_ == NULL); |
| 1097 chunk_ = static_cast<LPlatformChunk*>(chunk); | 1099 chunk_ = static_cast<LPlatformChunk*>(chunk); |
| 1098 assigned_registers_ = | 1100 assigned_registers_ = |
| 1099 new(chunk->zone()) BitVector(Register::NumAllocatableRegisters(), | 1101 new(chunk->zone()) BitVector(Register::NumAllocatableRegisters(), |
| 1100 chunk->zone()); | 1102 chunk->zone()); |
| 1101 assigned_double_registers_ = | 1103 assigned_double_registers_ = |
| 1102 new(chunk->zone()) BitVector(DoubleRegister::NumAllocatableRegisters(), | 1104 new(chunk->zone()) BitVector(DoubleRegister::NumAllocatableRegisters(), |
| 1103 chunk->zone()); | 1105 chunk->zone()); |
| 1106 modified_registers_ = kRegListEmpty; |
| 1107 modified_double_registers_ = kRegListEmpty; |
| 1104 MeetRegisterConstraints(); | 1108 MeetRegisterConstraints(); |
| 1105 if (!AllocationOk()) return false; | 1109 if (!AllocationOk()) return false; |
| 1106 ResolvePhis(); | 1110 ResolvePhis(); |
| 1107 BuildLiveRanges(); | 1111 BuildLiveRanges(); |
| 1108 AllocateGeneralRegisters(); | 1112 AllocateGeneralRegisters(); |
| 1109 if (!AllocationOk()) return false; | 1113 if (!AllocationOk()) return false; |
| 1110 AllocateDoubleRegisters(); | 1114 AllocateDoubleRegisters(); |
| 1111 if (!AllocationOk()) return false; | 1115 if (!AllocationOk()) return false; |
| 1112 PopulatePointerMaps(); | 1116 PopulatePointerMaps(); |
| 1113 ConnectRanges(); | 1117 ConnectRanges(); |
| (...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2212 isolate()->GetHTracer()->TraceLiveRanges(name(), allocator_); | 2216 isolate()->GetHTracer()->TraceLiveRanges(name(), allocator_); |
| 2213 } | 2217 } |
| 2214 | 2218 |
| 2215 #ifdef DEBUG | 2219 #ifdef DEBUG |
| 2216 if (allocator_ != NULL) allocator_->Verify(); | 2220 if (allocator_ != NULL) allocator_->Verify(); |
| 2217 #endif | 2221 #endif |
| 2218 } | 2222 } |
| 2219 | 2223 |
| 2220 | 2224 |
| 2221 } } // namespace v8::internal | 2225 } } // namespace v8::internal |
| OLD | NEW |