[pypy-svn] r20450 - pypy/branch/somepbc-refactoring/pypy/annotation

arigo at codespeak.net arigo at codespeak.net
Wed Nov 30 20:38:37 CET 2005


Author: arigo
Date: Wed Nov 30 20:38:36 2005
New Revision: 20450

Modified:
   pypy/branch/somepbc-refactoring/pypy/annotation/specialize.py
Log:
Reverted this change.  Doesn't work.


Modified: pypy/branch/somepbc-refactoring/pypy/annotation/specialize.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/annotation/specialize.py	(original)
+++ pypy/branch/somepbc-refactoring/pypy/annotation/specialize.py	Wed Nov 30 20:38:36 2005
@@ -2,7 +2,7 @@
 import types
 from pypy.tool.uid import uid
 from pypy.objspace.flow.model import Block, Link, Variable, SpaceOperation
-from pypy.objspace.flow.model import Constant, checkgraph
+from pypy.objspace.flow.model import checkgraph
 
 def default_specialize(funcdesc, args_s):
     argnames, vararg, kwarg = funcdesc.signature
@@ -90,12 +90,8 @@
         return getattr(x, attrname)
     def builder(translator, func):
         return translator.buildflowgraph(memoized)   # instead of 'func'
-    # if 's' is actually a constant, make sure we get a new copy of
-    # 'memoized' for it.  This copy of memoized is all-constant and so
-    # it will get inlined.
-    key = ('memo1', s.is_constant() and Constant(s.const))
-    return funcdesc.cachedgraph(key, alt_name='memo_%s' % funcdesc.name, 
-                                     builder=builder)
+    return funcdesc.cachedgraph('memo1', alt_name='memo_%s' % funcdesc.name, 
+                                         builder=builder)
 
 def methodmemo(funcdesc, arglist_s):
     """NOT_RPYTHON"""
@@ -164,14 +160,8 @@
         return reader_fn(y)
     def builder(translator, func):
         return translator.buildflowgraph(memoized)   # instead of 'func'
-    # if 's2' is actually a constant, make sure we get a new copy of
-    # 'memoized' for it.  This copy of memoized is all-constant and so
-    # it will get inlined.  In addition, if this methodmemo 'func' shows
-    # up on instances of different classes, use a different copy of
-    # 'memoized' as well to minimize annotation mixes.
-    key = ('memo2', s1_type, s2.is_constant() and Constant(s2.const))
-    return funcdesc.cachedgraph(key, alt_name='memo_%s' % funcdesc.name, 
-                                     builder=builder)
+    return funcdesc.cachedgraph(s1_type, alt_name='memo_%s' % funcdesc.name, 
+                                         builder=builder)
 
 def argvalue(i):
     def specialize_argvalue(funcdesc, args_s):



More information about the Pypy-commit mailing list