[pypy-svn] r47127 - pypy/dist/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Wed Oct 3 21:57:19 CEST 2007


Author: arigo
Date: Wed Oct  3 21:57:18 2007
New Revision: 47127

Modified:
   pypy/dist/pypy/rpython/annlowlevel.py
Log:
Use a tuple inside a tuple as the specialization key.  This allows us
to avoid putting an explicit None in the key, which shows up as a
substring of graph.name and confuses llvm tests.


Modified: pypy/dist/pypy/rpython/annlowlevel.py
==============================================================================
--- pypy/dist/pypy/rpython/annlowlevel.py	(original)
+++ pypy/dist/pypy/rpython/annlowlevel.py	Wed Oct  3 21:57:18 2007
@@ -40,8 +40,8 @@
         pol.rtyper = rtyper
 
     def lowlevelspecialize(funcdesc, args_s, key_for_args):
-        args_s, key, ignored, builder = flatten_star_args(funcdesc, args_s)
-        key = [key]
+        args_s, key1, ignored, builder = flatten_star_args(funcdesc, args_s)
+        key = []
         new_args_s = []
         for i, s_obj in enumerate(args_s):
             if i in key_for_args:
@@ -59,7 +59,10 @@
                     # passing non-low-level types to a ll_* function is allowed
                     # for module/ll_*
                     key.append(s_obj.__class__)
-        flowgraph = funcdesc.cachedgraph(tuple(key), builder=builder)
+        key = (tuple(key),)
+        if key1 is not None:
+            key += (key1,)
+        flowgraph = funcdesc.cachedgraph(key, builder=builder)
         args_s[:] = new_args_s
         return flowgraph
     lowlevelspecialize = staticmethod(lowlevelspecialize)



More information about the Pypy-commit mailing list