[pypy-svn] r28371 - pypy/dist/pypy/rpython/ootypesystem

fijal at codespeak.net fijal at codespeak.net
Tue Jun 6 14:47:48 CEST 2006


Author: fijal
Date: Tue Jun  6 14:47:48 2006
New Revision: 28371

Modified:
   pypy/dist/pypy/rpython/ootypesystem/ootype.py
   pypy/dist/pypy/rpython/ootypesystem/rclass.py
Log:
Added rpython hinter.


Modified: pypy/dist/pypy/rpython/ootypesystem/ootype.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/ootype.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/ootype.py	Tue Jun  6 14:47:48 2006
@@ -37,8 +37,9 @@
 class Instance(OOType):
     """this is the type of user-defined objects"""
     def __init__(self, name, superclass, fields={}, methods={},
-            _is_root=False):
+            _is_root=False, _hints = {}):
         self._name = name
+        self._hints = frozendict(_hints)
 
         if _is_root:
             self._superclass = None

Modified: pypy/dist/pypy/rpython/ootypesystem/rclass.py
==============================================================================
--- pypy/dist/pypy/rpython/ootypesystem/rclass.py	(original)
+++ pypy/dist/pypy/rpython/ootypesystem/rclass.py	Tue Jun  6 14:47:48 2006
@@ -162,7 +162,11 @@
             else:
                 b = OBJECT
 
-            self.lowleveltype = ootype.Instance(classdef.name, b, {}, {})
+            if hasattr(classdef.classdesc.pyobj, '_rpython_hints'):
+                hints = classdef.classdesc.pyobj._rpython_hints
+            else:
+                hints = {}
+            self.lowleveltype = ootype.Instance(classdef.name, b, {}, {}, _hints = hints)
         self.prebuiltinstances = {}   # { id(x): (x, _ptr) }
         self.object_type = self.lowleveltype
 



More information about the Pypy-commit mailing list