[pypy-svn] r60033 - pypy/branch/oo-jit/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Thu Nov 20 19:28:02 CET 2008


Author: arigo
Date: Thu Nov 20 19:27:59 2008
New Revision: 60033

Modified:
   pypy/branch/oo-jit/pypy/rpython/rtyper.py
Log:
Add a helper, rtyper.lltype_to_typedef_mapping(),
returning a collection of all typedefs from each
type.


Modified: pypy/branch/oo-jit/pypy/rpython/rtyper.py
==============================================================================
--- pypy/branch/oo-jit/pypy/rpython/rtyper.py	(original)
+++ pypy/branch/oo-jit/pypy/rpython/rtyper.py	Thu Nov 20 19:27:59 2008
@@ -131,6 +131,12 @@
             result[repr.lowleveltype] = classdef
         return result
 
+    def lltype_to_vtable_mapping(self):
+        result = {}
+        for repr in self.instance_reprs.itervalues():
+            result[repr.lowleveltype.TO] = repr.rclass.getvtable()
+        return result
+
     def makekey(self, s_obj):
         return pair(self.type_system, s_obj).rtyper_makekey(self)
 



More information about the Pypy-commit mailing list