[pypy-commit] pypy faster-isinstance: a branch to experiment with making space.isisntance faster

fijal noreply at buildbot.pypy.org
Wed Sep 28 13:53:25 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: faster-isinstance
Changeset: r47654:374f2d450b30
Date: 2011-09-28 08:52 -0300
http://bitbucket.org/pypy/pypy/changeset/374f2d450b30/

Log:	a branch to experiment with making space.isisntance faster

diff --git a/pypy/objspace/std/model.py b/pypy/objspace/std/model.py
--- a/pypy/objspace/std/model.py
+++ b/pypy/objspace/std/model.py
@@ -269,6 +269,11 @@
 
         self._typeorder_with_empty_usersubcls = None
 
+        for type, classes in self.typeorder.iteritems():
+            if len(classes) == 3:
+                # W_Root, AnyXxx and actual object
+                type.interplevel_cls = classes[0][0]
+
         # ____________________________________________________________
         # Prebuilt common integer values
 
diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -115,6 +115,9 @@
     # of the __new__ is an instance of the type
     w_bltin_new = None
 
+    interplevel_cls = None # not None for prebuilt instances of
+                           # interpreter-level types
+
     @dont_look_inside
     def __init__(w_self, space, name, bases_w, dict_w,
                  overridetypedef=None):


More information about the pypy-commit mailing list