[pypy-svn] r32057 - in pypy/branch/more-gckinds/pypy: rpython rpython/lltypesystem translator/c

mwh at codespeak.net mwh at codespeak.net
Thu Sep 7 15:55:15 CEST 2006


Author: mwh
Date: Thu Sep  7 15:55:14 2006
New Revision: 32057

Modified:
   pypy/branch/more-gckinds/pypy/rpython/annlowlevel.py
   pypy/branch/more-gckinds/pypy/rpython/lltypesystem/lltype.py
   pypy/branch/more-gckinds/pypy/translator/c/funcgen.py
Log:
first steps: make functions have _gckind=='prebuilt'.
not too many scary corners were illuminated doing this.


Modified: pypy/branch/more-gckinds/pypy/rpython/annlowlevel.py
==============================================================================
--- pypy/branch/more-gckinds/pypy/rpython/annlowlevel.py	(original)
+++ pypy/branch/more-gckinds/pypy/rpython/annlowlevel.py	Thu Sep  7 15:55:14 2006
@@ -178,7 +178,7 @@
         return Constant(p, lltype.typeOf(p))
 
     def graph2delayed(self, graph):
-        FUNCTYPE = lltype.ForwardReference()
+        FUNCTYPE = lltype.FuncForwardReference()
         # obscure hack: embed the name of the function in the string, so
         # that the genc database can get it even before the delayedptr
         # is really computed

Modified: pypy/branch/more-gckinds/pypy/rpython/lltypesystem/lltype.py
==============================================================================
--- pypy/branch/more-gckinds/pypy/rpython/lltypesystem/lltype.py	(original)
+++ pypy/branch/more-gckinds/pypy/rpython/lltypesystem/lltype.py	Thu Sep  7 15:55:14 2006
@@ -411,7 +411,7 @@
 
 
 class FuncType(ContainerType):
-    _gckind = 'raw'
+    _gckind = 'prebuilt'
     __name__ = 'func'
     def __init__(self, args, result):
         for arg in args:
@@ -512,6 +512,9 @@
 class PyForwardReference(ForwardReference):
     _gckind = 'cpy'
 
+class FuncForwardReference(ForwardReference):
+    _gckind = 'prebuilt'
+
 FORWARDREF_BY_FLAVOR = {'raw': ForwardReference,
                         'gc':  GcForwardReference,
                         'cpy': PyForwardReference}

Modified: pypy/branch/more-gckinds/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/branch/more-gckinds/pypy/translator/c/funcgen.py	(original)
+++ pypy/branch/more-gckinds/pypy/translator/c/funcgen.py	Thu Sep  7 15:55:14 2006
@@ -10,7 +10,7 @@
 from pypy.rpython.lltypesystem.lltype import UnsignedLongLong, Char, UniChar
 from pypy.rpython.lltypesystem.lltype import pyobjectptr, ContainerType
 from pypy.rpython.lltypesystem.lltype import Struct, Array, FixedSizeArray
-from pypy.rpython.lltypesystem.lltype import ForwardReference
+from pypy.rpython.lltypesystem.lltype import FuncForwardReference
 from pypy.rpython.lltypesystem.llmemory import Address, WeakGcAddress
 from pypy.translator.backendopt.ssa import SSI_to_SSA
 
@@ -58,7 +58,7 @@
             T = getattr(v, 'concretetype', PyObjPtr)
             # obscure: skip forward references and hope for the best
             # (needed for delayed function pointers)
-            if isinstance(T, Ptr) and T.TO.__class__ == ForwardReference:
+            if isinstance(T, Ptr) and T.TO.__class__ == FuncForwardReference:
                 continue
             db.gettype(T)  # force the type to be considered by the database
        



More information about the Pypy-commit mailing list