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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 int spill_start_index_; | 315 int spill_start_index_; |
316 | 316 |
317 friend class RegisterAllocator; // Assigns to kind_. | 317 friend class RegisterAllocator; // Assigns to kind_. |
318 | 318 |
319 DISALLOW_COPY_AND_ASSIGN(LiveRange); | 319 DISALLOW_COPY_AND_ASSIGN(LiveRange); |
320 }; | 320 }; |
321 | 321 |
322 | 322 |
323 class RegisterAllocator FINAL { | 323 class RegisterAllocator FINAL { |
324 public: | 324 public: |
| 325 enum VerificationType { kNoVerify, kVerifyAssignment }; |
| 326 |
325 explicit RegisterAllocator(const RegisterConfiguration* config, | 327 explicit RegisterAllocator(const RegisterConfiguration* config, |
326 Zone* local_zone, Frame* frame, | 328 Zone* local_zone, Frame* frame, |
327 InstructionSequence* code, | 329 InstructionSequence* code, |
328 const char* debug_name = nullptr); | 330 const char* debug_name = nullptr); |
329 | 331 |
330 bool Allocate(PipelineStatistics* stats = NULL); | 332 bool Allocate(PipelineStatistics* stats = NULL, |
| 333 VerificationType verification_type = kNoVerify); |
331 bool AllocationOk() { return allocation_ok_; } | 334 bool AllocationOk() { return allocation_ok_; } |
332 BitVector* assigned_registers() { return assigned_registers_; } | 335 BitVector* assigned_registers() { return assigned_registers_; } |
333 BitVector* assigned_double_registers() { return assigned_double_registers_; } | 336 BitVector* assigned_double_registers() { return assigned_double_registers_; } |
334 | 337 |
335 const ZoneList<LiveRange*>& live_ranges() const { return live_ranges_; } | 338 const ZoneList<LiveRange*>& live_ranges() const { return live_ranges_; } |
336 const ZoneVector<LiveRange*>& fixed_live_ranges() const { | 339 const ZoneVector<LiveRange*>& fixed_live_ranges() const { |
337 return fixed_live_ranges_; | 340 return fixed_live_ranges_; |
338 } | 341 } |
339 const ZoneVector<LiveRange*>& fixed_double_live_ranges() const { | 342 const ZoneVector<LiveRange*>& fixed_double_live_ranges() const { |
340 return fixed_double_live_ranges_; | 343 return fixed_double_live_ranges_; |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 #endif | 537 #endif |
535 | 538 |
536 DISALLOW_COPY_AND_ASSIGN(RegisterAllocator); | 539 DISALLOW_COPY_AND_ASSIGN(RegisterAllocator); |
537 }; | 540 }; |
538 | 541 |
539 } | 542 } |
540 } | 543 } |
541 } // namespace v8::internal::compiler | 544 } // namespace v8::internal::compiler |
542 | 545 |
543 #endif // V8_REGISTER_ALLOCATOR_H_ | 546 #endif // V8_REGISTER_ALLOCATOR_H_ |
OLD | NEW |