| 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 #ifndef V8_REGISTER_ALLOCATOR_H_ | 5 #ifndef V8_REGISTER_ALLOCATOR_H_ |
| 6 #define V8_REGISTER_ALLOCATOR_H_ | 6 #define V8_REGISTER_ALLOCATOR_H_ |
| 7 | 7 |
| 8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
| 9 #include "src/zone-containers.h" | 9 #include "src/zone-containers.h" |
| 10 | 10 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 void ResolvePhis(); | 396 void ResolvePhis(); |
| 397 | 397 |
| 398 // Phase 3: compute liveness of all virtual register. | 398 // Phase 3: compute liveness of all virtual register. |
| 399 void BuildLiveRanges(); | 399 void BuildLiveRanges(); |
| 400 bool ExistsUseWithoutDefinition(); | 400 bool ExistsUseWithoutDefinition(); |
| 401 | 401 |
| 402 // Phase 4: compute register assignments. | 402 // Phase 4: compute register assignments. |
| 403 void AllocateGeneralRegisters(); | 403 void AllocateGeneralRegisters(); |
| 404 void AllocateDoubleRegisters(); | 404 void AllocateDoubleRegisters(); |
| 405 | 405 |
| 406 // Phase 5: reassign spill splots for maximal reuse. | 406 // Phase 5: assign spill splots. |
| 407 void ReuseSpillSlots(); | 407 void AssignSpillSlots(); |
| 408 | 408 |
| 409 // Phase 6: commit assignment. | 409 // Phase 6: commit assignment. |
| 410 void CommitAssignment(); | 410 void CommitAssignment(); |
| 411 | 411 |
| 412 // Phase 7: compute values for pointer maps. | 412 // Phase 7: compute values for pointer maps. |
| 413 void PopulatePointerMaps(); // TODO(titzer): rename to PopulateReferenceMaps. | 413 void PopulatePointerMaps(); // TODO(titzer): rename to PopulateReferenceMaps. |
| 414 | 414 |
| 415 // Phase 8: reconnect split ranges with moves. | 415 // Phase 8: reconnect split ranges with moves. |
| 416 void ConnectRanges(); | 416 void ConnectRanges(); |
| 417 | 417 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 void ActiveToHandled(LiveRange* range); | 477 void ActiveToHandled(LiveRange* range); |
| 478 void ActiveToInactive(LiveRange* range); | 478 void ActiveToInactive(LiveRange* range); |
| 479 void InactiveToHandled(LiveRange* range); | 479 void InactiveToHandled(LiveRange* range); |
| 480 void InactiveToActive(LiveRange* range); | 480 void InactiveToActive(LiveRange* range); |
| 481 | 481 |
| 482 // Helper methods for allocating registers. | 482 // Helper methods for allocating registers. |
| 483 bool TryReuseSpillForPhi(LiveRange* range); | 483 bool TryReuseSpillForPhi(LiveRange* range); |
| 484 bool TryAllocateFreeReg(LiveRange* range); | 484 bool TryAllocateFreeReg(LiveRange* range); |
| 485 void AllocateBlockedReg(LiveRange* range); | 485 void AllocateBlockedReg(LiveRange* range); |
| 486 SpillRange* AssignSpillRangeToLiveRange(LiveRange* range); | 486 SpillRange* AssignSpillRangeToLiveRange(LiveRange* range); |
| 487 void FreeSpillSlot(LiveRange* range); | |
| 488 InstructionOperand* TryReuseSpillSlot(LiveRange* range); | |
| 489 | 487 |
| 490 // Live range splitting helpers. | 488 // Live range splitting helpers. |
| 491 | 489 |
| 492 // Split the given range at the given position. | 490 // Split the given range at the given position. |
| 493 // If range starts at or after the given position then the | 491 // If range starts at or after the given position then the |
| 494 // original range is returned. | 492 // original range is returned. |
| 495 // Otherwise returns the live range that starts at pos and contains | 493 // Otherwise returns the live range that starts at pos and contains |
| 496 // all uses from the original range that follow pos. Uses at pos will | 494 // all uses from the original range that follow pos. Uses at pos will |
| 497 // still be owned by the original range after splitting. | 495 // still be owned by the original range after splitting. |
| 498 LiveRange* SplitRangeAt(LiveRange* range, LifetimePosition pos); | 496 LiveRange* SplitRangeAt(LiveRange* range, LifetimePosition pos); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 #endif | 618 #endif |
| 621 | 619 |
| 622 DISALLOW_COPY_AND_ASSIGN(RegisterAllocator); | 620 DISALLOW_COPY_AND_ASSIGN(RegisterAllocator); |
| 623 }; | 621 }; |
| 624 | 622 |
| 625 } // namespace compiler | 623 } // namespace compiler |
| 626 } // namespace internal | 624 } // namespace internal |
| 627 } // namespace v8 | 625 } // namespace v8 |
| 628 | 626 |
| 629 #endif // V8_REGISTER_ALLOCATOR_H_ | 627 #endif // V8_REGISTER_ALLOCATOR_H_ |
| OLD | NEW |