Chromium Code Reviews| Index: src/arm/constants-arm.h |
| =================================================================== |
| --- src/arm/constants-arm.h (revision 2838) |
| +++ src/arm/constants-arm.h (working copy) |
| @@ -52,6 +52,13 @@ |
| namespace assembler { |
| namespace arm { |
| +// Number of registers in normal ARM mode. |
| +static const int kNumRegisters = 16; |
| + |
| +// PC is register 15. |
| +static const int kPCRegister = 15; |
| +static const int kNoRegister = -1; |
| + |
| // Defines constants and accessor classes to assemble, disassemble and |
| // simulate ARM instructions. |
| // |
| @@ -269,6 +276,28 @@ |
| }; |
| +// Helper functions for converting between register numbers and names. |
| +class Registers { |
| + public: |
| + |
|
iposva
2009/09/08 21:59:57
Please drop this extra empty line.
Søren Thygesen Gjesse
2009/09/09 07:01:12
Done.
|
| + // Return the name of the register. |
| + static const char* Name(int reg); |
| + |
| + // Lookup the register number for the name provided. |
| + static int Number(const char* name); |
| + |
| + struct RegisterAlias { |
| + int reg; |
| + const char *name; |
| + }; |
| + |
| + private: |
| + static const char* names_[kNumRegisters]; |
| + static const RegisterAlias aliases_[]; |
| +}; |
| + |
| + |
| + |
| } } // namespace assembler::arm |
| #endif // V8_ARM_CONSTANTS_ARM_H_ |