[pypy-svn] r37212 - pypy/dist/pypy/jit/timeshifter

pedronis at codespeak.net pedronis at codespeak.net
Tue Jan 23 17:24:53 CET 2007


Author: pedronis
Date: Tue Jan 23 17:24:52 2007
New Revision: 37212

Modified:
   pypy/dist/pypy/jit/timeshifter/hrtyper.py
   pypy/dist/pypy/jit/timeshifter/rcontainer.py
Log:
(arre, pedronis) some sanity checks for the current limitations



Modified: pypy/dist/pypy/jit/timeshifter/hrtyper.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/hrtyper.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/hrtyper.py	Tue Jan 23 17:24:52 2007
@@ -1646,6 +1646,7 @@
 
         def collect_residual_args(v): 
             t = (v,)
+            assert not v.vable_access
             for name, _ in names:
                 t = t + (getattr(v, name),) # xxx need to use access ?
             return t

Modified: pypy/dist/pypy/jit/timeshifter/rcontainer.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/rcontainer.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/rcontainer.py	Tue Jan 23 17:24:52 2007
@@ -46,8 +46,9 @@
                  alloctoken varsizealloctoken
                  materialize
                  base_desc info_desc access_desc
-                 gv_access
                  redirected_fielddescs
+                 gv_access
+                 gv_access_is_null_ptr access_is_null_token
               """.split()
 
     materialize = None
@@ -142,6 +143,17 @@
                                                           s_lltype,
                                                           needtype = True)
                 setattr(access, 'get_'+name, get_field_ptr)
+            def access_is_null(struc):
+                assert not struc.vable_access
+            access_is_null_ptr = annhelper.delayedfunction(access_is_null,
+                                                           [s_structtype],
+                                                           annmodel.s_None,
+                                                           needtype = True)
+            self.gv_access_is_null_ptr = RGenOp.constPrebuiltGlobal(
+                                           access_is_null_ptr)
+            self.access_is_null_token =  RGenOp.sigToken(
+                                     lltype.typeOf(access_is_null_ptr).TO)
+
         else:
             self.VStructCls = VirtualStruct
 
@@ -570,6 +582,10 @@
         typedesc = self.typedesc
         boxes = self.content_boxes
         boxes[-1].genvar = gv_outside
+        builder = jitstate.curbuilder
+        builder.genop_call(typedesc.access_is_null_token,
+                           typedesc.gv_access_is_null_ptr,
+                           [gv_outside])
         for fielddesc, i in typedesc.redirected_fielddescs:
             boxes[i] = fielddesc.generate_get(jitstate, gv_outside)
         jitstate.add_virtualizable(self.ownbox)



More information about the Pypy-commit mailing list