5#ifndef V8_CODEGEN_REGISTER_BASE_H_
6#define V8_CODEGEN_REGISTER_BASE_H_
28template <
typename SubType,
int kAfterLastRegister>
43 constexpr int8_t
code()
const {
44#if V8_TARGET_ARCH_ARM64
70 static_assert(kAfterLastRegister <=
kMaxInt8);
73template <
typename RegType,
74 typename =
decltype(RegisterName(std::declval<RegType>()))>
76 return os << RegisterName(
reg);
81#define DEFINE_REGISTER_NAMES_NAME(name) #name,
82#define DEFINE_REGISTER_NAMES(RegType, LIST) \
83 inline const char* RegisterName(RegType reg) { \
84 static constexpr const char* Names[] = {LIST(DEFINE_REGISTER_NAMES_NAME)}; \
85 static_assert(arraysize(Names) == RegType::kNumRegisters); \
86 return reg.is_valid() ? Names[reg.code()] : "invalid"; \
constexpr bool operator!=(const RegisterBase< SubType, kAfterLastRegister > &other) const
constexpr RegisterBase(int code)
static constexpr int8_t kNumRegisters
constexpr bool is_valid() const
constexpr bool operator==(const RegisterBase< SubType, kAfterLastRegister > &other) const
static constexpr SubType from_code(int8_t code)
static const char * GetSpecialRegisterName(int code)
static constexpr SubType no_reg()
static constexpr int8_t kCode_no_reg
constexpr int8_t code() const
std::ostream & operator<<(std::ostream &os, AtomicMemoryOrder order)