[pypy-svn] r77098 - pypy/branch/better-map-instances/pypy/objspace/std

cfbolz at codespeak.net cfbolz at codespeak.net
Wed Sep 15 19:04:31 CEST 2010


Author: cfbolz
Date: Wed Sep 15 19:04:28 2010
New Revision: 77098

Modified:
   pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py
   pypy/branch/better-map-instances/pypy/objspace/std/objspace.py
Log:
need to specialize this


Modified: pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py
==============================================================================
--- pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py	(original)
+++ pypy/branch/better-map-instances/pypy/objspace/std/mapdict.py	Wed Sep 15 19:04:28 2010
@@ -375,7 +375,7 @@
 class Object(ObjectMixin, BaseMapdictObject):
     pass # mainly for tests
 
-def get_subclass_of_correct_size(space, supercls, w_type):
+def get_subclass_of_correct_size(space, cls, supercls, w_type):
     assert space.config.objspace.std.withmapdict
     map = w_type.terminator
     classes = memo_get_subclass_of_correct_size(space, supercls)
@@ -386,6 +386,7 @@
         return classes[size - 1]
     except IndexError:
         return classes[-1]
+get_subclass_of_correct_size._annspecialcase_ = "specialize:arg(1)"
 
 
 def memo_get_subclass_of_correct_size(space, supercls):

Modified: pypy/branch/better-map-instances/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/branch/better-map-instances/pypy/objspace/std/objspace.py	(original)
+++ pypy/branch/better-map-instances/pypy/objspace/std/objspace.py	Wed Sep 15 19:04:28 2010
@@ -323,7 +323,7 @@
                     w_subtype.needsdel, w_subtype.weakrefable)
             if self.config.objspace.std.withmapdict:
                 from pypy.objspace.std.mapdict import get_subclass_of_correct_size
-                subcls = get_subclass_of_correct_size(self, subcls, w_subtype)
+                subcls = get_subclass_of_correct_size(self, cls, subcls, w_subtype)
             instance = instantiate(subcls)
             assert isinstance(instance, cls)
             instance.user_setup(self, w_subtype)



More information about the Pypy-commit mailing list