Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Side by Side Diff: src/compiler/instruction.h

Issue 1426943010: [turbofan] Spill rsi and rdi in their existing locations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/frame.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 } 185 }
186 186
187 UnallocatedOperand(ExtendedPolicy policy, Lifetime lifetime, 187 UnallocatedOperand(ExtendedPolicy policy, Lifetime lifetime,
188 int virtual_register) 188 int virtual_register)
189 : UnallocatedOperand(virtual_register) { 189 : UnallocatedOperand(virtual_register) {
190 value_ |= BasicPolicyField::encode(EXTENDED_POLICY); 190 value_ |= BasicPolicyField::encode(EXTENDED_POLICY);
191 value_ |= ExtendedPolicyField::encode(policy); 191 value_ |= ExtendedPolicyField::encode(policy);
192 value_ |= LifetimeField::encode(lifetime); 192 value_ |= LifetimeField::encode(lifetime);
193 } 193 }
194 194
195 UnallocatedOperand(int reg_id, int slot_id, int virtual_register)
196 : UnallocatedOperand(FIXED_REGISTER, reg_id, virtual_register) {
197 value_ |= HasSecondaryStorageField::encode(true);
198 value_ |= SecondaryStorageField::encode(slot_id);
199 }
200
195 // Predicates for the operand policy. 201 // Predicates for the operand policy.
196 bool HasAnyPolicy() const { 202 bool HasAnyPolicy() const {
197 return basic_policy() == EXTENDED_POLICY && extended_policy() == ANY; 203 return basic_policy() == EXTENDED_POLICY && extended_policy() == ANY;
198 } 204 }
199 bool HasFixedPolicy() const { 205 bool HasFixedPolicy() const {
200 return basic_policy() == FIXED_SLOT || 206 return basic_policy() == FIXED_SLOT ||
201 extended_policy() == FIXED_REGISTER || 207 extended_policy() == FIXED_REGISTER ||
202 extended_policy() == FIXED_DOUBLE_REGISTER; 208 extended_policy() == FIXED_DOUBLE_REGISTER;
203 } 209 }
204 bool HasRegisterPolicy() const { 210 bool HasRegisterPolicy() const {
(...skipping 10 matching lines...) Expand all
215 } 221 }
216 bool HasFixedSlotPolicy() const { return basic_policy() == FIXED_SLOT; } 222 bool HasFixedSlotPolicy() const { return basic_policy() == FIXED_SLOT; }
217 bool HasFixedRegisterPolicy() const { 223 bool HasFixedRegisterPolicy() const {
218 return basic_policy() == EXTENDED_POLICY && 224 return basic_policy() == EXTENDED_POLICY &&
219 extended_policy() == FIXED_REGISTER; 225 extended_policy() == FIXED_REGISTER;
220 } 226 }
221 bool HasFixedDoubleRegisterPolicy() const { 227 bool HasFixedDoubleRegisterPolicy() const {
222 return basic_policy() == EXTENDED_POLICY && 228 return basic_policy() == EXTENDED_POLICY &&
223 extended_policy() == FIXED_DOUBLE_REGISTER; 229 extended_policy() == FIXED_DOUBLE_REGISTER;
224 } 230 }
231 bool HasSecondaryStorage() const {
232 return basic_policy() == EXTENDED_POLICY &&
233 extended_policy() == FIXED_REGISTER &&
234 HasSecondaryStorageField::decode(value_);
235 }
236 int GetSecondaryStorage() const {
237 DCHECK(HasSecondaryStorage());
238 return SecondaryStorageField::decode(value_);
239 }
225 240
226 // [basic_policy]: Distinguish between FIXED_SLOT and all other policies. 241 // [basic_policy]: Distinguish between FIXED_SLOT and all other policies.
227 BasicPolicy basic_policy() const { 242 BasicPolicy basic_policy() const {
228 DCHECK_EQ(UNALLOCATED, kind()); 243 DCHECK_EQ(UNALLOCATED, kind());
229 return BasicPolicyField::decode(value_); 244 return BasicPolicyField::decode(value_);
230 } 245 }
231 246
232 // [extended_policy]: Only for non-FIXED_SLOT. The finer-grained policy. 247 // [extended_policy]: Only for non-FIXED_SLOT. The finer-grained policy.
233 ExtendedPolicy extended_policy() const { 248 ExtendedPolicy extended_policy() const {
234 DCHECK(basic_policy() == EXTENDED_POLICY); 249 DCHECK(basic_policy() == EXTENDED_POLICY);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 309
295 // BitFields for all unallocated operands. 310 // BitFields for all unallocated operands.
296 class BasicPolicyField : public BitField64<BasicPolicy, 35, 1> {}; 311 class BasicPolicyField : public BitField64<BasicPolicy, 35, 1> {};
297 312
298 // BitFields specific to BasicPolicy::FIXED_SLOT. 313 // BitFields specific to BasicPolicy::FIXED_SLOT.
299 class FixedSlotIndexField : public BitField64<int, 36, 28> {}; 314 class FixedSlotIndexField : public BitField64<int, 36, 28> {};
300 315
301 // BitFields specific to BasicPolicy::EXTENDED_POLICY. 316 // BitFields specific to BasicPolicy::EXTENDED_POLICY.
302 class ExtendedPolicyField : public BitField64<ExtendedPolicy, 36, 3> {}; 317 class ExtendedPolicyField : public BitField64<ExtendedPolicy, 36, 3> {};
303 class LifetimeField : public BitField64<Lifetime, 39, 1> {}; 318 class LifetimeField : public BitField64<Lifetime, 39, 1> {};
304 class FixedRegisterField : public BitField64<int, 40, 6> {}; 319 class HasSecondaryStorageField : public BitField64<bool, 40, 1> {};
320 class FixedRegisterField : public BitField64<int, 41, 6> {};
321 class SecondaryStorageField : public BitField64<int, 47, 3> {};
305 322
306 private: 323 private:
307 explicit UnallocatedOperand(int virtual_register) 324 explicit UnallocatedOperand(int virtual_register)
308 : InstructionOperand(UNALLOCATED) { 325 : InstructionOperand(UNALLOCATED) {
309 value_ |= 326 value_ |=
310 VirtualRegisterField::encode(static_cast<uint32_t>(virtual_register)); 327 VirtualRegisterField::encode(static_cast<uint32_t>(virtual_register));
311 } 328 }
312 }; 329 };
313 330
314 331
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 1277
1261 1278
1262 std::ostream& operator<<(std::ostream& os, 1279 std::ostream& operator<<(std::ostream& os,
1263 const PrintableInstructionSequence& code); 1280 const PrintableInstructionSequence& code);
1264 1281
1265 } // namespace compiler 1282 } // namespace compiler
1266 } // namespace internal 1283 } // namespace internal
1267 } // namespace v8 1284 } // namespace v8
1268 1285
1269 #endif // V8_COMPILER_INSTRUCTION_H_ 1286 #endif // V8_COMPILER_INSTRUCTION_H_
OLDNEW
« no previous file with comments | « src/compiler/frame.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698