[pypy-svn] r69923 - in pypy/branch/virtual-forcing/pypy/jit/metainterp: . test

arigo at codespeak.net arigo at codespeak.net
Sun Dec 6 17:21:08 CET 2009


Author: arigo
Date: Sun Dec  6 17:21:07 2009
New Revision: 69923

Modified:
   pypy/branch/virtual-forcing/pypy/jit/metainterp/pyjitpl.py
   pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_virtualref.py
Log:
Small fixes.


Modified: pypy/branch/virtual-forcing/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/virtual-forcing/pypy/jit/metainterp/pyjitpl.py	Sun Dec  6 17:21:07 2009
@@ -1558,6 +1558,7 @@
                                               len(self.virtualizable_boxes)-1,
                                               duplicates)
             live_arg_boxes += self.virtualizable_boxes[:-1]
+        assert len(self.virtualref_boxes) == 0, "missing virtual_ref_finish()?"
         # Called whenever we reach the 'can_enter_jit' hint.
         # First, attempt to make a bridge:
         # - if self.resumekey is a ResumeGuardDescr, it starts from a guard
@@ -1900,6 +1901,10 @@
             for i in range(len(boxes)):
                 if boxes[i] is oldbox:
                     boxes[i] = newbox
+        boxes = self.virtualref_boxes
+        for i in range(len(boxes)):
+            if boxes[i] is oldbox:
+                boxes[i] = newbox
         if self.staticdata.virtualizable_info is not None:
             boxes = self.virtualizable_boxes
             for i in range(len(boxes)):

Modified: pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_virtualref.py
==============================================================================
--- pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_virtualref.py	(original)
+++ pypy/branch/virtual-forcing/pypy/jit/metainterp/test/test_virtualref.py	Sun Dec  6 17:21:07 2009
@@ -108,7 +108,6 @@
         self.check_loops({})      # because we aborted tracing
 
     def test_simple_no_access(self):
-        #py.test.skip("in-progress")
         myjitdriver = JitDriver(greens = [], reds = ['n'])
         #
         class XY:
@@ -132,13 +131,13 @@
                 xy.next2 = XY()
                 exctx.topframeref = virtual_ref(xy)
                 n -= externalfn(n)
+                virtual_ref_finish(exctx.topframeref)
                 exctx.topframeref = None
         #
         self.meta_interp(f, [15])
         self.check_loops(new_with_vtable=1)     # the vref, not the XYs
 
     def test_simple_force_always(self):
-        py.test.skip("in-progress")
         myjitdriver = JitDriver(greens = [], reds = ['n'])
         #
         class XY:
@@ -161,6 +160,7 @@
                 xy.n = n
                 exctx.topframeref = virtual_ref(xy)
                 n -= externalfn(n)
+                virtual_ref_finish(exctx.topframeref)
                 exctx.topframeref = None
         #
         self.meta_interp(f, [15])



More information about the Pypy-commit mailing list