[pypy-svn] r71221 - pypy/trunk/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Sun Feb 14 10:48:16 CET 2010


Author: arigo
Date: Sun Feb 14 10:48:13 2010
New Revision: 71221

Modified:
   pypy/trunk/pypy/jit/metainterp/optimizeopt.py
   pypy/trunk/pypy/jit/metainterp/virtualref.py
Log:
Some more asserts, trying to close in on one of the bugs
that causes "pypy-c-jit translate.py" to occasionally crash.


Modified: pypy/trunk/pypy/jit/metainterp/optimizeopt.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/optimizeopt.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/optimizeopt.py	Sun Feb 14 10:48:13 2010
@@ -783,6 +783,7 @@
         # typically a PyPy PyFrame, and now is the end of its execution, so
         # forcing it now does not have catastrophic effects.
         vrefinfo = self.metainterp_sd.virtualref_info
+        assert op.args[1].nonnull()
         # - set 'forced' to point to the real object
         op1 = ResOperation(rop.SETFIELD_GC, op.args, None,
                           descr = vrefinfo.descr_forced)

Modified: pypy/trunk/pypy/jit/metainterp/virtualref.py
==============================================================================
--- pypy/trunk/pypy/jit/metainterp/virtualref.py	(original)
+++ pypy/trunk/pypy/jit/metainterp/virtualref.py	Sun Feb 14 10:48:13 2010
@@ -92,6 +92,7 @@
         if not self.is_virtual_ref(gcref):
             return False
         vref = lltype.cast_opaque_ptr(lltype.Ptr(self.JIT_VIRTUAL_REF), gcref)
+        assert vref.forced
         if vref.virtual_token:
             # not modified by the residual call; assert that it is still
             # set to TOKEN_TRACING_RESCALL and clear it.
@@ -115,6 +116,7 @@
     def continue_tracing(self, gcref, real_object):
         if not self.is_virtual_ref(gcref):
             return
+        assert real_object
         vref = lltype.cast_opaque_ptr(lltype.Ptr(self.JIT_VIRTUAL_REF), gcref)
         assert vref.virtual_token != self.TOKEN_TRACING_RESCALL
         vref.virtual_token = self.TOKEN_NONE
@@ -144,12 +146,15 @@
                 # We only need to reset virtual_token to TOKEN_NONE
                 # as a marker for the tracing, to tell it that this
                 # "virtual" escapes.
+                assert vref.forced
                 vref.virtual_token = self.TOKEN_NONE
             else:
                 assert not vref.forced
                 from pypy.jit.metainterp.compile import ResumeGuardForcedDescr
                 ResumeGuardForcedDescr.force_now(self.cpu, token)
                 assert vref.virtual_token == self.TOKEN_NONE
-        assert vref.forced
+                assert vref.forced
+        else:
+            assert vref.forced
         return vref.forced
     force_virtual._dont_inline_ = True



More information about the Pypy-commit mailing list