Commits

Armin Rigo committed 4d76aae

Turn this magic constant "2" into a CONSTANT.

Comments (0)

Files changed (2)

pypy/jit/backend/x86/arch.py

 # order as the one in the comments above); but whereas the real stack would
 # have the spilled values stored in (ebp-20), (ebp-24), etc., the off-stack
 # has them stored in (ebp+8), (ebp+12), etc.
+OFFSTACK_START_AT_WORD = 2
 #
 # In stacklet mode, the real frame contains always just OFFSTACK_REAL_FRAME
 # words reserved for temporary usage like call arguments.  To maintain

pypy/jit/backend/x86/regalloc.py

 from pypy.jit.backend.x86.arch import WORD, FRAME_FIXED_SIZE
 from pypy.jit.backend.x86.arch import IS_X86_32, IS_X86_64, MY_COPY_OF_REGS
 from pypy.jit.backend.x86.arch import OFFSTACK_REAL_FRAME
+from pypy.jit.backend.x86.arch import OFFSTACK_START_AT_WORD
 from pypy.rlib.rarithmetic import r_longlong
 
 class X86RegisterManager(RegisterManager):
 def get_ebp_ofs(position):
     # Argument is a frame position (0, 1, 2...).
     # Returns (ebp+8), (ebp+12), (ebp+16)...
-    return WORD * (2 + position)
+    return WORD * (OFFSTACK_START_AT_WORD + position)
 
 def _valid_addressing_size(size):
     return size == 1 or size == 2 or size == 4 or size == 8