Author: Armin Rigo <[email protected]>
Branch: jit-targets
Changeset: r50346:95089d049fe7
Date: 2011-12-10 16:22 +0100
http://bitbucket.org/pypy/pypy/changeset/95089d049fe7/

Log:    Reset the targettoken's _x86_loop_code attribute between tests.

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
@@ -1333,7 +1333,7 @@
         self.final_jump_op = op
         descr = op.getdescr()
         assert isinstance(descr, TargetToken)
-        if descr._x86_loop_code != -1:
+        if descr._x86_loop_code != 0:
             # if the target LABEL was already compiled, i.e. if it belongs
             # to some already-compiled piece of code
             self._compute_hint_frame_locations_from_descr(descr)
@@ -1341,6 +1341,7 @@
     def _compute_hint_frame_locations_from_descr(self, descr):
         nonfloatlocs, floatlocs = descr._x86_arglocs
         jump_op = self.final_jump_op
+        assert len(nonfloatlocs) == jump_op.numargs()
         for i in range(jump_op.numargs()):
             box = jump_op.getarg(i)
             if isinstance(box, Box):
@@ -1559,4 +1560,4 @@
 
 # xxx hack: set a default value for TargetToken._x86_loop_code.
 # If -1, we know that it is a LABEL that was not compiled yet.
-TargetToken._x86_loop_code = -1
+TargetToken._x86_loop_code = 0
diff --git a/pypy/jit/backend/x86/test/test_regalloc.py 
b/pypy/jit/backend/x86/test/test_regalloc.py
--- a/pypy/jit/backend/x86/test/test_regalloc.py
+++ b/pypy/jit/backend/x86/test/test_regalloc.py
@@ -102,6 +102,10 @@
     fdescr2 = BasicFailDescr(2)
     fdescr3 = BasicFailDescr(3)
 
+    def setup_method(self, meth):
+        self.targettoken._x86_loop_code = 0
+        self.targettoken2._x86_loop_code = 0
+
     def f1(x):
         return x+1
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to