| 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/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
| 9 #include "src/compiler/instruction.h" | 9 #include "src/compiler/instruction.h" |
| 10 #include "src/globals.h" | 10 #include "src/globals.h" |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 | 975 |
| 976 protected: | 976 protected: |
| 977 RegisterAllocationData* data() const { return data_; } | 977 RegisterAllocationData* data() const { return data_; } |
| 978 InstructionSequence* code() const { return data()->code(); } | 978 InstructionSequence* code() const { return data()->code(); } |
| 979 RegisterKind mode() const { return mode_; } | 979 RegisterKind mode() const { return mode_; } |
| 980 int num_registers() const { return num_registers_; } | 980 int num_registers() const { return num_registers_; } |
| 981 int num_allocatable_registers() const { return num_allocatable_registers_; } | 981 int num_allocatable_registers() const { return num_allocatable_registers_; } |
| 982 const int* allocatable_register_codes() const { | 982 const int* allocatable_register_codes() const { |
| 983 return allocatable_register_codes_; | 983 return allocatable_register_codes_; |
| 984 } | 984 } |
| 985 // Returns true iff. we must check float register aliasing. |
| 986 bool check_fp_aliasing() const { return check_fp_aliasing_; } |
| 985 | 987 |
| 986 // TODO(mtrofin): explain why splitting in gap START is always OK. | 988 // TODO(mtrofin): explain why splitting in gap START is always OK. |
| 987 LifetimePosition GetSplitPositionForInstruction(const LiveRange* range, | 989 LifetimePosition GetSplitPositionForInstruction(const LiveRange* range, |
| 988 int instruction_index); | 990 int instruction_index); |
| 989 | 991 |
| 990 Zone* allocation_zone() const { return data()->allocation_zone(); } | 992 Zone* allocation_zone() const { return data()->allocation_zone(); } |
| 991 | 993 |
| 992 // Find the optimal split for ranges defined by a memory operand, e.g. | 994 // Find the optimal split for ranges defined by a memory operand, e.g. |
| 993 // constants or function parameters passed on the stack. | 995 // constants or function parameters passed on the stack. |
| 994 void SplitAndSpillRangesDefinedByMemoryOperand(); | 996 void SplitAndSpillRangesDefinedByMemoryOperand(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1025 | 1027 |
| 1026 const ZoneVector<TopLevelLiveRange*>& GetFixedRegisters() const; | 1028 const ZoneVector<TopLevelLiveRange*>& GetFixedRegisters() const; |
| 1027 const char* RegisterName(int allocation_index) const; | 1029 const char* RegisterName(int allocation_index) const; |
| 1028 | 1030 |
| 1029 private: | 1031 private: |
| 1030 RegisterAllocationData* const data_; | 1032 RegisterAllocationData* const data_; |
| 1031 const RegisterKind mode_; | 1033 const RegisterKind mode_; |
| 1032 const int num_registers_; | 1034 const int num_registers_; |
| 1033 int num_allocatable_registers_; | 1035 int num_allocatable_registers_; |
| 1034 const int* allocatable_register_codes_; | 1036 const int* allocatable_register_codes_; |
| 1037 bool check_fp_aliasing_; |
| 1035 | 1038 |
| 1036 private: | 1039 private: |
| 1037 bool no_combining_; | 1040 bool no_combining_; |
| 1038 | 1041 |
| 1039 DISALLOW_COPY_AND_ASSIGN(RegisterAllocator); | 1042 DISALLOW_COPY_AND_ASSIGN(RegisterAllocator); |
| 1040 }; | 1043 }; |
| 1041 | 1044 |
| 1042 | 1045 |
| 1043 class LinearScanAllocator final : public RegisterAllocator { | 1046 class LinearScanAllocator final : public RegisterAllocator { |
| 1044 public: | 1047 public: |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 RegisterAllocationData* const data_; | 1206 RegisterAllocationData* const data_; |
| 1204 | 1207 |
| 1205 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector); | 1208 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector); |
| 1206 }; | 1209 }; |
| 1207 | 1210 |
| 1208 } // namespace compiler | 1211 } // namespace compiler |
| 1209 } // namespace internal | 1212 } // namespace internal |
| 1210 } // namespace v8 | 1213 } // namespace v8 |
| 1211 | 1214 |
| 1212 #endif // V8_REGISTER_ALLOCATOR_H_ | 1215 #endif // V8_REGISTER_ALLOCATOR_H_ |
| OLD | NEW |