[pypy-svn] r22816 - pypy/dist/pypy/jit

arigo at codespeak.net arigo at codespeak.net
Sun Jan 29 10:55:46 CET 2006


Author: arigo
Date: Sun Jan 29 10:55:44 2006
New Revision: 22816

Modified:
   pypy/dist/pypy/jit/hintcontainer.py
Log:
(pedronis, arigo)

Hack for default values of container fields: we store zeroes as default but
not NULL pointers -- we use SomeImpossibleValue instead for them.  Makes
union's life faaaar easier.



Modified: pypy/dist/pypy/jit/hintcontainer.py
==============================================================================
--- pypy/dist/pypy/jit/hintcontainer.py	(original)
+++ pypy/dist/pypy/jit/hintcontainer.py	Sun Jan 29 10:55:44 2006
@@ -1,4 +1,5 @@
 from pypy.annotation.listdef import ListItem
+from pypy.annotation import model as annmodel
 from pypy.jit import hintmodel
 from pypy.rpython.lltypesystem import lltype
 
@@ -18,6 +19,8 @@
     if isinstance(TYPE, lltype.ContainerType):
         vdef = virtualcontainerdef(bookkeeper, TYPE)
         return hintmodel.SomeLLAbstractContainer(vdef)
+    elif isinstance(TYPE, lltype.Ptr):
+        return annmodel.s_ImpossibleValue
     else:
         return hintmodel.SomeLLAbstractConstant(TYPE, {})
 



More information about the Pypy-commit mailing list