cpython/Python
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
..
.cvsignore Ignore a bunch of generated files. 2000-05-02 18:34:30 +00:00
atof.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
bltinmodule.c Make sure filter() never returns tuple, str or unicode 2003-02-04 20:24:45 +00:00
ceval.c Small function call optimization and special build option for call stats. 2003-02-05 23:13:00 +00:00
codecs.c Properly compute array size even for --disable-unicode. 2002-11-21 23:53:25 +00:00
compile.c Small function call optimization and special build option for call stats. 2003-02-05 23:13:00 +00:00
dup2.c Mass ANSIfication of function definitions. Doesn't cover all 'extern' 2000-07-22 18:47:25 +00:00
dynload_aix.c Fix SF #639945, 64-bit bug on AIX 2002-12-31 00:06:24 +00:00
dynload_atheos.c Patch #488073: AtheOS port. 2002-06-11 06:22:31 +00:00
dynload_beos.c Fix for 2002-01-23 15:51:12 +00:00
dynload_dl.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
dynload_hpux.c Fix SF # 551504, python -v sometimes fails to find init (HPUX) 2002-11-02 20:58:05 +00:00
dynload_mac.c Got rid of old (non-carbon-ppc and even cfm68k) file extensions for 2002-12-16 13:16:25 +00:00
dynload_next.c Squashed compiler warnings by adding casts, making sure prototypes are in 2002-12-23 21:03:36 +00:00
dynload_os2.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
dynload_shlib.c OS/2 EMX port changes (Python part of patch #450267): 2002-02-26 11:41:34 +00:00
dynload_stub.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
dynload_win.c Fix a couple of whitespace consistency nits. 2002-08-26 21:20:30 +00:00
errors.c Constify filenames and scripts. Fixes #651362. 2002-12-11 14:04:59 +00:00
exceptions.c Provide __module__ attributes for functions defined in C and Python. 2003-01-31 18:33:18 +00:00
fmod.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
frozen.c This is my patch 2002-08-15 14:59:02 +00:00
frozenmain.c Patch #569753: Remove support for WIN16. 2002-06-30 15:26:10 +00:00
future.c Constify filenames and scripts. Fixes #651362. 2002-12-11 14:04:59 +00:00
getargs.c If a float is passed where a int is expected, issue a DeprecationWarning 2003-02-04 20:59:40 +00:00
getcompiler.c The GCC version is loooooooooong; put it on a new line. 2000-09-05 04:40:39 +00:00
getcopyright.c Another copyright update. (JvR: can you backport this to the 2.3a1 2003-01-02 16:27:15 +00:00
getcwd.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
getmtime.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
getopt.c Move our own getopt() implementation to _PyOS_GetOpt(), and use it 2000-11-03 08:18:37 +00:00
getplatform.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
getversion.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
graminit.c Patch #534304: Implement phase 1 of PEP 263. 2002-08-04 17:29:52 +00:00
hypot.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
import.c MacPython-OS9 specific fix: If there are non-string items on sys.path don't try to intern them. This has the theoretical problem that resource filenames on sys.path cannot be unicode objects, but in practice that shouldn't matter. 2003-01-24 16:15:45 +00:00
importdl.c Simplify, and avoid PyModule_GetDict() while we're at it. 2002-08-26 21:15:11 +00:00
importdl.h PEP 302 + zipimport: 2002-12-30 22:08:05 +00:00
mactoolboxglue.c It turns out that some calls return AEDesc records that are "borrowed", 2003-01-17 23:11:17 +00:00
marshal.c Whitespace normalization. 2002-07-30 11:44:44 +00:00
memmove.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
modsupport.c Provide __module__ attributes for functions defined in C and Python. 2003-01-31 18:33:18 +00:00
mysnprintf.c PyOS_vsnprintf(): Change PyMem_Malloc() call to PyMem_MALLOC() macro, 2001-12-21 16:32:15 +00:00
mystrtoul.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
pyfpe.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
pystate.c Assorted patches from Armin Rigo: 2002-11-08 12:53:11 +00:00
pythonrun.c MacPython-OS9 has had an abort() function for quite a while now, so there's no reason to stall in an endless loop, just call abort() on a fatal error. 2003-01-24 16:17:18 +00:00
sigcheck.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
strdup.c Mass ANSIfication of function definitions. Doesn't cover all 'extern' 2000-07-22 18:47:25 +00:00
strerror.c Use PyOS_snprintf instead of sprintf. 2001-11-28 20:42:20 +00:00
strtod.c Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774. 2001-07-26 13:41:06 +00:00
structmember.c Fix SF bug #486144: Uninitialized __slot__ vrbl is None. 2001-12-04 16:23:42 +00:00
symtable.c Add a comment explaining the st_symbols cache. 2001-12-10 00:53:18 +00:00
sysmodule.c Small function call optimization and special build option for call stats. 2003-02-05 23:13:00 +00:00
thread.c Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT. 2002-07-19 06:55:41 +00:00
thread_atheos.h Patch #488073: AtheOS port. 2002-06-11 06:22:31 +00:00
thread_beos.h Remove the unused & broken PyThread_*_sema() functions and related constants. 2002-01-19 22:02:55 +00:00
thread_cthread.h Remove the unused & broken PyThread_*_sema() functions and related constants. 2002-01-19 22:02:55 +00:00
thread_foobar.h Remove the unused & broken PyThread_*_sema() functions and related constants. 2002-01-19 22:02:55 +00:00
thread_lwp.h Remove the unused & broken PyThread_*_sema() functions and related constants. 2002-01-19 22:02:55 +00:00
thread_nt.h SF patch 522961: Leak in Python/thread_nt.h, from Gerald S. Williams. 2002-02-28 21:34:34 +00:00
thread_os2.h reformat for PEP-7 style conformance 2002-12-04 12:29:37 +00:00
thread_pth.h Remove the unused & broken PyThread_*_sema() functions and related constants. 2002-01-19 22:02:55 +00:00
thread_pthread.h Don't use Posix semaphores on Solaris 8. Fixes #662787. 2003-01-21 10:14:41 +00:00
thread_sgi.h Remove the unused & broken PyThread_*_sema() functions and related constants. 2002-01-19 22:02:55 +00:00
thread_solaris.h Remove the unused & broken PyThread_*_sema() functions and related constants. 2002-01-19 22:02:55 +00:00
thread_wince.h Partial patch from SF #452266, by Jason Petrone. 2001-10-16 21:13:49 +00:00
traceback.c This is my patch 2002-08-15 14:59:02 +00:00