[pypy-svn] r51819 - pypy/branch/unified-rtti/pypy/translator/c

arigo at codespeak.net arigo at codespeak.net
Sat Feb 23 11:46:47 CET 2008


Author: arigo
Date: Sat Feb 23 11:46:46 2008
New Revision: 51819

Modified:
   pypy/branch/unified-rtti/pypy/translator/c/database.py
   pypy/branch/unified-rtti/pypy/translator/c/node.py
Log:
Fix -- all vtables were generated as just their type_info header,
without the rest part.


Modified: pypy/branch/unified-rtti/pypy/translator/c/database.py
==============================================================================
--- pypy/branch/unified-rtti/pypy/translator/c/database.py	(original)
+++ pypy/branch/unified-rtti/pypy/translator/c/database.py	Sat Feb 23 11:46:46 2008
@@ -154,7 +154,8 @@
                 if self.gctransformer is not None:
                     self.gctransformer.consider_constant(T, container)
             nodefactory = ContainerNodeFactory[T.__class__]
-            node = nodefactory(self, T, container, **buildkwds)
+            parentlink = lltype.parentlink(originalcontainer)  # typeinfo/rtti
+            node = nodefactory(self, T, container, parentlink, **buildkwds)
             self.containernodes[container] = node
             self.containernodes[originalcontainer] = node
             kind = getattr(node, 'nodekind', '?')

Modified: pypy/branch/unified-rtti/pypy/translator/c/node.py
==============================================================================
--- pypy/branch/unified-rtti/pypy/translator/c/node.py	(original)
+++ pypy/branch/unified-rtti/pypy/translator/c/node.py	Sat Feb 23 11:46:46 2008
@@ -2,7 +2,7 @@
 from pypy.rpython.lltypesystem.lltype import \
      Struct, Array, FixedSizeArray, FuncType, PyObjectType, typeOf, \
      GcStruct, GcArray, ContainerType, \
-     parentlink, Ptr, PyObject, Void, OpaqueType, Float, \
+     Ptr, PyObject, Void, OpaqueType, Float, \
      RuntimeTypeInfo, getRuntimeTypeInfo, Char, _subarray
 from pypy.rpython.lltypesystem import lltype, llmemory
 from pypy.translator.c.funcgen import FunctionCodeGenerator
@@ -426,14 +426,14 @@
                         name ptrname
                         globalcontainer""".split()
 
-    def __init__(self, db, T, obj):
+    def __init__(self, db, T, obj, parentlink):
         self.db = db
         self.T = T
         self.obj = obj
         #self.dependencies = {}
         self.typename = db.gettype(T)  #, who_asks=self)
         self.implementationtypename = db.gettype(T, varlength=self.getlength())
-        parent, parentindex = parentlink(obj)
+        parent, parentindex = parentlink
         if parent is None:
             self.name = db.namespace.uniquename('g_' + self.basename())
             self.globalcontainer = True
@@ -535,8 +535,8 @@
     if USESLOTS:
         __slots__ = ()
 
-    def __init__(self, db, T, obj):
-        ContainerNode.__init__(self, db, T, obj)
+    def __init__(self, db, T, obj, parentlink):
+        ContainerNode.__init__(self, db, T, obj, parentlink)
         if barebonearray(T):
             self.ptrname = self.name
 
@@ -598,8 +598,8 @@
     if USESLOTS:
         __slots__ = ()
 
-    def __init__(self, db, T, obj):
-        ContainerNode.__init__(self, db, T, obj)
+    def __init__(self, db, T, obj, parentlink):
+        ContainerNode.__init__(self, db, T, obj, parentlink)
         if not isinstance(obj, _subarray):   # XXX hackish
             self.ptrname = self.name
 
@@ -661,7 +661,7 @@
     # there not so many node of this kind, slots should not
     # be necessary
 
-    def __init__(self, db, T, obj, forcename=None):
+    def __init__(self, db, T, obj, parentlink, forcename=None):
         self.globalcontainer = True
         self.db = db
         self.T = T
@@ -839,7 +839,7 @@
     typename = 'PyObject @'
     implementationtypename = 'PyObject *@'
 
-    def __init__(self, db, T, obj):
+    def __init__(self, db, T, obj, parentlink):
         # obj is a _pyobject here; obj.value is the underlying CPython object
         self.db = db
         self.T = T



More information about the Pypy-commit mailing list