[pypy-svn] r68160 - pypy/branch/merge-floats-via-sse2/pypy/jit/backend/x86

arigo at codespeak.net arigo at codespeak.net
Mon Oct 5 12:12:03 CEST 2009


Author: arigo
Date: Mon Oct  5 12:12:02 2009
New Revision: 68160

Modified:
   pypy/branch/merge-floats-via-sse2/pypy/jit/backend/x86/regalloc.py
Log:
Systematize the TempBox() usage -- it was missing a possibly_free_var()
in a corner case, but I don't feel like writing a test for it, mostly
because it's too obvious and boring.


Modified: pypy/branch/merge-floats-via-sse2/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/merge-floats-via-sse2/pypy/jit/backend/x86/regalloc.py	(original)
+++ pypy/branch/merge-floats-via-sse2/pypy/jit/backend/x86/regalloc.py	Mon Oct  5 12:12:02 2009
@@ -472,7 +472,8 @@
         assert l0 is eax
         assert l1 is ecx
         assert l2 is resultreg
-        self.rm.possibly_free_vars(op.args + [tmpvar])
+        self.rm.possibly_free_vars(op.args)
+        self.rm.possibly_free_var(tmpvar)
 
     def consider_int_mod(self, op, ignored):
         self._consider_int_div_or_mod(op, edx, eax)
@@ -668,9 +669,11 @@
         # XXX kill this function at some point
         if isinstance(v, Box):
             loc = self.rm.make_sure_var_in_reg(v, [v])
-            other_loc = self.rm.force_allocate_reg(TempBox(), [v])
+            tempbox = TempBox()
+            other_loc = self.rm.force_allocate_reg(tempbox, [v])
             self.assembler.load_effective_addr(loc, ofs_items,scale, other_loc)
         else:
+            tempbox = None
             other_loc = imm(ofs_items + (v.getint() << scale))
         self._call(ResOperation(rop.NEW, [v], res_v),
                    [other_loc], [v])
@@ -678,6 +681,8 @@
         assert self.loc(res_v) == eax
         # now we have to reload length to some reasonable place
         self.rm.possibly_free_var(v)
+        if tempbox is not None:
+            self.rm.possibly_free_var(tempbox)
         self.PerformDiscard(ResOperation(rop.SETFIELD_GC, [], None),
                             [eax, imm(ofs_length), imm(WORD), loc])
 



More information about the Pypy-commit mailing list