Author: Alex Gaynor <[email protected]>
Branch: 
Changeset: r46052:da9f3c16b424
Date: 2011-07-28 09:05 -0700
http://bitbucket.org/pypy/pypy/changeset/da9f3c16b424/

Log:    use functools.wrap here, should maintain some more of the functions
        attributes this way.

diff --git a/pypy/rlib/jit.py b/pypy/rlib/jit.py
--- a/pypy/rlib/jit.py
+++ b/pypy/rlib/jit.py
@@ -1,10 +1,14 @@
+import functools
+import sys
+
 import py
-import sys
+
+from pypy.rlib.nonconst import NonConstant
+from pypy.rlib.objectmodel import (CDefinedIntSymbolic, keepalive_until_here,
+    specialize)
+from pypy.rlib.unroll import unrolling_iterable
 from pypy.rpython.extregistry import ExtRegistryEntry
-from pypy.rlib.objectmodel import CDefinedIntSymbolic
-from pypy.rlib.objectmodel import keepalive_until_here, specialize
-from pypy.rlib.unroll import unrolling_iterable
-from pypy.rlib.nonconst import NonConstant
+
 
 def elidable(func):
     """ Decorate a function as "trace-elidable". This means precisely that:
@@ -90,7 +94,7 @@
         d = {"func": func, "hint": hint}
         exec py.code.Source("\n".join(code)).compile() in d
         result = d["f"]
-        result.func_name = func.func_name + "_promote"
+        functools.wraps(func)(result)
         return result
     return decorator
 
@@ -279,7 +283,7 @@
 
     def specialize_call(self, hop):
         pass
-    
+
 vref_None = non_virtual_ref(None)
 
 # ____________________________________________________________
@@ -289,7 +293,7 @@
     """Inconsistency in the JIT hints."""
 
 PARAMETERS = {'threshold': 1032, # just above 1024
-              'function_threshold': 1617, # slightly more than one above 
+              'function_threshold': 1617, # slightly more than one above
               'trace_eagerness': 200,
               'trace_limit': 12000,
               'inlining': 1,
@@ -399,7 +403,7 @@
                             raise
     set_user_param._annspecialcase_ = 'specialize:arg(0)'
 
-    
+
     def on_compile(self, logger, looptoken, operations, type, *greenargs):
         """ A hook called when loop is compiled. Overwrite
         for your own jitdriver if you want to do something special, like
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to