[pypy-commit] pypy no-class-specialize: Always compute the classdef when creating a ClassDesc
rlamy
noreply at buildbot.pypy.org
Wed Oct 14 21:40:35 EDT 2015
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: no-class-specialize
Changeset: r80222:526259e6794f
Date: 2015-10-14 17:00 +0100
http://bitbucket.org/pypy/pypy/changeset/526259e6794f/
Log: Always compute the classdef when creating a ClassDesc
diff --git a/rpython/annotator/bookkeeper.py b/rpython/annotator/bookkeeper.py
--- a/rpython/annotator/bookkeeper.py
+++ b/rpython/annotator/bookkeeper.py
@@ -359,7 +359,7 @@
if pyobj.__module__ == '__builtin__': # avoid making classdefs for builtin types
result = self.getfrozen(pyobj)
else:
- result = ClassDesc(self, pyobj)
+ return self._new_classdesc(pyobj)
elif isinstance(pyobj, types.MethodType):
if pyobj.im_self is None: # unbound
return self.getdesc(pyobj.im_func)
@@ -441,6 +441,12 @@
def valueoftype(self, t):
return annotationoftype(t, self)
+ def _new_classdesc(self, pycls):
+ result = ClassDesc(self, pycls)
+ self.descs[pycls] = result
+ result._init_classdef()
+ return result
+
def get_classpbc_attr_families(self, attrname):
"""Return the UnionFind for the ClassAttrFamilies corresponding to
attributes of the given name.
More information about the pypy-commit
mailing list