| 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/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/compiler/instruction.h" | 9 #include "src/compiler/instruction.h" |
| 10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 void AllocateGeneralRegisters(); | 375 void AllocateGeneralRegisters(); |
| 376 void AllocateDoubleRegisters(); | 376 void AllocateDoubleRegisters(); |
| 377 void ConnectRanges(); | 377 void ConnectRanges(); |
| 378 void ResolveControlFlow(); | 378 void ResolveControlFlow(); |
| 379 void PopulatePointerMaps(); // TODO(titzer): rename to PopulateReferenceMaps. | 379 void PopulatePointerMaps(); // TODO(titzer): rename to PopulateReferenceMaps. |
| 380 void AllocateRegisters(); | 380 void AllocateRegisters(); |
| 381 bool CanEagerlyResolveControlFlow(BasicBlock* block) const; | 381 bool CanEagerlyResolveControlFlow(BasicBlock* block) const; |
| 382 inline bool SafePointsAreInOrder() const; | 382 inline bool SafePointsAreInOrder() const; |
| 383 | 383 |
| 384 // Liveness analysis support. | 384 // Liveness analysis support. |
| 385 void InitializeLivenessAnalysis(); | 385 void ComputeLiveOut(BasicBlock* block); |
| 386 BitVector* ComputeLiveOut(BasicBlock* block); | 386 void AddInitialIntervals(BasicBlock* block); |
| 387 void AddInitialIntervals(BasicBlock* block, BitVector* live_out); | |
| 388 bool IsOutputRegisterOf(Instruction* instr, int index); | 387 bool IsOutputRegisterOf(Instruction* instr, int index); |
| 389 bool IsOutputDoubleRegisterOf(Instruction* instr, int index); | 388 bool IsOutputDoubleRegisterOf(Instruction* instr, int index); |
| 390 void ProcessInstructions(BasicBlock* block, BitVector* live); | 389 void ProcessInstructions(BasicBlock* block); |
| 391 void MeetRegisterConstraints(BasicBlock* block); | 390 void MeetRegisterConstraints(BasicBlock* block); |
| 392 void MeetConstraintsBetween(Instruction* first, Instruction* second, | 391 void MeetConstraintsBetween(Instruction* first, Instruction* second, |
| 393 int gap_index); | 392 int gap_index); |
| 394 void MeetRegisterConstraintsForLastInstructionInBlock(BasicBlock* block); | 393 void MeetRegisterConstraintsForLastInstructionInBlock(BasicBlock* block); |
| 395 void ResolvePhis(BasicBlock* block); | 394 void ResolvePhis(BasicBlock* block); |
| 396 | 395 |
| 397 // Helper methods for building intervals. | 396 // Helper methods for building intervals. |
| 398 InstructionOperand* AllocateFixed(UnallocatedOperand* operand, int pos, | 397 InstructionOperand* AllocateFixed(UnallocatedOperand* operand, int pos, |
| 399 bool is_tagged); | 398 bool is_tagged); |
| 400 LiveRange* LiveRangeFor(InstructionOperand* operand); | 399 LiveRange* LiveRangeFor(InstructionOperand* operand); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 | 490 |
| 492 inline Instruction* InstructionAt(int index) { | 491 inline Instruction* InstructionAt(int index) { |
| 493 return code()->InstructionAt(index); | 492 return code()->InstructionAt(index); |
| 494 } | 493 } |
| 495 | 494 |
| 496 Zone zone_; | 495 Zone zone_; |
| 497 InstructionSequence* code_; | 496 InstructionSequence* code_; |
| 498 | 497 |
| 499 // During liveness analysis keep a mapping from block id to live_in sets | 498 // During liveness analysis keep a mapping from block id to live_in sets |
| 500 // for blocks already analyzed. | 499 // for blocks already analyzed. |
| 501 ZoneList<BitVector*> live_in_sets_; | 500 class LiveInSets; |
| 501 LiveInSets* live_in_sets_; |
| 502 | 502 |
| 503 // Liveness analysis results. | 503 // Liveness analysis results. |
| 504 ZoneList<LiveRange*> live_ranges_; | 504 ZoneList<LiveRange*> live_ranges_; |
| 505 | 505 |
| 506 // Lists of live ranges | 506 // Lists of live ranges |
| 507 EmbeddedVector<LiveRange*, Register::kMaxNumAllocatableRegisters> | 507 EmbeddedVector<LiveRange*, Register::kMaxNumAllocatableRegisters> |
| 508 fixed_live_ranges_; | 508 fixed_live_ranges_; |
| 509 EmbeddedVector<LiveRange*, DoubleRegister::kMaxNumAllocatableRegisters> | 509 EmbeddedVector<LiveRange*, DoubleRegister::kMaxNumAllocatableRegisters> |
| 510 fixed_double_live_ranges_; | 510 fixed_double_live_ranges_; |
| 511 ZoneList<LiveRange*> unhandled_live_ranges_; | 511 ZoneList<LiveRange*> unhandled_live_ranges_; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 539 RegisterAllocator* allocator_; | 539 RegisterAllocator* allocator_; |
| 540 unsigned allocator_zone_start_allocation_size_; | 540 unsigned allocator_zone_start_allocation_size_; |
| 541 | 541 |
| 542 DISALLOW_COPY_AND_ASSIGN(RegisterAllocatorPhase); | 542 DISALLOW_COPY_AND_ASSIGN(RegisterAllocatorPhase); |
| 543 }; | 543 }; |
| 544 } | 544 } |
| 545 } | 545 } |
| 546 } // namespace v8::internal::compiler | 546 } // namespace v8::internal::compiler |
| 547 | 547 |
| 548 #endif // V8_REGISTER_ALLOCATOR_H_ | 548 #endif // V8_REGISTER_ALLOCATOR_H_ |
| OLD | NEW |