summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-29546: Improve from-import error message with location (#103)Matthias Bussonnier2017-02-221-4/+21
| | | | bpo-29546: Improve from-import error message with location
* bpo-29546: Set 'path' on ImportError for ``from ... import ...`` (GH-91)Matthias Bussonnier2017-02-151-2/+10
|
* bpo-29524: Add Objects/call.c file (#12)Victor Stinner2017-02-121-239/+3
| | | | | | | | | * Move all functions to call objects in a new Objects/call.c file. * Rename fast_function() to _PyFunction_FastCallKeywords(). * Copy null_error() from Objects/abstract.c * Inline type_error() in call.c to not have to copy it, it was only called once. * Export _PyEval_EvalCodeWithName() since it is now called from call.c.
* Backed out changeset f23fa1f7b68fVictor Stinner2017-02-101-3/+239
| | | | | Sorry, I didn't want to push this change before the review :-( I was pushing a change into the 2.7 branch.
* Issue #29465: Add Objects/call.c fileVictor Stinner2017-02-101-239/+3
| | | | | | | | | | * Move all functions to call objects in a new Objects/call.c file. * Rename fast_function() to _PyFunction_FastCallKeywords(). * Copy null_error() from Objects/abstract.c * Inline type_error() in call.c to not have to copy it, it was only called once. * Export _PyEval_EvalCodeWithName() since it is now called from call.c.
* Issue #29263: LOAD_METHOD support for C methodsINADA Naoki2017-02-021-6/+6
| | | | Calling builtin method is at most 10% faster.
* Document that _PyFunction_FastCallDict() must copy kwargsVictor Stinner2017-02-011-0/+2
| | | | | Issue #29318: Caller and callee functions must not share the dictionary: kwargs must be copied.
* Rephrase !PyErr_Occurred() comment: may=>canVictor Stinner2017-01-181-2/+2
| | | | Issue #29259.
* Issue #26110: Add document for LOAD_METHOD and CALL_METHOD opcode.INADA Naoki2017-01-161-40/+32
| | | | Changed stack layout bit for "easy to explain."
* _PyEval_EvalCodeWithName(): remove redundant checkVictor Stinner2017-01-111-1/+2
| | | | Replace the runtime check with an assertion (just in case).
* Inline call_function()Victor Stinner2017-01-101-2/+4
| | | | | | | | | | | | | Issue #29227: Inline call_function() into _PyEval_EvalFrameDefault() using Py_LOCAL_INLINE to reduce the stack consumption. It reduces the stack consumption, bytes per call, before => after: test_python_call: 1152 => 1040 (-112 B) test_python_getitem: 1008 => 976 (-32 B) test_python_iterator: 1232 => 1120 (-112 B) => total: 3392 => 3136 (- 256 B)
* Optimize _PyFunction_FastCallDict() when kwargs is {}Victor Stinner2017-01-031-3/+5
| | | | | Issue #28839: Optimize _PyFunction_FastCallDict() when kwargs is an empty dictionary, avoid the creation of an useless empty tuple.
* Issue #29049: Remove unnecessary Py_DECREFINADA Naoki2016-12-261-1/+1
|
* Issue #29049: Fix refleak introduced by f5eb0c4f5d37.INADA Naoki2016-12-261-1/+4
|
* Issue #29049: Call _PyObject_GC_TRACK() lazily when calling Python function.INADA Naoki2016-12-241-10/+21
| | | | Calling function is up to 5% faster.
* Issue #18896: Python function can now have more than 255 parameters.Serhiy Storchaka2016-12-161-1/+1
| | | | collections.namedtuple() now supports tuples with more than 255 elements.
* Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of ↵Serhiy Storchaka2016-12-161-2/+2
| | | | dict.
* Issue #26110: Add LOAD_METHOD/CALL_METHOD opcodes.Yury Selivanov2016-12-141-0/+97
| | | | | | | Special thanks to INADA Naoki for pushing the patch through the last mile, Serhiy Storchaka for reviewing the code, and to Victor Stinner for suggesting the idea (originally implemented in the PyPy project).
* Backed out changeset 99c34e47348bVictor Stinner2016-12-091-2/+2
| | | | The change broke test_gdb.
* 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
| | |