[pypy-svn] r65596 - pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp

fijal at codespeak.net fijal at codespeak.net
Thu Jun 4 23:33:00 CEST 2009


Author: fijal
Date: Thu Jun  4 23:32:57 2009
New Revision: 65596

Modified:
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/virtualizable.py
Log:
ah, I think I see the reason. Another way would be to test for lltype.Void
type I suppose


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:32:57 2009
@@ -26,16 +26,24 @@
         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)
             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_')]
+                name.startswith('inst_') and name_in_all(name)]
 
     def catch_all_fields_ootype(self, cpu, S):
         lst = S._allfields().keys()



More information about the Pypy-commit mailing list