| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 | 738 |
| 739 void LAllocator::AddConstraintsGapMove(int index, | 739 void LAllocator::AddConstraintsGapMove(int index, |
| 740 LOperand* from, | 740 LOperand* from, |
| 741 LOperand* to) { | 741 LOperand* to) { |
| 742 LGap* gap = chunk_->GetGapAt(index); | 742 LGap* gap = chunk_->GetGapAt(index); |
| 743 LParallelMove* move = gap->GetOrCreateParallelMove(LGap::START); | 743 LParallelMove* move = gap->GetOrCreateParallelMove(LGap::START); |
| 744 if (from->IsUnallocated()) { | 744 if (from->IsUnallocated()) { |
| 745 const ZoneList<LMoveOperands>* move_operands = move->move_operands(); | 745 const ZoneList<LMoveOperands>* move_operands = move->move_operands(); |
| 746 for (int i = 0; i < move_operands->length(); ++i) { | 746 for (int i = 0; i < move_operands->length(); ++i) { |
| 747 LMoveOperands cur = move_operands->at(i); | 747 LMoveOperands cur = move_operands->at(i); |
| 748 LOperand* cur_to = cur.to(); | 748 LOperand* cur_to = cur.destination(); |
| 749 if (cur_to->IsUnallocated()) { | 749 if (cur_to->IsUnallocated()) { |
| 750 if (cur_to->VirtualRegister() == from->VirtualRegister()) { | 750 if (cur_to->VirtualRegister() == from->VirtualRegister()) { |
| 751 move->AddMove(cur.from(), to); | 751 move->AddMove(cur.source(), to); |
| 752 return; | 752 return; |
| 753 } | 753 } |
| 754 } | 754 } |
| 755 } | 755 } |
| 756 } | 756 } |
| 757 move->AddMove(from, to); | 757 move->AddMove(from, to); |
| 758 } | 758 } |
| 759 | 759 |
| 760 | 760 |
| 761 void LAllocator::MeetRegisterConstraints(HBasicBlock* block) { | 761 void LAllocator::MeetRegisterConstraints(HBasicBlock* block) { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 LifetimePosition::FromInstructionIndex(index); | 889 LifetimePosition::FromInstructionIndex(index); |
| 890 | 890 |
| 891 if (chunk_->IsGapAt(index)) { | 891 if (chunk_->IsGapAt(index)) { |
| 892 // We have a gap at this position. | 892 // We have a gap at this position. |
| 893 LGap* gap = chunk_->GetGapAt(index); | 893 LGap* gap = chunk_->GetGapAt(index); |
| 894 LParallelMove* move = gap->GetOrCreateParallelMove(LGap::START); | 894 LParallelMove* move = gap->GetOrCreateParallelMove(LGap::START); |
| 895 const ZoneList<LMoveOperands>* move_operands = move->move_operands(); | 895 const ZoneList<LMoveOperands>* move_operands = move->move_operands(); |
| 896 for (int i = 0; i < move_operands->length(); ++i) { | 896 for (int i = 0; i < move_operands->length(); ++i) { |
| 897 LMoveOperands* cur = &move_operands->at(i); | 897 LMoveOperands* cur = &move_operands->at(i); |
| 898 if (cur->IsIgnored()) continue; | 898 if (cur->IsIgnored()) continue; |
| 899 LOperand* from = cur->from(); | 899 LOperand* from = cur->source(); |
| 900 LOperand* to = cur->to(); | 900 LOperand* to = cur->destination(); |
| 901 HPhi* phi = LookupPhi(to); | 901 HPhi* phi = LookupPhi(to); |
| 902 LOperand* hint = to; | 902 LOperand* hint = to; |
| 903 if (phi != NULL) { | 903 if (phi != NULL) { |
| 904 // This is a phi resolving move. | 904 // This is a phi resolving move. |
| 905 if (!phi->block()->IsLoopHeader()) { | 905 if (!phi->block()->IsLoopHeader()) { |
| 906 hint = LiveRangeFor(phi->id())->FirstHint(); | 906 hint = LiveRangeFor(phi->id())->FirstHint(); |
| 907 } | 907 } |
| 908 } else { | 908 } else { |
| 909 if (to->IsUnallocated()) { | 909 if (to->IsUnallocated()) { |
| 910 if (live->Contains(to->VirtualRegister())) { | 910 if (live->Contains(to->VirtualRegister())) { |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 // The live range interval already ends at the first instruction of the | 1210 // The live range interval already ends at the first instruction of the |
| 1211 // block. | 1211 // block. |
| 1212 HPhi* phi = phis->at(i); | 1212 HPhi* phi = phis->at(i); |
| 1213 live->Remove(phi->id()); | 1213 live->Remove(phi->id()); |
| 1214 | 1214 |
| 1215 LOperand* hint = NULL; | 1215 LOperand* hint = NULL; |
| 1216 LOperand* phi_operand = NULL; | 1216 LOperand* phi_operand = NULL; |
| 1217 LGap* gap = GetLastGap(phi->block()->predecessors()->at(0)); | 1217 LGap* gap = GetLastGap(phi->block()->predecessors()->at(0)); |
| 1218 LParallelMove* move = gap->GetOrCreateParallelMove(LGap::START); | 1218 LParallelMove* move = gap->GetOrCreateParallelMove(LGap::START); |
| 1219 for (int j = 0; j < move->move_operands()->length(); ++j) { | 1219 for (int j = 0; j < move->move_operands()->length(); ++j) { |
| 1220 LOperand* to = move->move_operands()->at(j).to(); | 1220 LOperand* to = move->move_operands()->at(j).destination(); |
| 1221 if (to->IsUnallocated() && to->VirtualRegister() == phi->id()) { | 1221 if (to->IsUnallocated() && to->VirtualRegister() == phi->id()) { |
| 1222 hint = move->move_operands()->at(j).from(); | 1222 hint = move->move_operands()->at(j).source(); |
| 1223 phi_operand = to; | 1223 phi_operand = to; |
| 1224 break; | 1224 break; |
| 1225 } | 1225 } |
| 1226 } | 1226 } |
| 1227 ASSERT(hint != NULL); | 1227 ASSERT(hint != NULL); |
| 1228 | 1228 |
| 1229 LifetimePosition block_start = LifetimePosition::FromInstructionIndex( | 1229 LifetimePosition block_start = LifetimePosition::FromInstructionIndex( |
| 1230 block->first_instruction_index()); | 1230 block->first_instruction_index()); |
| 1231 Define(block_start, phi_operand, hint); | 1231 Define(block_start, phi_operand, hint); |
| 1232 } | 1232 } |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 LiveRange* current = live_ranges()->at(i); | 2148 LiveRange* current = live_ranges()->at(i); |
| 2149 if (current != NULL) current->Verify(); | 2149 if (current != NULL) current->Verify(); |
| 2150 } | 2150 } |
| 2151 } | 2151 } |
| 2152 | 2152 |
| 2153 | 2153 |
| 2154 #endif | 2154 #endif |
| 2155 | 2155 |
| 2156 | 2156 |
| 2157 } } // namespace v8::internal | 2157 } } // namespace v8::internal |
| OLD | NEW |