[pypy-svn] r68394 - in pypy/branch/gc-hash/pypy/rpython: lltypesystem memory/gctransform

arigo at codespeak.net arigo at codespeak.net
Tue Oct 13 20:28:17 CEST 2009


Author: arigo
Date: Tue Oct 13 20:28:16 2009
New Revision: 68394

Modified:
   pypy/branch/gc-hash/pypy/rpython/lltypesystem/lloperation.py
   pypy/branch/gc-hash/pypy/rpython/memory/gctransform/framework.py
Log:
'gc_identityhash' can really collect.  We'll think later
about some obscure 'gc_identityhash_if_you_have_one' operation...


Modified: pypy/branch/gc-hash/pypy/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/branch/gc-hash/pypy/rpython/lltypesystem/lloperation.py	(original)
+++ pypy/branch/gc-hash/pypy/rpython/lltypesystem/lloperation.py	Tue Oct 13 20:28:16 2009
@@ -440,7 +440,7 @@
     'gc_pop_alive_pyobj':   LLOp(),
     'gc_reload_possibly_moved': LLOp(),
     # see rlib/objectmodel for gc_identityhash and gc_id
-    'gc_identityhash':      LLOp(sideeffects=False),
+    'gc_identityhash':      LLOp(canraise=(MemoryError,), sideeffects=False),
     'gc_id':                LLOp(canraise=(MemoryError,), sideeffects=False),
     'gc_set_max_heap_size': LLOp(),
     'gc_can_move'         : LLOp(sideeffects=False),

Modified: pypy/branch/gc-hash/pypy/rpython/memory/gctransform/framework.py
==============================================================================
--- pypy/branch/gc-hash/pypy/rpython/memory/gctransform/framework.py	(original)
+++ pypy/branch/gc-hash/pypy/rpython/memory/gctransform/framework.py	Tue Oct 13 20:28:16 2009
@@ -731,12 +731,14 @@
         hop.cast_result(v_addr)
 
     def gct_gc_identityhash(self, hop):
+        livevars = self.push_roots(hop)
         [v_ptr] = hop.spaceop.args
         v_adr = hop.genop("cast_ptr_to_adr", [v_ptr],
                           resulttype=llmemory.Address)
         hop.genop("direct_call",
                   [self.identityhash_ptr, self.c_const_gc, v_adr],
                   resultvar=hop.spaceop.result)
+        self.pop_roots(hop, livevars)
 
     def gct_gc_id(self, hop):
         if self.id_ptr is not None:



More information about the Pypy-commit mailing list