[pypy-svn] r67773 - in pypy/trunk/pypy: annotation annotation/test rpython

cfbolz at codespeak.net cfbolz at codespeak.net
Fri Sep 18 15:34:55 CEST 2009


Author: cfbolz
Date: Fri Sep 18 15:34:53 2009
New Revision: 67773

Modified:
   pypy/trunk/pypy/annotation/specialize.py
   pypy/trunk/pypy/annotation/test/test_annrpython.py
   pypy/trunk/pypy/rpython/annlowlevel.py
Log:
(pedronis, cfbolz): remove some code that changed the name of some graphs. the default naming is good enough.


Modified: pypy/trunk/pypy/annotation/specialize.py
==============================================================================
--- pypy/trunk/pypy/annotation/specialize.py	(original)
+++ pypy/trunk/pypy/annotation/specialize.py	Fri Sep 18 15:34:53 2009
@@ -48,16 +48,15 @@
             checkgraph(graph)
             return graph
 
-        key = nb_extra_args
-        name_suffix = '_star%d' % (nb_extra_args,) # xxx kill
-        return flattened_s, key, name_suffix, builder
+        key = ('star', nb_extra_args)
+        return flattened_s, key, builder
 
     else:
-        return args_s, None, '', None
+        return args_s, None, None
 
 def default_specialize(funcdesc, args_s):
     # first flatten the *args
-    args_s, key, name_suffix, builder = flatten_star_args(funcdesc, args_s)
+    args_s, key, builder = flatten_star_args(funcdesc, args_s)
     # two versions: a regular one and one for instances with 'access_directly'
     jit_look_inside = getattr(funcdesc.pyobj, '_look_inside_me_', True)
     # change args_s in place, "official" interface
@@ -68,7 +67,6 @@
             if jit_look_inside:
                 access_directly = True
                 key = (AccessDirect, key)
-                name_suffix += '_AccessDirect'
                 break                
             else:
                 new_flags = s_obj.flags.copy()
@@ -78,11 +76,7 @@
                 args_s[i] = new_s_obj
 
     # done
-    if name_suffix:
-        alt_name = '%s%s' % (funcdesc.name, name_suffix)
-    else:
-        alt_name = None
-    graph = funcdesc.cachedgraph(key, alt_name=alt_name, builder=builder)
+    graph = funcdesc.cachedgraph(key, builder=builder)
     if access_directly:
         graph.access_directly = True
     return graph
@@ -336,9 +330,9 @@
     return constgraphbuilder
 
 def maybe_star_args(funcdesc, key, args_s):
-    args_s, key1, ignore, builder = flatten_star_args(funcdesc, args_s)
+    args_s, key1, builder = flatten_star_args(funcdesc, args_s)
     if key1 is not None:
-        key = key + (key1,) # xxx make sure key1 is already a tuple
+        key = key + key1
     return funcdesc.cachedgraph(key, builder=builder)
  
 def specialize_argvalue(funcdesc, args_s, *argindices):

Modified: pypy/trunk/pypy/annotation/test/test_annrpython.py
==============================================================================
--- pypy/trunk/pypy/annotation/test/test_annrpython.py	(original)
+++ pypy/trunk/pypy/annotation/test/test_annrpython.py	Fri Sep 18 15:34:53 2009
@@ -1141,8 +1141,8 @@
         executedesc = a.bookkeeper.getdesc(I.execute.im_func)
         assert len(executedesc._cache) == 2       
 
-        assert len(executedesc._cache[(0, 2)].startblock.inputargs) == 4
-        assert len(executedesc._cache[(1, 3)].startblock.inputargs) == 5
+        assert len(executedesc._cache[(0, 'star', 2)].startblock.inputargs) == 4
+        assert len(executedesc._cache[(1, 'star', 3)].startblock.inputargs) == 5
 
     def test_assert_list_doesnt_lose_info(self):
         class T(object):

Modified: pypy/trunk/pypy/rpython/annlowlevel.py
==============================================================================
--- pypy/trunk/pypy/rpython/annlowlevel.py	(original)
+++ pypy/trunk/pypy/rpython/annlowlevel.py	Fri Sep 18 15:34:53 2009
@@ -42,7 +42,7 @@
         pol.rtyper = rtyper
 
     def lowlevelspecialize(funcdesc, args_s, key_for_args):
-        args_s, key1, ignored, builder = flatten_star_args(funcdesc, args_s)
+        args_s, key1, builder = flatten_star_args(funcdesc, args_s)
         key = []
         new_args_s = []
         for i, s_obj in enumerate(args_s):



More information about the Pypy-commit mailing list