Author: Armin Rigo <[email protected]>
Branch: continulet-jit-2
Changeset: r53182:344d1fecc21d
Date: 2012-03-04 17:29 +0100
http://bitbucket.org/pypy/pypy/changeset/344d1fecc21d/
Log: Fix: should not have killed needed_extra_stack_locations() from
'default'.
diff --git a/pypy/jit/backend/x86/assembler.py
b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -817,7 +817,7 @@
regalloc.walk_operations(operations)
if we_are_translated() or self.cpu.dont_keepalive_stuff:
self._regalloc = None # else keep it around for debugging
- frame_depth = regalloc.fm.get_frame_depth()
+ frame_depth = regalloc.get_final_frame_depth()
jump_target_descr = regalloc.jump_target_descr
if jump_target_descr is not None:
target_frame_depth = jump_target_descr._x86_clt.frame_depth
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
@@ -205,10 +205,18 @@
self.min_bytes_before_label = max(self.min_bytes_before_label,
at_least_position)
- @staticmethod
- def reserve_param(n):
+ def needed_extra_stack_locations(self, n):
assert n <= OFFSTACK_REAL_FRAME
- #self.param_depth = max(self.param_depth, n)
+ self.min_frame_depth = self.fm.get_frame_depth()
+ return
+ # call *after* you needed extra stack locations: (%esp), (%esp+4)...
+ min_frame_depth = self.fm.get_frame_depth() + n
+ if min_frame_depth > self.min_frame_depth:
+ self.min_frame_depth = min_frame_depth
+
+ def get_final_frame_depth(self):
+ self.needed_extra_stack_locations(0) # update min_frame_depth
+ return self.min_frame_depth
def _set_initial_bindings(self, inputargs):
if IS_X86_64:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit