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_COMPILER_INSTRUCTION_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_H_ |
6 #define V8_COMPILER_INSTRUCTION_H_ | 6 #define V8_COMPILER_INSTRUCTION_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 class UnallocatedOperand : public InstructionOperand { | 130 class UnallocatedOperand : public InstructionOperand { |
131 public: | 131 public: |
132 enum BasicPolicy { FIXED_SLOT, EXTENDED_POLICY }; | 132 enum BasicPolicy { FIXED_SLOT, EXTENDED_POLICY }; |
133 | 133 |
134 enum ExtendedPolicy { | 134 enum ExtendedPolicy { |
135 NONE, | 135 NONE, |
136 ANY, | 136 ANY, |
137 FIXED_REGISTER, | 137 FIXED_REGISTER, |
138 FIXED_DOUBLE_REGISTER, | 138 FIXED_DOUBLE_REGISTER, |
139 MUST_HAVE_REGISTER, | 139 MUST_HAVE_REGISTER, |
| 140 MUST_HAVE_SLOT, |
140 SAME_AS_FIRST_INPUT | 141 SAME_AS_FIRST_INPUT |
141 }; | 142 }; |
142 | 143 |
143 // Lifetime of operand inside the instruction. | 144 // Lifetime of operand inside the instruction. |
144 enum Lifetime { | 145 enum Lifetime { |
145 // USED_AT_START operand is guaranteed to be live only at | 146 // USED_AT_START operand is guaranteed to be live only at |
146 // instruction start. Register allocator is free to assign the same register | 147 // instruction start. Register allocator is free to assign the same register |
147 // to some other operand used inside instruction (i.e. temporary or | 148 // to some other operand used inside instruction (i.e. temporary or |
148 // output). | 149 // output). |
149 USED_AT_START, | 150 USED_AT_START, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } | 248 } |
248 bool HasFixedPolicy() const { | 249 bool HasFixedPolicy() const { |
249 return basic_policy() == FIXED_SLOT || | 250 return basic_policy() == FIXED_SLOT || |
250 extended_policy() == FIXED_REGISTER || | 251 extended_policy() == FIXED_REGISTER || |
251 extended_policy() == FIXED_DOUBLE_REGISTER; | 252 extended_policy() == FIXED_DOUBLE_REGISTER; |
252 } | 253 } |
253 bool HasRegisterPolicy() const { | 254 bool HasRegisterPolicy() const { |
254 return basic_policy() == EXTENDED_POLICY && | 255 return basic_policy() == EXTENDED_POLICY && |
255 extended_policy() == MUST_HAVE_REGISTER; | 256 extended_policy() == MUST_HAVE_REGISTER; |
256 } | 257 } |
| 258 bool HasSlotPolicy() const { |
| 259 return basic_policy() == EXTENDED_POLICY && |
| 260 extended_policy() == MUST_HAVE_SLOT; |
| 261 } |
257 bool HasSameAsInputPolicy() const { | 262 bool HasSameAsInputPolicy() const { |
258 return basic_policy() == EXTENDED_POLICY && | 263 return basic_policy() == EXTENDED_POLICY && |
259 extended_policy() == SAME_AS_FIRST_INPUT; | 264 extended_policy() == SAME_AS_FIRST_INPUT; |
260 } | 265 } |
261 bool HasFixedSlotPolicy() const { return basic_policy() == FIXED_SLOT; } | 266 bool HasFixedSlotPolicy() const { return basic_policy() == FIXED_SLOT; } |
262 bool HasFixedRegisterPolicy() const { | 267 bool HasFixedRegisterPolicy() const { |
263 return basic_policy() == EXTENDED_POLICY && | 268 return basic_policy() == EXTENDED_POLICY && |
264 extended_policy() == FIXED_REGISTER; | 269 extended_policy() == FIXED_REGISTER; |
265 } | 270 } |
266 bool HasFixedDoubleRegisterPolicy() const { | 271 bool HasFixedDoubleRegisterPolicy() const { |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 | 1098 |
1094 | 1099 |
1095 std::ostream& operator<<(std::ostream& os, | 1100 std::ostream& operator<<(std::ostream& os, |
1096 const PrintableInstructionSequence& code); | 1101 const PrintableInstructionSequence& code); |
1097 | 1102 |
1098 } // namespace compiler | 1103 } // namespace compiler |
1099 } // namespace internal | 1104 } // namespace internal |
1100 } // namespace v8 | 1105 } // namespace v8 |
1101 | 1106 |
1102 #endif // V8_COMPILER_INSTRUCTION_H_ | 1107 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |