#define NUM_ARGUMENT_REGISTERS 6
+// The order of registers in this macro is hardcoded in assembly code
+// at number of places
#define ENUM_CALLEE_SAVED_REGISTERS() \
CALLEE_SAVED_REGISTER(R12) \
CALLEE_SAVED_REGISTER(R13) \
CALLEE_SAVED_REGISTER(Rbx) \
CALLEE_SAVED_REGISTER(Rbp)
-#define NUM_CALLEE_SAVED_REGISTERS 8
+#define NUM_CALLEE_SAVED_REGISTERS 6
#else // UNIX_AMD64_ABI
#define NUM_ARGUMENT_REGISTERS 4
+// The order of registers in this macro is hardcoded in assembly code
+// at number of places
#define ENUM_CALLEE_SAVED_REGISTERS() \
CALLEE_SAVED_REGISTER(Rdi) \
CALLEE_SAVED_REGISTER(Rsi) \
#undef CALLEE_SAVED_REGISTER
};
+struct CalleeSavedRegistersPointers {
+ #define CALLEE_SAVED_REGISTER(regname) PTR_TADDR p##regname;
+ ENUM_CALLEE_SAVED_REGISTERS();
+ #undef CALLEE_SAVED_REGISTER
+};
+
#define SCRATCH_REGISTER_X86REG kRAX
#ifdef UNIX_AMD64_ABI
CalleeSavedRegisters m_Capture;
// context pointers for preserved registers
- struct {
-#define CALLEE_SAVED_REGISTER(regname) PTR_TADDR p##regname;
- ENUM_CALLEE_SAVED_REGISTERS();
-#undef CALLEE_SAVED_REGISTER
- } m_Ptrs;
+ CalleeSavedRegistersPointers m_Ptrs;
PTR_TADDR _pRetAddr;