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

pedronis at codespeak.net pedronis at codespeak.net
Tue Mar 21 18:41:50 CET 2006


Author: pedronis
Date: Tue Mar 21 18:41:39 2006
New Revision: 24711

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

half-hearted attempt at using vparent of array items too. This makes really sense only if dealt with the fixed size 
case only.



Modified: pypy/dist/pypy/jit/hintcontainer.py
==============================================================================
--- pypy/dist/pypy/jit/hintcontainer.py	(original)
+++ pypy/dist/pypy/jit/hintcontainer.py	Tue Mar 21 18:41:39 2006
@@ -39,7 +39,7 @@
     if isinstance(T, lltype.Struct):
         return VirtualStructDef(bookkeeper, T, vparent, vparentindex)
     elif isinstance(T, lltype.Array):
-        return VirtualArrayDef(bookkeeper, T)
+        return VirtualArrayDef(bookkeeper, T, vparent)
     raise TypeError("unsupported container type %r" % (T,))
 
 def make_item_annotation(bookkeeper, TYPE, vparent=None, vparentindex=0):
@@ -154,14 +154,15 @@
         for varraydef in self.itemof:
             varraydef.arrayitem = self
 
-
+# this may need to really be used only for fixed size cases
 class VirtualArrayDef(AbstractContainerDef):
 
-    def __init__(self, bookkeeper, TYPE):
+    def __init__(self, bookkeeper, TYPE, vparent=None):
         AbstractContainerDef.__init__(self, bookkeeper, TYPE)
-        hs = make_item_annotation(bookkeeper, TYPE.OF)
+        hs = make_item_annotation(bookkeeper, TYPE.OF, vparent=self) # xxx vparentindex?
         self.arrayitem = ArrayItem(bookkeeper, hs)
         self.arrayitem.itemof[self] = True
+        self.vparent = vparent
 
     def read_item(self):
         self.arrayitem.read_locations[self.bookkeeper.position_key] = True



More information about the Pypy-commit mailing list