< prev index next >

src/hotspot/cpu/aarch64/register_aarch64.hpp

Print this page

 56     constexpr int raw_encoding() const { return checked_cast<int>(this - first()); }
 57     constexpr int     encoding() const { assert(is_valid(), "invalid register"); return raw_encoding(); }
 58     constexpr bool    is_valid() const { return 0 <= raw_encoding() && raw_encoding() < number_of_registers; }
 59 
 60     // derived registers, offsets, and addresses
 61     inline Register successor() const;
 62 
 63     VMReg as_VMReg() const;
 64 
 65     const char* name() const;
 66   };
 67 
 68   inline friend constexpr Register as_Register(int encoding);
 69 
 70   constexpr Register() : _encoding(-1) {} // noreg
 71 
 72   int operator==(const Register r) const { return _encoding == r._encoding; }
 73   int operator!=(const Register r) const { return _encoding != r._encoding; }
 74 
 75   constexpr const RegisterImpl* operator->() const { return RegisterImpl::first() + _encoding; }





 76 };
 77 
 78 extern Register::RegisterImpl all_RegisterImpls[Register::number_of_declared_registers + 1] INTERNAL_VISIBILITY;
 79 
 80 inline constexpr const Register::RegisterImpl* Register::RegisterImpl::first() {
 81   return all_RegisterImpls + 1;
 82 }
 83 
 84 constexpr Register noreg = Register();
 85 
 86 inline constexpr Register as_Register(int encoding) {
 87   if (0 <= encoding && encoding < Register::number_of_declared_registers) {
 88     return Register(encoding);
 89   }
 90   return noreg;
 91 }
 92 
 93 inline Register Register::RegisterImpl::successor() const {
 94   assert(is_valid(), "sanity");
 95   return as_Register(encoding() + 1);

 56     constexpr int raw_encoding() const { return checked_cast<int>(this - first()); }
 57     constexpr int     encoding() const { assert(is_valid(), "invalid register"); return raw_encoding(); }
 58     constexpr bool    is_valid() const { return 0 <= raw_encoding() && raw_encoding() < number_of_registers; }
 59 
 60     // derived registers, offsets, and addresses
 61     inline Register successor() const;
 62 
 63     VMReg as_VMReg() const;
 64 
 65     const char* name() const;
 66   };
 67 
 68   inline friend constexpr Register as_Register(int encoding);
 69 
 70   constexpr Register() : _encoding(-1) {} // noreg
 71 
 72   int operator==(const Register r) const { return _encoding == r._encoding; }
 73   int operator!=(const Register r) const { return _encoding != r._encoding; }
 74 
 75   constexpr const RegisterImpl* operator->() const { return RegisterImpl::first() + _encoding; }
 76 
 77   // Actually available GP registers for use, depending on actual CPU capabilities and flags.
 78   static int available_gp_registers() {
 79     return number_of_registers;
 80   }
 81 };
 82 
 83 extern Register::RegisterImpl all_RegisterImpls[Register::number_of_declared_registers + 1] INTERNAL_VISIBILITY;
 84 
 85 inline constexpr const Register::RegisterImpl* Register::RegisterImpl::first() {
 86   return all_RegisterImpls + 1;
 87 }
 88 
 89 constexpr Register noreg = Register();
 90 
 91 inline constexpr Register as_Register(int encoding) {
 92   if (0 <= encoding && encoding < Register::number_of_declared_registers) {
 93     return Register(encoding);
 94   }
 95   return noreg;
 96 }
 97 
 98 inline Register Register::RegisterImpl::successor() const {
 99   assert(is_valid(), "sanity");
100   return as_Register(encoding() + 1);
< prev index next >