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

Unified Diff: src/arm/constants-arm.h

Issue 195024: Refactor the register to name mapping in the ARM simulator (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Added src/arm/constatns-arm.cc to Visual Studio project file Created 11 years, 3 months 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 side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « src/SConscript ('k') | src/arm/constants-arm.cc » ('j') | src/arm/simulator-arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698