cpython/Include
Jeremy Hylton 985eba53f5 Small function call optimization and special build option for call stats.
-DCALL_PROFILE: Count the number of function calls executed.

When this symbol is defined, the ceval mainloop and helper functions
count the number of function calls made.  It keeps detailed statistics
about what kind of object was called and whether the call hit any of
the special fast paths in the code.

Optimization:

When we take the fast_function() path, which seems to be taken for
most function calls, and there is minimal frame setup to do, avoid
call PyEval_EvalCodeEx().  The eval code ex function does a lot of
work to handle keywords args and star args, free variables,
generators, etc.  The inlined version simply allocates the frame and
copies the arguments values into the frame.

The optimization gets a little help from compile.c which adds a
CO_NOFREE flag to code objects that don't have free variables or cell
variables.  This change allows fast_function() to get into the fast
path with fewer tests.

I measure a couple of percent speedup in pystone with this change, but
there's surely more that can be done.
2003-02-05 23:13:00 +00:00
..
Python.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
abstract.h James Henstridge pointed out a misleading comment. 2002-11-25 15:06:29 +00:00
bitset.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
boolobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
bufferobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
cStringIO.h SF bug #670229: doc improvement for cStringIO.h 2003-01-19 00:45:01 +00:00
cellobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
ceval.h Small function call optimization and special build option for call stats. 2003-02-05 23:13:00 +00:00
classobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
cobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
codecs.h PEP 293 implemention (from SF patch http://www.python.org/sf/432401) 2002-09-02 13:14:32 +00:00
compile.h Small function call optimization and special build option for call stats. 2003-02-05 23:13:00 +00:00
complexobject.h SF # 607253, header file problems by Ralf W. Grosse-Kunstleve 2002-10-04 12:43:02 +00:00
datetime.h Got rid of the internal datetimetz type. 2003-01-11 03:39:11 +00:00
descrobject.h SF 548651: Fix the METH_CLASS implementation. 2002-12-09 22:56:13 +00:00
dictobject.h Constify char* API. Fixes #651363. 2.2 candidate. 2002-12-11 13:21:12 +00:00
enumobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
errcode.h provide less mysterious error messages when seeing end-of-line in 2002-08-15 01:20:16 +00:00
eval.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
fileobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
floatobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
frameobject.h A slight change to SET_LINENO-less tracing. 2002-09-11 15:36:32 +00:00
funcobject.h Provide __module__ attributes for functions defined in C and Python. 2003-01-31 18:33:18 +00:00
graminit.h Patch #534304: Implement phase 1 of PEP 263. 2002-08-04 17:29:52 +00:00
grammar.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
import.h Excise DL_IMPORT/EXPORT from object.h, and related files. This patch 2002-07-29 13:42:14 +00:00
intobject.h Move _PyInt_Init() into pythonrun.h, since all the other _Init() 2003-01-01 15:18:32 +00:00
intrcheck.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
iterobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
listobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
longintrepr.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
longobject.h _PyLong_NumBits(): The definition of this was too specific to the quirky 2003-01-31 15:52:05 +00:00
marshal.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
metagrammar.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
methodobject.h Provide __module__ attributes for functions defined in C and Python. 2003-01-31 18:33:18 +00:00
modsupport.h SF patch 576101, by Oren Tirosh: alternative implementation of 2002-08-19 21:43:18 +00:00
moduleobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
node.h Back out the previous change. It doesn't save any space on 64-bit 2002-09-17 03:27:02 +00:00
object.h Remove _Py_ResetReferences. Fixes bug #529750 "Circular reference makes 2002-11-17 17:52:44 +00:00
objimpl.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
opcode.h Further SET_LINENO reomval fixes. See comments in patch #587933. 2002-08-30 13:09:51 +00:00
osdefs.h OS/2 EMX port changes (Include part of patch #450267): 2002-02-26 11:20:01 +00:00
parsetok.h Constify filenames and scripts. Fixes #651362. 2002-12-11 14:04:59 +00:00
patchlevel.h Various updates to the version number, on the eve of the 2.3a1 release. 2002-12-31 01:50:07 +00:00
pgenheaders.h Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCC 2002-09-15 14:09:54 +00:00
py_curses.h Fix for #641455: curses module doesn't build on MacOSX. It turns out the 2002-11-22 16:12:57 +00:00
pydebug.h Update comment, QnewFlag will go away in 3.0, not 2.3 2003-01-13 16:08:56 +00:00
pyerrors.h Constify filenames and scripts. Fixes #651362. 2002-12-11 14:04:59 +00:00
pyfpe.h Some patches to Lee Busby's fpectl mods that accidentally didn't make it 1997-10-20 23:50:01 +00:00
pygetopt.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
pymactoolbox.h It turns out that some calls return AEDesc records that are "borrowed", 2003-01-17 23:11:17 +00:00
pymem.h Remove MALLOC_ZERO_RETURNS_NULL. 2002-11-23 09:13:40 +00:00
pyport.h Patch #661760: Cygwin auto-import module patch 2003-01-06 12:41:26 +00:00
pystate.h Assorted patches from Armin Rigo: 2002-11-08 12:53:11 +00:00
pythonrun.h Move _PyInt_Init() into pythonrun.h, since all the other _Init() 2003-01-01 15:18:32 +00:00
pythread.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
rangeobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
sliceobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
stringobject.h Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCC 2002-09-15 14:09:54 +00:00
structmember.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
structseq.h Clean up some whitespace to be consistent with Python's C style. 2002-10-17 19:48:27 +00:00
symtable.h Constify filenames and scripts. Fixes #651362. 2002-12-11 14:04:59 +00:00
sysmodule.h Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCC 2002-09-15 14:09:54 +00:00
token.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
traceback.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
tupleobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00
ucnhash.h refactored the unicodeobject/ucnhash interface, to hide the 2001-01-19 09:45:02 +00:00
unicodeobject.h Add name mangling for new PyUnicode_FromOrdinal() and fix declaration 2002-08-12 08:19:10 +00:00
weakrefobject.h Excise DL_EXPORT from Include. 2002-08-12 07:21:58 +00:00