[pypy-svn] r65597 - pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp
fijal at codespeak.net
fijal at codespeak.net
Thu Jun 4 23:42:35 CEST 2009
Author: fijal
Date: Thu Jun 4 23:42:33 2009
New Revision: 65597
Modified:
pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/virtualizable.py
Log:
I think this is the correct way, assuming super is the first field
Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/virtualizable.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/virtualizable.py (original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/virtualizable.py Thu Jun 4 23:42:33 2009
@@ -26,24 +26,17 @@
return self.catch_all_fields_lltype(cpu, S)
def catch_all_fields_lltype(self, cpu, S):
- def name_in_all(name):
- for p in all:
- if hasattr(p, name):
- return True
- return False
-
lst = []
p = S
- all = [p]
while True:
- lst.extend(p._names)
+ for name in p._names:
+ lst.append((p, name))
if getattr(p, 'super', None) is not None:
p = p.super
- all.append(p)
else:
break
- return [cpu.fielddescrof(S, name) for name in lst if
- name.startswith('inst_') and name_in_all(name)]
+ return [cpu.fielddescrof(p, name) for p, name in lst if
+ name.startswith('inst_')]
def catch_all_fields_ootype(self, cpu, S):
lst = S._allfields().keys()
More information about the Pypy-commit
mailing list