summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary basic block from comprehensions (GH-31263)Brandt Bucher2022-02-141-6/+3
|
* Add pair counts to stats output and summary. (GH-31324)Mark Shannon2022-02-141-5/+11
|
* Include length in stats for UNPACK_SEQUENCE. (GH-31254)Mark Shannon2022-02-142-8/+30
|
* bpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)Petr Viktorin2022-02-111-1/+1
| | | | | * Make PyType_GetModuleByDef public (remove underscore) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-45490: Rename static inline functions (GH-31217)Victor Stinner2022-02-111-1/+1
| | | | | | | | | | | | When a static inline function is wrapped by a macro which casts its arguments to the expected type, there is no need that the function has a different name than the macro. Use the same name for the macro and the function to avoid confusion. Rename _PyUnicode_get_wstr_length() to PyUnicode_WSTR_LENGTH(). Don't rename static inline _Py_NewRef() and _Py_XNewRef() functions, since the C API exports Py_NewRef() and Py_XNewRef() functions as regular functions. The name cannot be reused in this case.
* bpo-45923: Add `RESUME_QUICK` (GH-31244)Brandt Bucher2022-02-103-13/+18
|
* Gather stats for PRECALL_METHOD. (GH-31259)Mark Shannon2022-02-102-2/+14
|
* bpo-46532: Reduce number of memory writes to update call_shape.kwnames. ↵Mark Shannon2022-02-101-7/+15
| | | | (GH-31231)
* Fix sys.getdxp() when configured with --enable-pystats. (GH-31251)Mark Shannon2022-02-101-1/+17
|
* Add stats for PRECALL_FUNCTION. (GH-31250)Mark Shannon2022-02-102-3/+34
|
* bpo-46528: Attempt SWAPs at compile-time (GH-30970)Brandt Bucher2022-02-091-0/+67
|
* bpo-46528: Check PyMem_Malloc for NULL (GH-30998)Brandt Bucher2022-02-091-8/+15
|
* bpo-46072: Output stats as markdown with collapsible sections. (GH-31228)Mark Shannon2022-02-091-189/+197
|
* bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized ↵Eric Snow2022-02-0815-599/+431
| | | | | | | | | | | | | | | | | | | | | | | | | | | | global objects. (gh-30928) We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code. It is still used in a number of non-builtin stdlib modules. The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime. A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings). https://bugs.python.org/issue46541#msg411799 explains the rationale for this change. The core of the change is in: * (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros * Include/internal/pycore_runtime_init.h - added the static initializers for the global strings * Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState * Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings. That check is added to the PR CI config. The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()). This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *. The following are not changed (yet): * stop using _Py_IDENTIFIER() in the stdlib modules * (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API * (maybe) intern the strings during runtime init https://bugs.python.org/issue46541
* bpo-46675: Allow object value arrays and split key dictionaries larger than ↵Mark Shannon2022-02-081-3/+2
| | | | 16 (GH-31191)
* bpo-46072: Merge dxpairs into py_stats. (GH-31197)Mark Shannon2022-02-072-62/+19
|
* bpo-46670: Remove unused macros in the Python directory (GH-31192)Victor Stinner2022-02-074-29/+2
|
* bpo-46670: Remove unused macros in ceval.c (GH-31196)Victor Stinner2022-02-071-7/+2
| | | Remove CHECKEXC() and EXT_POP() macros.
* bpo-46072: Improve LOAD_METHOD stats (GH-31104)Mark Shannon2022-02-071-3/+17
|
* bpo-46670: Test if a macro is defined, not its value (GH-31178)Victor Stinner2022-02-071-1/+1
| | | | | | | | * audioop.c: #ifdef WORDS_BIGENDIAN * ctypes.h: #ifdef USING_MALLOC_CLOSURE_DOT_C * _ctypes/malloc_closure.c: #ifdef HAVE_FFI_CLOSURE_ALLOC and #ifdef USING_APPLE_OS_LIBFFI * pytime.c: #ifdef __APPLE__ * unicodeobject.c: #ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION
* bpo-46608: exclude marshalled-frozen data if deep-freezing to save 300 KB ↵Kumar Aditya2022-02-042-58/+41
| | | | | | | | | | | | | space (GH-31074) This reduces the size of the data segment by **300 KB** of the executable because if the modules are deep-frozen then the marshalled frozen data just wastes space. This was inspired by comment by @gvanrossum in https://github.com/python/cpython/pull/29118#issuecomment-958521863. Note: There is a new option `--deepfreeze-only` in `freeze_modules.py` to change this behavior, it is on be default to save disk space. ```console # du -s ./python before 27892 ./python # du -s ./python after 27524 ./python ``` Automerge-Triggered-By: GH:ericsnowcurrently
* Add miss stats for specialized instructions. (GH-31108)Mark Shannon2022-02-042-27/+35
|
* Collect stats for UNPACK_SEQUENCE. (GH-31105)Mark Shannon2022-02-032-1/+22
|
* Pass reference to func, as well as args, when pushing frame. (GH-31100)Mark Shannon2022-02-033-25/+7
|
* bpo-45885: Add more stats for COMPARE_OP in specialize.c (GH-31040)Dennis Sweeney2022-02-031-2/+47
|
* bpo-45773: Remove invalid peephole optimizations (GH-31066)Brandt Bucher2022-02-031-2/+0
|
* Add specialization stats for FOR_ITER. (GH-31079)Mark Shannon2022-02-022-0/+73
|
* bpo-46072: Add some frame stats. (GH-31060)Mark Shannon2022-02-024-1/+10
|
* bpo-46528: Simplify BUILD_TUPLE/UNPACK_SEQUENCE folding (GH-31039)Brandt Bucher2022-02-011-14/+7
|
* bpo-45953: Preserve backward compatibility on some PyThreadState field ↵Eric Snow2022-02-011-4/+4
| | | | | names. (GH-31038) The gevent project is using the two `PyThreadState` fields I renamed in gh-30590. This PR fixes the names. See #msg412046.
* bpo-46072: Add some object layout and allocation stats (GH-31051)Mark Shannon2022-02-011-0/+12
|
* fFx refleak in isinstance error path (GH-31005)Ken Jin2022-01-291-0/+1
|
* bpo-46072: Add simple stats for Python calls. (GH-30989)Mark Shannon2022-01-282-0/+13
|
* bpo-46329: Split calls into precall and call instructions. (GH-30855)Mark Shannon2022-01-285-331/+540
| | | | | | | | | | | | | | * Add PRECALL_FUNCTION opcode. * Move 'call shape' varaibles into struct. * Replace CALL_NO_KW and CALL_KW with KW_NAMES and CALL instructions. * Specialize for builtin methods taking using the METH_FASTCALL | METH_KEYWORDS protocol. * Allow kwnames for specialized calls to builtin types. * Specialize calls to tuple(arg) and str(arg).
* bpo-40170: Move _Py_GetAllocatedBlocks() to pycore_pymem.h (GH-30943)Victor Stinner2022-01-271-0/+1
| | | | | Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats() declarations to pycore_pymem.h. These functions are related to memory allocators, not to the PyObject structure.
* bpo-46458: emit code for else of a try block immediately after the try body ↵Irit Katriel2022-01-271-6/+7
| | | | (GH-30751)
* bpo-46476: Fix memory leak in code objects generated by deepfreeze (GH-30853)Kumar Aditya2022-01-271-0/+1
| | | Add _Py_Deepfreeze_Fini() and _PyStaticCode_Dealloc() functions.
* bpo-46528: Simplify the VM's stack manipulations (GH-30902)Brandt Bucher2022-01-263-200/+206
|
* Use existing unbound_local_error label in DELETE_FAST opcode (GH-30882)Kumar Aditya2022-01-261-6/+1
|
* bpo-46420: Use NOTRACE_DISPATCH() in specialized opcodes (GH-30652)Dennis Sweeney2022-01-251-26/+43
|
* bpo-43683: Streamline YIELD_VALUE and SEND (GH-30723)Mark Shannon2022-01-243-33/+39
| | | | | | | | * Split YIELD_VALUE into ASYNC_GEN_WRAP; YIELD_VALUE for async generators. * Split SEND into SEND; YIELD_VALUE. * Document new opcodes.
* bpo-46486: Fixed misspelled name DesciptorClassificationKumar Aditya2022-01-231-8/+8
|
* bpo-46417: Clear symtable identifiers at exit (GH-30809)Victor Stinner2022-01-222-2/+19
| | | | | | Add _PySymtable_Fini() function, called by finalize_interp_clear(). Update test_cmd_line.test_showrefcount() to tolerate negative reference count.
* bpo-46417: Clear _io module static objects at exit (GH-30807)Victor Stinner2022-01-221-0/+6
| | | | Add _PyIO_Fini() function, called by finalize_interp_clear(). It clears static objects used by the _io extension module.
* bpo-46417: Clear Unicode static types at exit (GH-30806)Victor Stinner2022-01-221-0/+1
| | | | | | | | | | | Add _PyUnicode_FiniTypes() function, called by finalize_interp_types(). It clears these static types: * EncodingMapType * PyFieldNameIter_Type * PyFormatterIter_Type _PyStaticType_Dealloc() now does nothing if tp_subclasses is not NULL.
* bpo-46417: Factorize _PyExc_InitTypes() code (GH-30804)Victor Stinner2022-01-221-6/+4
| | | | | | | | Add 'static_exceptions' list to factorize code between _PyExc_InitTypes() and _PyBuiltins_AddExceptions(). _PyExc_InitTypes() does nothing if it's not the main interpreter. Sort exceptions in Lib/test/exception_hierarchy.txt.
* bpo-46417: Clear more static types (GH-30796)Victor Stinner2022-01-224-43/+4
| | | | | | | * Move PyContext static types into object.c static_types list. * Rename PyContextTokenMissing_Type to _PyContextTokenMissing_Type and declare it in pycore_context.h. * _PyHamtItems types are no long exported: replace PyAPI_DATA() with extern.
* bpo-46417: Use _PyType_CAST() in Python directory (GH-30769)Victor Stinner2022-01-212-4/+3
|
* bpo-46417: Py_Finalize() clears static types (GH-30743)Victor Stinner2022-01-211-0/+1
| | | | | | | Add _PyTypes_FiniTypes() best-effort function to clear static types: don't deallocate a type if it still has subclasses. remove_subclass() now sets tp_subclasses to NULL when removing the last subclass.
* bpo-46417: Call _PyDebug_PrintTotalRefs() later (GH-30744)Victor Stinner2022-01-211-6/+6
| | | | | | | | "python -X showrefcount" now shows the total reference count after clearing and destroyed the main Python interpreter. Previously, it was shown before. Py_FinalizeEx() now calls _PyDebug_PrintTotalRefs() after finalize_interp_delete().