summaryrefslogtreecommitdiff
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
| | | | | | | * | | | Issue #20185: Convert _warnings.warn() to Argument ClinicVictor Stinner2016-12-092-16/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warn_explicit(): interpret source=None as source=NULL.
| | | | | | | * | | | 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_CallMethodIdObjArgs()Victor Stinner2016-12-093-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() in various modules when the format string was only made of "O" formats, PyObject* arguments. _PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and doesn't have to parse a format string.
| | | | | | | * | | | Use _PyObject_CallMethodIdObjArgs()Victor Stinner2016-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Replace _PyObject_CallMethodId() with _PyObject_CallMethodIdObjArgs() when the format string only use the format 'O' for objects, like "(O)". _PyObject_CallMethodIdObjArgs() avoids the code to parse a format string and avoids the creation of a temporary tuple.
| | | | | | | * | | | Add _Py_VaBuildStack() functionVictor Stinner2016-12-091-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Similar to Py_VaBuildValue(), but work on a C array of PyObject*, instead of creating a tuple.
| | | | | | | * | | | modsupport: replace int with Py_ssize_tVictor Stinner2016-12-091-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915: Py_ssize_t type is better for indexes. The compiler might emit more efficient code for i++. Py_ssize_t is the type of a PyTuple index for example. Replace also "int endchar" with "char endchar".
| | | | | | | * | | | modsupport: replace int with Py_ssize_tVictor Stinner2016-12-091-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28915.
| | | | | | | * | | | Use _PyObject_CallNoArg()Victor Stinner2016-12-063-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-062-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
| | | | | | | * | | | Issue #28858: Remove _PyObject_CallArg1() macroVictor Stinner2016-12-054-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace _PyObject_CallArg1(func, arg) with PyObject_CallFunctionObjArgs(func, arg, NULL) Using the _PyObject_CallArg1() macro increases the usage of the C stack, which was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this issue.
| | | | | | | * | | | Merge #23722 from 3.6Nick Coghlan2016-12-0516-182/+129
| | | | | | | |\ \ \ \
| | | | | | | | * | | | Backed out changeset b9c9691c72c5Victor Stinner2016-12-045-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
| | | | | | | | * | | | Add sys.getandroidapilevel()Victor Stinner2016-12-021-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #28740: Add sys.getandroidapilevel(): return the build time API version of Android as an integer. Function only available on Android.
| | | | | | | | * | | | Replace PyObject_CallFunction() with fastcallVictor Stinner2016-12-013-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace PyObject_CallFunction(func, "O", arg) and PyObject_CallFunction(func, "O", arg, NULL) with _PyObject_CallArg1(func, arg) Replace PyObject_CallFunction(func, NULL) with _PyObject_CallNoArg(func) _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack.
| | | | | | | | * | | | 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-015-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| | | | | | | | * | | | Issue #28823: Simplified compiling with opcode BUILD_MAP_UNPACK.Serhiy Storchaka2016-11-281-5/+2
| | | | | | | | | | | |
| | | | | | | | * | | | call_function(): document PyMethod optimizationVictor Stinner2016-11-281-1/+5
| | | | | | | | | | | |
| | | | | | | | * | | | Remove CALL_PROFILE special buildVictor Stinner2016-11-282-92/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | | | | | | | * | | | Issue #12844: More than 255 arguments can now be passed to a function.Serhiy Storchaka2016-11-281-5/+0
| | | | | | | | | | | |
| | | | | | | | * | | | Merge 3.6Victor Stinner2016-11-241-0/+1
| | | | | | | | |\ \ \ \
| | | | | | | | * \ \ \ \ mergeRaymond Hettinger2016-11-221-1/+3
| | | | | | | | |\ \ \ \ \
| | | | | | | | * \ \ \ \ \ mergeRaymond Hettinger2016-11-211-4/+4
| | | | | | | | |\ \ \ \ \ \
| | | | | | | | * | | | | | | Issue #28748: Private variable _Py_PackageContext is now of type "const char *"Serhiy Storchaka2016-11-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rather of "char *".
| | | | | | | | * | | | | | | Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-203-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions.
| | | | | | | | * | | | | | | Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-2010-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UTF-8 represenatation of Unicode objects.
| | | | | | | | * | | | | | | Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-207-16/+16
| | | | | | | | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
| | | | | | | | * \ \ \ \ \ \ \ Issue #28715: Added error checks for PyUnicode_AsUTF8().Serhiy Storchaka2016-11-202-3/+9
| | | | | | | | |\ \ \ \ \ \ \ \
| | | | | | | | * \ \ \ \ \ \ \ \ Issue #28746: Merge 3.6Xavier de Gaye2016-11-191-1/+1
| | | | | | | | |\ \ \ \ \ \ \ \ \
| | | | | | | | * \ \ \ \ \ \ \ \ \ Issue #28701: Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.Serhiy Storchaka2016-11-164-29/+34
| | | | | | | | |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The latter function is more readable, faster and doesn't raise exceptions. Based on patch by Xiang Zhang.
| | | | | | | | | * \ \ \ \ \ \ \ \ \ Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-167-33/+27
| | | | | | | | | |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| | | | | | | | | * \ \ \ \ \ \ \ \ \ \ Issue #26920: Merge 3.6Xavier de Gaye2016-11-164-29/+34
| | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ Merge 3.6Victor Stinner2016-11-154-29/+34
| | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ Issue #28676: merge from 3.6Ned Deily2016-11-124-29/+34
| | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | * | | | | | | | | | | 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-112-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()
| | | | | | | | | | | | * | | | | | | | | | | Use PyThreadState_GET() in performance critical codeVictor Stinner2016-11-112-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems like _PyThreadState_UncheckedGet() is not inlined as expected, even when using gcc -O3.
| | | | | | | | | | | | * | | | | | | | | | | Merge 3.6 (issue #26182)Yury Selivanov2016-11-082-19/+19
| | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ Fixed possible abort in ceval loop if _PyUnicode_FromId() fails.Serhiy Storchaka2016-11-082-19/+19
| | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every opcode should end with DISPATCH() or goto error.
| | | | | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ Merge 3.6 (issue #27243)Yury Selivanov2016-11-082-19/+19
| | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ Merge from 3.6.Eric V. Smith2016-11-071-4/+5
| | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ \ Issue #28616: merge from 3.6Ned Deily2016-11-041-1/+1
| | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | | | | | * | | | | | | | | | | | | Issue 28128: Print out better error/warning messages for invalid string escapes.Eric V. Smith2016-10-311-5/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | * | | | | | | | | | | | | Issue #28517: Fixed of-by-one error in the peephole optimizer that causedSerhiy Storchaka2016-10-253-3109/+3106
| | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | keeping unreachable code.
| | | | | | | | | | | | | | | * | | | | | | | | | | | | | Issue #28510: Clean up decoding error handlers.Serhiy Storchaka2016-10-231-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since PyUnicodeDecodeError_GetObject() always returns bytes, following PyBytes_AsString() can be replaced with PyBytes_AS_STRING().
| | | | | | | | | | | | | | | * | | | | | | | | | | | | | Issue #28410: Added _PyErr_FormatFromCause() -- the helper for raisingSerhiy Storchaka2016-10-211-0/+41
| | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | new exception with setting current exception as __cause__. _PyErr_FormatFromCause(exception, format, args...) is equivalent to Python raise exception(format % args) from sys.exc_info()[1]
| | | | | | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ Issue #28410: Keep the traceback of original exception in ↵Serhiy Storchaka2016-10-211-1/+4
| | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _PyErr_ChainExceptions().
| | | | | | | | | | | | | | | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ merge 3.6Benjamin Peterson2016-10-201-4/+13
| | | | | | | | | | | | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \