[Python-checkins] CVS: python/dist/src/Python ceval.c,2.243,2.244
Jeremy Hylton
jhylton@users.sourceforge.net
Fri, 18 May 2001 13:53:17 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv6376
Modified Files:
ceval.c
Log Message:
Add a second special case to the inline function call code in eval_code2().
If we have a PyCFunction (builtin) and it is METH_VARARGS only, load
the args and dispatch to call_cfunction() directly. This provides a
small speedup for perhaps the most common function calls -- builtins.
Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.243
retrieving revision 2.244
diff -C2 -r2.243 -r2.244
*** ceval.c 2001/05/05 00:14:56 2.243
--- ceval.c 2001/05/18 20:53:14 2.244
***************
*** 1970,1974 ****
*/
if (PyCFunction_Check(func)) {
! if (PyCFunction_GET_FLAGS(func) == 0) {
x = fast_cfunction(func,
&stack_pointer, na);
--- 1970,1980 ----
*/
if (PyCFunction_Check(func)) {
! int flags = PyCFunction_GET_FLAGS(func);
! if (flags == METH_VARARGS) {
! PyObject *callargs;
! callargs = load_args(&stack_pointer, na);
! x = call_cfunction(func, callargs, NULL);
! Py_XDECREF(callargs);
! } else if (flags == 0) {
x = fast_cfunction(func,
&stack_pointer, na);