Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r65301:aa29cd273b2d
Date: 2013-07-09 20:04 +0200
http://bitbucket.org/pypy/pypy/changeset/aa29cd273b2d/
Log: Try to enable fast path for more functions (test so far)
diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py
--- a/pypy/interpreter/gateway.py
+++ b/pypy/interpreter/gateway.py
@@ -414,21 +414,21 @@
mod = ""
if mod == 'pypy.interpreter.astcompiler.ast':
raise FastFuncNotSupported
- if (not mod.startswith('pypy.module.__builtin__') and
- not mod.startswith('pypy.module.sys') and
- not mod.startswith('pypy.module.math')):
- if not func.__name__.startswith('descr'):
- raise FastFuncNotSupported
+ #if (not mod.startswith('pypy.module.__builtin__') and
+ # not mod.startswith('pypy.module.sys') and
+ # not mod.startswith('pypy.module.math')):
+ # if not func.__name__.startswith('descr'):
+ # raise FastFuncNotSupported
d = {}
unwrap_info.miniglobals['func'] = func
source = """if 1:
def fastfunc_%s_%d(%s):
return func(%s)
- \n""" % (func.__name__, narg,
+ \n""" % (func.__name__.replace('-', '_'), narg,
', '.join(args),
', '.join(unwrap_info.unwrap))
exec compile2(source) in unwrap_info.miniglobals, d
- fastfunc = d['fastfunc_%s_%d' % (func.__name__, narg)]
+ fastfunc = d['fastfunc_%s_%d' % (func.__name__.replace('-', '_'),
narg)]
return narg, fastfunc
make_fastfunc = staticmethod(make_fastfunc)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit