[pypy-svn] r61156 - pypy/branch/oo-jit/pypy/translator/c

fijal at codespeak.net fijal at codespeak.net
Tue Jan 20 14:15:25 CET 2009

Author: fijal
Date: Tue Jan 20 14:15:22 2009
New Revision: 61156

an ability to render GCREFs. I'm not sure if this is cool btw.
I tried a lot to write a test for it, gave up for now

Modified: pypy/branch/oo-jit/pypy/translator/c/database.py
--- pypy/branch/oo-jit/pypy/translator/c/database.py	(original)
+++ pypy/branch/oo-jit/pypy/translator/c/database.py	Tue Jan 20 14:15:22 2009
@@ -3,7 +3,8 @@
      Struct, Array, FuncType, PyObject, Void, \
      ContainerType, OpaqueType, FixedSizeArray, _uninitialized
 from pypy.rpython.lltypesystem import lltype
-from pypy.rpython.lltypesystem.llmemory import Address, WeakRef, _WeakRefType
+from pypy.rpython.lltypesystem.llmemory import Address, WeakRef, _WeakRefType,\
+     GCREF
 from pypy.rpython.lltypesystem.rffi import CConstant
 from pypy.tool.sourcetools import valid_identifier
 from pypy.translator.c.primitive import PrimitiveName, PrimitiveType
@@ -145,6 +146,8 @@
             raise Exception("don't know about type %r" % (T,))
     def getcontainernode(self, container, _dont_write_c_code=True, **buildkwds):
+        if typeOf(container) == GCREF.TO:
+            container = container.container
             node = self.containernodes[container]
         except KeyError:

More information about the Pypy-commit mailing list