summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* GH-91719: Make MSVC generate somewhat faster switch code (#91718)Guido van Rossum2022-04-212-1/+79
| | | | | | | | | | | Apparently a switch on an 8-bit quantity where all cases are present generates a more efficient jump (doing only one indexed memory load instead of two). So we make opcode and use_tracing uint8_t, and generate a macro full of extra `case NNN:` lines for all unused opcodes. See https://github.com/faster-cpython/ideas/issues/321#issuecomment-1103263673
* GH-88116: Use a compact format to represent end line and column offsets. ↵Mark Shannon2022-04-212-27/+54
| | | | | | | | | | | | (GH-91666) * Stores all location info in linetable to conform to PEP 626. * Remove column table from code objects. * Remove end-line table from code objects. * Document new location table format
* gh-89653: PEP 670: Convert tuple macros to functions (#91786)Victor Stinner2022-04-212-11/+29
| | | | | | | | | | | | | | Convert macros to static inline functions: * PyTuple_GET_SIZE() * PyTuple_SET_ITEM() * PyList_GET_SIZE() * PyList_SET_ITEM() Add a macro converting arguments to PyTupleObject*, PyListObject* or PyObject* to prevent emitting new compiler warnings. According to PEP 670, PyTuple_GET_ITEM() and PyList_GET_ITEM() are left as macros.
* gh-91782: Define static_assert() macro on FreeBSD (#91787)Victor Stinner2022-04-211-0/+9
| | | | | On FreeBSD, if the static_assert() macro is not defined, define it in Python until <sys/cdefs.h> supports C11: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255290
* gh-89653: PEP 670: Convert PyWeakref_GET_OBJECT() to function (#91785)Victor Stinner2022-04-211-10/+16
| | | | | | Convert the PyWeakref_GET_OBJECT() macro to a static inline function. Add an assertion to check the argument with PyWeakref_Check(). Add a macro converting the argument to PyObject* to prevent emitting new compiler warning.
* gh-89653: PEP 670: Convert unicodeobject.h macros to functions (#91705)Victor Stinner2022-04-211-41/+61
| | | | | | | | | | | | | | | | | | Convert unicodeobject.h macros to static inline functions: * PyUnicode_CHECK_INTERNED() * PyUnicode_DATA(), _PyUnicode_COMPACT_DATA(), _PyUnicode_NONCOMPACT_DATA() * PyUnicode_GET_LENGTH() * PyUnicode_IS_ASCII() * PyUnicode_IS_COMPACT() * PyUnicode_IS_COMPACT_ASCII() * PyUnicode_IS_READY() Reorder functions to declare functions before their first usage. Static inline functions are wrapped by macros which casts arguments with _PyObject_CAST() to prevent introducing new compiler warnings when passing "const PyObject*".
* gh-90667: Add specializations of Py_DECREF when types are known (GH-30872)Dennis Sweeney2022-04-194-8/+39
|
* gh-91576: Speed up iteration of strings (#91574)Kumar Aditya2022-04-181-0/+1
|
* gh-78607: Replace __ltrace__ with __lltrace__ (GH-91619)Dennis Sweeney2022-04-162-2/+2
|
* gh-89770: Implement PEP-678 - Exception notes (GH-31317)Irit Katriel2022-04-163-3/+3
|
* gh-91276: Make JUMP_IF_TRUE_OR_POP/JUMP_IF_FALSE_OR_POP relative (GH-32215)Irit Katriel2022-04-151-1/+1
|
* gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531)Irit Katriel2022-04-152-0/+6
|
* gh-91428: include specialized opcodes in _PyOpcode_OpName (GH-91467)Dennis Sweeney2022-04-141-0/+146
|
* gh-91502: Add a new API to check if a frame is an entry frame (GH-91503)Pablo Galindo Salgado2022-04-131-0/+10
|
* gh-91428: Add _PyOpcode_OpName to opcode.h of debug builds (GH-91430)Dennis Sweeney2022-04-111-0/+115
|
* GH-89480: Document motivation, design and implementation of 3.11 frame ↵Mark Shannon2022-04-111-0/+8
| | | | stack. (GH-32304)
* bpo-45995: add "z" format specifer to coerce negative 0 to zero (GH-30049)John Belmonte2022-04-112-0/+3
| | | | | | | | Add "z" format specifier to coerce negative 0 to zero. See https://github.com/python/cpython/issues/90153 (originally https://bugs.python.org/issue45995) for discussion. This covers `str.format()` and f-strings. Old-style string interpolation is not supported. Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)Irit Katriel2022-04-111-15/+23
|
* Add new PyFrame_GetLasti C-API function (GH-32413)Mark Shannon2022-04-081-0/+1
|
* bpo-47177: Replace `f_lasti` with `prev_instr` (GH-32208)Brandt Bucher2022-04-071-7/+10
|
* bpo-35134: Remove the Include/code.h header file (GH-32385)Victor Stinner2022-04-073-21/+14
| | | | | | Remove the Include/code.h header file. C extensions should only include the main <Python.h> header file. Python.h includes directly Include/cpython/code.h instead.
* bpo-35134: Add Include/cpython/setobject.h header (GH-32384)Victor Stinner2022-04-062-67/+73
|
* bpo-35134: Add Include/cpython/complexobject.h header (GH-32383)Victor Stinner2022-04-062-42/+47
| | | | Move the private _PyComplex_FormatAdvancedWriter() function to the internal C API. This function is no longer exported.
* bpo-26579: Add object.__getstate__(). (GH-2821)Serhiy Storchaka2022-04-061-0/+5
| | | | | | | Copying and pickling instances of subclasses of builtin types bytearray, set, frozenset, collections.OrderedDict, collections.deque, weakref.WeakSet, and datetime.tzinfo now copies and pickles instance attributes implemented as slots.
* Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API ↵Victor Stinner2022-04-065-21/+14
| | | | | | | | | | | (GH-32052)" (GH-32343) * Revert "bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)" This reverts commit f877b40e3f7e0d97878884d80fbec879a85ab7e8. * Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)" This reverts commit b9a5522dd952125a99ff554f01f311cae25f5a91.
* Post 3.11.0a7Pablo Galindo2022-04-051-1/+1
|
* Python 3.11.0a7v3.11.0a7Pablo Galindo2022-04-051-2/+2
|
* bpo-47120: make JUMP_NO_INTERRUPT relative (GH-32221)Irit Katriel2022-04-051-3/+3
|
* bpo-47186: Replace JUMP_IF_NOT_EG_MATCH by CHECK_EG_MATCH + jump (GH-32309)Irit Katriel2022-04-051-36/+36
|
* Revert "bpo-44800: Document internal frame naming conventions (GH-32281)" ↵Mark Shannon2022-04-041-69/+0
| | | | | (#32301) This reverts commit 124227c95f310d2ecd4b567271ab1919fc7000cb.
* bpo-47000: Make `io.text_encoding()` respects UTF-8 mode (GH-32003)Inada Naoki2022-04-042-0/+2
| | | Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* bpo-47176: Interrupt handling for wasm32-emscripten builds without pthreads ↵Hood Chatham2022-04-031-0/+25
| | | | | | (GH-32209) Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Brett Cannon <brett@python.org>
* bpo-44800: Document internal frame naming conventions (GH-32281)Nick Coghlan2022-04-031-0/+69
| | | | | | | | | | The fact interpreter frames were split out from full frame objects rather than always being part of the eval loop implementation means that it's tricky to infer the expected naming conventions simply from looking at the code. Documenting the de facto conventions in pycore_frame.h means future readers of the code will have a clear explanation of the rationale for those conventions (i.e. minimising non-functional code churn).
* bpo-47186: Replace JUMP_IF_NOT_EXC_MATCH by CHECK_EXC_MATCH + jump (GH-32231)Irit Katriel2022-04-011-36/+36
|
* bpo-47009: Streamline list.append for the common case (GH-31864)Dennis Sweeney2022-04-011-0/+18
|
* bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API ↵Victor Stinner2022-04-013-12/+16
| | | | | | | | | | | (GH-32054) Move the private _PyFrameEvalFunction type, and private _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions to the internal C API. The _PyFrameEvalFunction callback function type now uses the _PyInterpreterFrame type which is part of the internal C API. Update the _PyFrameEvalFunction documentation.
* bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)Victor Stinner2022-04-012-2/+5
| | | | | Move the private undocumented _PyEval_EvalFrameDefault() function to the internal C API. The function now uses the _PyInterpreterFrame type which is part of the internal C API.
* bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114)Mark Shannon2022-03-311-0/+5
|
* bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD ↵Irit Katriel2022-03-311-8/+8
| | | | (GH-32115)
* bpo-47164: Add _PyCFunctionObject_CAST() macr (GH-32190)Victor Stinner2022-03-311-6/+11
| | | | | | | | Add _PyCFunctionObject_CAST() and _PyCMethodObject_CAST() macros to make macros casting their argument easier to read, but also to check the type of their input in debug mode: assert(PyCFunction_Check(func) and assert(PyCMethod_Check(func). Reformat also PyCFunction_XXX() macros for readability.
* bpo-47164: Add _PyCFunction_CAST() macro (GH-32192)Victor Stinner2022-03-311-0/+18
| | | Use the macro in C files of the Python/ directory.
* bpo-47164: Add _PyASCIIObject_CAST() macro (GH-32191)Victor Stinner2022-03-312-34/+35
| | | | | | | | | | | | Add macros to cast objects to PyASCIIObject*, PyCompactUnicodeObject* and PyUnicodeObject*: _PyASCIIObject_CAST(), _PyCompactUnicodeObject_CAST() and _PyUnicodeObject_CAST(). Using these new macros make the code more readable and check their argument with: assert(PyUnicode_Check(op)). Remove redundant assert(PyUnicode_Check(op)) in macros using directly or indirectly these new CAST macros. Replacing existing casts with these macros.
* bpo-47162: Add call trampoline to mitigate bad fpcasts on Emscripten (GH-32189)Christian Heimes2022-03-301-0/+27
|
* Merge deoptimization blocks in interpreter (GH-32155)Mark Shannon2022-03-301-0/+2
|
* bpo-47070: Add _PyBytes_Repeat() (GH-31999)Pieter Eendebak2022-03-281-0/+13
| | | Use it where appropriate: the repeat functions of `array.array`, `bytes`, `bytearray`, and `str`.
* bpo-47127: Specialize calls for fastcall c methods with keywords (GH-32125)Kumar Aditya2022-03-271-26/+28
| | | | * add PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS
* bpo-47053: Reduce deoptimization in BINARY_OP_INPLACE_ADD_UNICODE (GH-31318)Dennis Sweeney2022-03-251-1/+1
| | | | | * Don't deopt if refcounts are too big * Detect more at specialization time
* bpo-42197: Don't create `f_locals` dictionary unless we actually need it. ↵Mark Shannon2022-03-252-0/+2
| | | | | | | | | | | (GH-32055) * `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing. (Contributed by Fabio Zadrozny) * Make accesses to a frame's `f_locals` safe from C code, not relying on calls to `PyFrame_FastToLocals` or `PyFrame_LocalsToFast`. * Document new `PyFrame_GetLocals` C-API function.
* bpo-46541: Add a Comment About When to Use _Py_DECLARE_STR(). (gh-32063)Eric Snow2022-03-231-0/+10
| | | | | In a gh-32003 comment, I realized it wasn't very clear how _Py_DECLARE_STR() should be used. This changes adds a comment to clarify. https://bugs.python.org/issue46541
* bpo-47012: speed up iteration of bytes and bytearray (GH-31867)Kumar Aditya2022-03-231-2/+8
|