[pypy-commit] pypy continulet-jit-2: Turn this magic constant "2" into a CONSTANT.
arigo
noreply at buildbot.pypy.org
Fri Mar 2 21:24:43 CET 2012
Author: Armin Rigo <arigo at tunes.org>
Branch: continulet-jit-2
Changeset: r53122:4d76aae321b7
Date: 2012-03-02 16:46 +0100
http://bitbucket.org/pypy/pypy/changeset/4d76aae321b7/
Log: Turn this magic constant "2" into a CONSTANT.
diff --git a/pypy/jit/backend/x86/arch.py b/pypy/jit/backend/x86/arch.py
--- a/pypy/jit/backend/x86/arch.py
+++ b/pypy/jit/backend/x86/arch.py
@@ -37,6 +37,7 @@
# 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
diff --git a/pypy/jit/backend/x86/regalloc.py b/pypy/jit/backend/x86/regalloc.py
--- a/pypy/jit/backend/x86/regalloc.py
+++ b/pypy/jit/backend/x86/regalloc.py
@@ -24,6 +24,7 @@
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):
@@ -1550,7 +1551,7 @@
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
More information about the pypy-commit
mailing list