summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Inline PyEval_EvalFrameEx() in callersVictor Stinner2016-12-091-2/+2
| | | | | | | | The PEP 523 modified PyEval_EvalFrameEx(): it's now an indirection to interp->eval_frame(). Inline the call in performance critical code. Leave PyEval_EvalFrame() unchanged, this function is only kept for backward compatibility.
* Use _PyObject_CallNoArg()Victor Stinner2016-12-061-2/+2
| | | | | | | Replace: PyObject_CallFunctionObjArgs(callable, NULL) with: _PyObject_CallNoArg(callable)
* Use _PyObject_CallNoArg()Victor Stinner2016-12-061-2/+2
| | | | | | | Replace: PyObject_CallObject(callable, NULL) with: _PyObject_CallNoArg(callable)
* Uniformize argument names of "call" functionsVictor Stinner2016-12-061-3/+4
| | | | | | | | | | | | Issue #28838: Rename parameters of the "calls" functions of the Python C API. * Rename 'callable_object' and 'func' to 'callable': any Python callable object is accepted, not only Python functions * Rename 'method' and 'nameid' to 'name' (method name) * Rename 'o' to 'obj' * Move, fix and update documentation of PyObject_CallXXX() functions in abstract.h * Update also the documentaton of the C API (update parameter names)
* Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-3/+3
| | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* WITH_CLEANUP_START uses fastcallVictor Stinner2016-12-011-3/+10
| | | | | Modify WITH_CLEANUP_START bytecode: replace PyObject_CallFunctionObjArgs() with _PyObject_FastCall().
* Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-3/+3
| | | | | | | | | | | | | | * PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
* call_function(): document PyMethod optimizationVictor Stinner2016-11-281-1/+5
|
* Remove CALL_PROFILE special buildVictor Stinner2016-11-281-91/+0
| | | | | | | | | | | Issue #28799: * Remove the PyEval_GetCallStats() function. * Deprecate the untested and undocumented sys.callstats() function. * Remove the CALL_PROFILE special build Use the sys.setprofile() function, cProfile or profile module to profile function calls.
* Merge 3.6Victor Stinner2016-11-241-0/+1
|\
| * Fix _PyGen_yf()Victor Stinner2016-11-241-0/+1
| | | | | | | | | | | | | | | | Issue #28782: Fix a bug in the implementation ``yield from`` when checking if the next instruction is YIELD_FROM. Regression introduced by WORDCODE (issue #26647). Reviewed by Serhiy Storchaka and Yury Selivanov.
* | mergeRaymond Hettinger2016-11-221-1/+3
|\ \ | |/
| * Issue #27100: Fix ref leakRaymond Hettinger2016-11-221-1/+3
| |
* | mergeRaymond Hettinger2016-11-221-4/+4
|\ \ | |/
| * Issue #27100: With statement reports missing __enter__ before __exit__. ↵Raymond Hettinger2016-11-221-4/+4
| | | | | | | | (Contributed by Jonathan Ellington.)
* | Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-201-5/+5
| | | | | | | | UTF-8 represenatation of Unicode objects.
* | Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-201-2/+2
|\ \ | |/ | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
| * Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-201-2/+2
| | | | | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
| * Issue #28665: Harmonize STORE_DEREF with STORE_FAST and LOAD_DEREF giving a ↵Raymond Hettinger2016-11-111-2/+3
| | | | | | | | 40% speedup.
* | Issue #28665: Use macro form of PyCell_GET/SETRaymond Hettinger2016-11-121-4/+8
| |
* | mergeRaymond Hettinger2016-11-111-2/+3
| |
* | Issue #28618: Make hot functions using __attribute__((hot))Victor Stinner2016-11-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Python is not compiled with PGO, the performance of Python on call_simple and call_method microbenchmarks depend highly on the code placement. In the worst case, the performance slowdown can be up to 70%. The GCC __attribute__((hot)) attribute helps to keep hot code close to reduce the risk of such major slowdown. This attribute is ignored when Python is compiled with PGO. The following functions are considered as hot according to statistics collected by perf record/perf report: * _PyEval_EvalFrameDefault() * call_function() * _PyFunction_FastCall() * PyFrame_New() * frame_dealloc() * PyErr_Occurred()
* | Fixed possible abort in ceval loop if _PyUnicode_FromId() fails.Serhiy Storchaka2016-11-081-2/+2
|\ \ | |/ | | | | Every opcode should end with DISPATCH() or goto error.
| * Fixed possible abort in ceval loop if _PyUnicode_FromId() fails.Serhiy Storchaka2016-11-081-2/+2
| |\ | | | | | | | | | Every opcode should end with DISPATCH() or goto error.
| | * Fixed possible abort in ceval loop if _PyUnicode_FromId() fails.Serhiy Storchaka2016-11-081-1/+1
| | | | | | | | | | | | Every opcode should end with DISPATCH() or goto error.
| | * Issue #28257: Improved error message when pass a non-mapping as a var-keywordSerhiy Storchaka2016-10-071-4/+17
| | | | | | | | | | | | argument.
| | * Silence GCC warning.Serhiy Storchaka2016-09-221-2/+2
| | | | | | | | | | | | The code was correct, but GCC is not enough clever.
| | * Issue #26020: Fix evaluation order for set literalsRaymond Hettinger2016-09-081-2/+4
| | |
* | | Merge 3.6 (issue #27243)Yury Selivanov2016-11-081-1/+1
|\ \ \ | |/ /
| * | Issue #27243: Change PendingDeprecationWarning -> DeprecationWarning.Yury Selivanov2016-11-081-1/+1
| | | | | | | | | | | | | | | | | | As it was agreed in the issue, __aiter__ returning an awaitable should result in PendingDeprecationWarning in 3.5 and in DeprecationWarning in 3.6.
* | | Issue #21955: Please don't try to optimize int+intVictor Stinner2016-10-201-0/+6
| | |
* | | Minor fix-up to apply the stack adjustment macros consistent with the other ↵Raymond Hettinger2016-10-161-2/+2
| | | | | | | | | | | | opcodes
* | | Issue #27358: Merge from 3.6Berker Peksag2016-10-021-1/+1
|\ \ \ | |/ /
| * | Issue #27358: Fix typo in error messageBerker Peksag2016-10-021-1/+1
| | |
* | | Issue #27358: Optimized merging var-keyword arguments and improved errorSerhiy Storchaka2016-10-021-44/+54
|\ \ \ | |/ / | | | | | | message when pass a non-mapping as a var-keyword argument.
| * | Issue #27358: Optimized merging var-keyword arguments and improved errorSerhiy Storchaka2016-10-021-44/+54
| | | | | | | | | | | | message when pass a non-mapping as a var-keyword argument.
* | | Issue #28257: Improved error message when pass a non-iterable asSerhiy Storchaka2016-10-021-1/+12
|\ \ \ | |/ / | | | | | | a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
| * | Issue #28257: Improved error message when pass a non-iterable asSerhiy Storchaka2016-10-021-1/+12
| | | | | | | | | | | | a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
* | | Issue #27703: Got rid of unnecessary NULL checks in do_raise() in release mode.Serhiy Storchaka2016-09-271-2/+5
|/ / | | | | | | Patch by Xiang Zhang.
* | Issue #28086: Single var-positional argument of tuple subtype was passedSerhiy Storchaka2016-09-221-2/+2
| | | | | | | | unscathed to the C-defined function. Now it is converted to exact tuple.
* | Document kwnames in _PyObject_FastCallKeywords() and _PyStack_AsDict()Victor Stinner2016-09-121-0/+5
| | | | | | | | Issue #27213.
* | Issue #27213: Fix reference leaksVictor Stinner2016-09-121-0/+2
| |
* | Issue #27213: Fixed different issues with reworked CALL_FUNCTION* opcodes.Serhiy Storchaka2016-09-111-84/+57
| | | | | | | | | | | | | | | | | | | | | | * BUILD_TUPLE_UNPACK and BUILD_MAP_UNPACK_WITH_CALL no longer generated with single tuple or dict. * Restored more informative error messages for incorrect var-positional and var-keyword arguments. * Removed code duplications in _PyEval_EvalCodeWithName(). * Removed redundant runtime checks and parameters in _PyStack_AsDict(). * Added a workaround and enabled previously disabled test in test_traceback. * Removed dead code from the dis module.
* | Issue #27129: Replaced wordcode related magic constants with macros.Serhiy Storchaka2016-09-111-27/+21
| |
* | DTrace support: function calls, GC activity, line executionŁukasz Langa2016-09-101-2/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested on macOS 10.11 dtrace, Ubuntu 16.04 SystemTap, and libbcc. Largely based by an initial patch by Jesús Cea Avión, with some influence from Dave Malcolm's SystemTap patch and Nikhil Benesch's unification patch. Things deliberately left out for simplicity: - ustack helpers, I have no way of testing them at this point since they are Solaris-specific - PyFrameObject * in function__entry/function__return, this is SystemTap-specific - SPARC support - dynamic tracing - sys module dtrace facility introspection All of those might be added later.
* | remove more READ_TIMESTAMPBenjamin Peterson2016-09-091-12/+0
| |
* | remove READ_TIMESTAMP macroBenjamin Peterson2016-09-091-3/+0
| |
* | remove ceval timestamp supportBenjamin Peterson2016-09-091-153/+1
| |
* | Issue #27810: Add _PyCFunction_FastCallKeywords()Victor Stinner2016-09-091-136/+28
| | | | | | | | | | Use _PyCFunction_FastCallKeywords() in ceval.c: it allows to remove a lot of code from ceval.c which was only used to call C functions.
* | Add _PyObject_FastCallKeywords()Victor Stinner2016-09-091-53/+36
| | | | | | | | | | | | | | | | | | | | Issue #27830: Add _PyObject_FastCallKeywords(): avoid the creation of a temporary dictionary for keyword arguments. Other changes: * Cleanup call_function() and fast_function() (ex: rename nk to nkwargs) * Remove now useless do_call(), replaced with _PyObject_FastCallKeywords()