[pypy-svn] r32647 - pypy/dist/pypy/rpython/lltypesystem

arigo at codespeak.net arigo at codespeak.net
Tue Sep 26 12:26:54 CEST 2006


Author: arigo
Date: Tue Sep 26 12:26:52 2006
New Revision: 32647

Modified:
   pypy/dist/pypy/rpython/lltypesystem/rclass.py
Log:
The parenttypeptr field of vtables is not used any more, actually.
Killing it means that the vtable of classes which are never instantiated
is (probably) no longer reachable, so it will not be found by the genc
database and left out of the final C code.


Modified: pypy/dist/pypy/rpython/lltypesystem/rclass.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/rclass.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/rclass.py	Tue Sep 26 12:26:52 2006
@@ -27,7 +27,7 @@
 #  A root class "object" has:
 #
 #      struct object_vtable {
-#          struct object_vtable* parenttypeptr;
+#          // struct object_vtable* parenttypeptr;  not used any more
 #          RuntimeTypeInfo * rtti;
 #          Signed subclassrange_min;  //this is also the id of the class itself
 #          Signed subclassrange_max;
@@ -61,7 +61,7 @@
                             hints = {'immutable': True})
 OBJECTPTR = Ptr(OBJECT)
 OBJECT_VTABLE.become(Struct('object_vtable',
-                            ('parenttypeptr', CLASSTYPE),
+                            #('parenttypeptr', CLASSTYPE),
                             ('subclassrange_min', Signed),
                             ('subclassrange_max', Signed),
                             ('rtti', Ptr(RuntimeTypeInfo)),
@@ -180,9 +180,9 @@
         """Initialize the 'self' portion of the 'vtable' belonging to the
         given subclass."""
         if self.classdef is None:
-            # initialize the 'parenttypeptr' and 'name' fields
+            # initialize the 'subclassrange_*' and 'name' fields
             if rsubcls.classdef is not None:
-                vtable.parenttypeptr = rsubcls.rbase.getvtable()
+                #vtable.parenttypeptr = rsubcls.rbase.getvtable()
                 vtable.subclassrange_min = rsubcls.classdef.minid
                 vtable.subclassrange_max = rsubcls.classdef.maxid
             else: #for the root class



More information about the Pypy-commit mailing list