[Vm-dev] [commit][3353] set sp/fp alignment in asserts so we don'
t get pointless complaints
commits at squeakvm.org
commits at squeakvm.org
Thu May 21 18:18:06 UTC 2015
Revision: 3353
Author: rowledge
Date: 2015-05-21 11:18:06 -0700 (Thu, 21 May 2015)
Log Message:
-----------
set sp/fp alignment in asserts so we don't get pointless complaints
Modified Paths:
--------------
branches/Cog/platforms/Cross/vm/sqCogStackAlignment.h
Modified: branches/Cog/platforms/Cross/vm/sqCogStackAlignment.h
===================================================================
--- branches/Cog/platforms/Cross/vm/sqCogStackAlignment.h 2015-05-21 18:11:04 UTC (rev 3352)
+++ branches/Cog/platforms/Cross/vm/sqCogStackAlignment.h 2015-05-21 18:18:06 UTC (rev 3353)
@@ -63,11 +63,18 @@
} while (0)
# else
/* on RISCs, LinkReg implies stack ptr unchanged when doing cGetSP */
+ /* the sp & fp are assigned to local vars so we can print them in GDB */
+ /* The alignment for the stack is specified in the ABI doc but the */
+ /* FP alignment is by guess and experiment */
# define assertCStackWellAligned() do { \
extern sqInt cFramePointerInUse; \
+ unsigned long theFP; \
+ unsigned long theSP; \
+ theFP = getfp(); \
+ theSP = ceGetSP(); \
if (cFramePointerInUse) \
- assert((getfp() & STACK_ALIGN_MASK) == STACK_FP_ALIGN_BYTES); \
- assert((ceGetSP() & STACK_ALIGN_MASK) == 0); \
+ assert((theFP & STACK_ALIGN_MASK) == 4); \
+ assert((theSP & STACK_ALIGN_MASK) == 0); \
} while (0)
# endif
#else /* defined(STACK_ALIGN_BYTES) */
More information about the Vm-dev
mailing list