[pypy-svn] r53297 - pypy/branch/jit-hotpath/pypy/jit/codegen/ia32

fijal at codespeak.net fijal at codespeak.net
Thu Apr 3 23:10:34 CEST 2008


Author: fijal
Date: Thu Apr  3 23:10:32 2008
New Revision: 53297

Modified:
   pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
Log:
enough support for different things to pass first 12 tests of test_genc_portal


Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py	Thu Apr  3 23:10:32 2008
@@ -120,6 +120,9 @@
     TOKEN_TO_GENVAR[value.token] = value
     TOKEN_TO_SIZE[value.token] = value.SIZE
 LL_TO_GENVAR[lltype.Unsigned] = 'i'
+LL_TO_GENVAR[lltype.Char] = 'i'
+# we might want to have different value for chare
+# but I see no point now
 LL_TO_GENVAR[lltype.Void] = 'v'
 
 UNROLLING_TOKEN_TO_GENVAR = unrolling_iterable(TOKEN_TO_GENVAR.items())
@@ -1461,10 +1464,18 @@
                 llmemory.ItemOffset(A.OF))
 
     @staticmethod
+    @specialize.arg(0)
+    def map_arg(arg):
+        if isinstance(arg, lltype.Ptr):
+            return llmemory.Address
+        return arg
+
+    @classmethod
     @specialize.memo()
-    def sigToken(FUNCTYPE):
-        return ([LL_TO_GENVAR[arg] for arg in FUNCTYPE.ARGS if arg
-                 is not lltype.Void], LL_TO_GENVAR[FUNCTYPE.RESULT])
+    def sigToken(cls, FUNCTYPE):
+        return ([LL_TO_GENVAR[cls.map_arg(arg)] for arg in FUNCTYPE.ARGS if arg
+                 is not lltype.Void],
+                LL_TO_GENVAR[cls.map_arg(FUNCTYPE.RESULT)])
 
     @staticmethod
     def erasedType(T):


More information about the pypy-svn mailing list