OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_REGISTER_ALLOCATOR_VERIFIER_H_ |
| 6 #define V8_REGISTER_ALLOCATOR_VERIFIER_H_ |
| 7 |
| 8 #include "src/v8.h" |
| 9 #include "src/zone-containers.h" |
| 10 |
| 11 namespace v8 { |
| 12 namespace internal { |
| 13 namespace compiler { |
| 14 |
| 15 class InstructionOperand; |
| 16 class InstructionSequence; |
| 17 |
| 18 class RegisterAllocatorVerifier FINAL : public ZoneObject { |
| 19 public: |
| 20 RegisterAllocatorVerifier(Zone* zone, const InstructionSequence* sequence); |
| 21 |
| 22 void VerifyAssignment(); |
| 23 |
| 24 private: |
| 25 enum ConstraintType { |
| 26 kConstant, |
| 27 kImmediate, |
| 28 kRegister, |
| 29 kFixedRegister, |
| 30 kDoubleRegister, |
| 31 kFixedDoubleRegister, |
| 32 kFixedSlot, |
| 33 kNone, |
| 34 kNoneDouble, |
| 35 kSameAsFirst |
| 36 }; |
| 37 |
| 38 struct OperandConstraint { |
| 39 ConstraintType type_; |
| 40 int value_; // subkind index when relevant |
| 41 }; |
| 42 |
| 43 struct InstructionConstraint { |
| 44 const Instruction* instruction_; |
| 45 size_t operand_constaints_size_; |
| 46 OperandConstraint* operand_constraints_; |
| 47 }; |
| 48 |
| 49 typedef ZoneVector<InstructionConstraint> Constraints; |
| 50 |
| 51 const InstructionSequence* sequence() const { return sequence_; } |
| 52 Constraints* constraints() { return &constraints_; } |
| 53 void BuildConstraint(const InstructionOperand* op, |
| 54 OperandConstraint* constraint); |
| 55 void CheckConstraint(const InstructionOperand* op, |
| 56 const OperandConstraint* constraint); |
| 57 |
| 58 const InstructionSequence* const sequence_; |
| 59 Constraints constraints_; |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(RegisterAllocatorVerifier); |
| 62 }; |
| 63 |
| 64 } // namespace compiler |
| 65 } // namespace internal |
| 66 } // namespace v8 |
| 67 |
| 68 #endif |
OLD | NEW |