[pypy-commit] pypy arm-backend-2: remove definition of _all_size_descrs_with_vtable in model.py and revert changes to heaptracker.py

bivab noreply at buildbot.pypy.org
Thu Feb 16 20:27:59 CET 2012


Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r52565:f6dc5b3cedd2
Date: 2012-02-16 19:56 +0100
http://bitbucket.org/pypy/pypy/changeset/f6dc5b3cedd2/

Log:	remove definition of _all_size_descrs_with_vtable in model.py and
	revert changes to heaptracker.py

diff --git a/pypy/jit/backend/model.py b/pypy/jit/backend/model.py
--- a/pypy/jit/backend/model.py
+++ b/pypy/jit/backend/model.py
@@ -22,7 +22,7 @@
     total_freed_bridges = 0
 
     # for heaptracker
-    _all_size_descrs_with_vtable = None
+    # _all_size_descrs_with_vtable = None
     _vtable_to_descr_dict = None
 
 
diff --git a/pypy/jit/codewriter/heaptracker.py b/pypy/jit/codewriter/heaptracker.py
--- a/pypy/jit/codewriter/heaptracker.py
+++ b/pypy/jit/codewriter/heaptracker.py
@@ -89,7 +89,7 @@
     except AttributeError:
         pass
     assert lltype.typeOf(vtable) == VTABLETYPE
-    if cpu._all_size_descrs_with_vtable is None:
+    if not hasattr(cpu, '_all_size_descrs_with_vtable'):
         cpu._all_size_descrs_with_vtable = []
         cpu._vtable_to_descr_dict = None
     cpu._all_size_descrs_with_vtable.append(sizedescr)
@@ -97,7 +97,7 @@
 
 def finish_registering(cpu):
     # annotation hack for small examples which have no vtable at all
-    if cpu._all_size_descrs_with_vtable is None:
+    if not hasattr(cpu, '_all_size_descrs_with_vtable'):
         vtable = lltype.malloc(rclass.OBJECT_VTABLE, immortal=True)
         register_known_gctype(cpu, vtable, rclass.OBJECT)
 
@@ -108,7 +108,6 @@
         # Build the dict {vtable: sizedescr} at runtime.
         # This is necessary because the 'vtables' are just pointers to
         # static data, so they can't be used as keys in prebuilt dicts.
-        assert cpu._all_size_descrs_with_vtable is not None
         d = cpu._vtable_to_descr_dict
         if d is None:
             d = cpu._vtable_to_descr_dict = {}
@@ -130,4 +129,3 @@
     vtable = descr.as_vtable_size_descr()._corresponding_vtable
     vtable = llmemory.cast_ptr_to_adr(vtable)
     return adr2int(vtable)
-


More information about the pypy-commit mailing list