summaryrefslogtreecommitdiffstats
path: root/Modules/fpectlmodule.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-01-03 23:52:36 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-01-03 23:52:36 (GMT)
commit5282044be7e4b5495a43148e478ee2cd5fed8c80 (patch)
tree2664c323e330c21971e7f91d7f8b7b5ce7c17975 /Modules/fpectlmodule.c
parentc4e1775081b3713342026c1d7c1d874e023a935b (diff)
downloadcpython-5282044be7e4b5495a43148e478ee2cd5fed8c80.zip
cpython-5282044be7e4b5495a43148e478ee2cd5fed8c80.tar.gz
cpython-5282044be7e4b5495a43148e478ee2cd5fed8c80.tar.bz2
Revised implementation of CALL_FUNCTION and friends.
More revision still needed. Much of the code that was in the mainloop was moved to a series of helper functions. PyEval_CallObjectWithKeywords was split into two parts. The first part now only does argument handling. The second part is now named call_object and delegates the call to a call_(function,method,etc.) helper. XXX The call_XXX helper functions should be replaced with tp_call functions for the respective types. The CALL_FUNCTION implementation contains three kinds of optimization: 1. fast_cfunction and fast_function are called when the arguments on the stack can be passed directly to eval_code2() without copying them into a tuple. 2. PyCFunction objects are dispatched immediately, because they are presumed to occur more often than anything else. 3. Bound methods are dispatched inline. The method object contains a pointer to the function object that will be called. The function is called from within the mainloop, which may allow optimization #1 to be used, too. The extened call implementation -- f(*args) and f(**kw) -- are implemented as a separate case in the mainloop. This allows the common case of normal function calls to execute without wasting time on checks for extended calls, although it does introduce a small amount of code duplication. Also, the unused final argument of eval_code2() was removed. This is probably the last trace of the access statement :-).
Diffstat (limited to 'Modules/fpectlmodule.c')
0 files changed, 0 insertions, 0 deletions