OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 ASSERT((size_in_bits % kBitsPerByte) == 0); | 566 ASSERT((size_in_bits % kBitsPerByte) == 0); |
567 return size_in_bits / kBitsPerByte; | 567 return size_in_bits / kBitsPerByte; |
568 } | 568 } |
569 | 569 |
570 private: | 570 private: |
571 RegList list_; | 571 RegList list_; |
572 unsigned size_; | 572 unsigned size_; |
573 CPURegister::RegisterType type_; | 573 CPURegister::RegisterType type_; |
574 | 574 |
575 bool IsValid() const { | 575 bool IsValid() const { |
576 if ((type_ == CPURegister::kRegister) || | 576 const RegList kValidRegisters = 0x8000000ffffffff; |
577 (type_ == CPURegister::kFPRegister)) { | 577 const RegList kValidFPRegisters = 0x0000000ffffffff; |
578 bool is_valid = true; | 578 switch (type_) { |
579 // Try to create a CPURegister for each element in the list. | 579 case CPURegister::kRegister: |
580 for (int i = 0; i < kRegListSizeInBits; i++) { | 580 return (list_ & kValidRegisters) == list_; |
581 if (((list_ >> i) & 1) != 0) { | 581 case CPURegister::kFPRegister: |
582 is_valid &= CPURegister::Create(i, size_, type_).IsValid(); | 582 return (list_ & kValidFPRegisters) == list_; |
583 } | 583 case CPURegister::kNoRegister: |
584 } | 584 return list_ == 0; |
585 return is_valid; | 585 default: |
586 } else if (type_ == CPURegister::kNoRegister) { | 586 UNREACHABLE(); |
587 // The kNoRegister type is valid only for empty lists. | 587 return false; |
588 // We can't use IsEmpty here because that asserts IsValid(). | |
589 return list_ == 0; | |
590 } else { | |
591 return false; | |
592 } | 588 } |
593 } | 589 } |
594 }; | 590 }; |
595 | 591 |
596 | 592 |
597 // AAPCS64 callee-saved registers. | 593 // AAPCS64 callee-saved registers. |
598 #define kCalleeSaved CPURegList::GetCalleeSaved() | 594 #define kCalleeSaved CPURegList::GetCalleeSaved() |
599 #define kCalleeSavedFP CPURegList::GetCalleeSavedFP() | 595 #define kCalleeSavedFP CPURegList::GetCalleeSavedFP() |
600 | 596 |
601 | 597 |
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2213 class EnsureSpace BASE_EMBEDDED { | 2209 class EnsureSpace BASE_EMBEDDED { |
2214 public: | 2210 public: |
2215 explicit EnsureSpace(Assembler* assembler) { | 2211 explicit EnsureSpace(Assembler* assembler) { |
2216 assembler->CheckBuffer(); | 2212 assembler->CheckBuffer(); |
2217 } | 2213 } |
2218 }; | 2214 }; |
2219 | 2215 |
2220 } } // namespace v8::internal | 2216 } } // namespace v8::internal |
2221 | 2217 |
2222 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ | 2218 #endif // V8_ARM64_ASSEMBLER_ARM64_H_ |
OLD | NEW |