summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* 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().
* bpo-46417: _curses uses PyStructSequence_NewType() (GH-30736)Victor Stinner2022-01-213-2/+4
| | | | | | | | The _curses module now creates its ncurses_version type as a heap type using PyStructSequence_NewType(), rather than using a static type. * Move _PyStructSequence_FiniType() definition to pycore_structseq.h. * test.pythoninfo: log curses.ncurses_version.
* bpo-46417: Finalize structseq types at exit (GH-30645)Victor Stinner2022-01-214-0/+43
| | | | | | | | | | | | | | | | | | Add _PyStructSequence_FiniType() and _PyStaticType_Dealloc() functions to finalize a structseq static type in Py_Finalize(). Currrently, these functions do nothing if Python is built in release mode. Clear static types: * AsyncGenHooksType: sys.set_asyncgen_hooks() * FlagsType: sys.flags * FloatInfoType: sys.float_info * Hash_InfoType: sys.hash_info * Int_InfoType: sys.int_info * ThreadInfoType: sys.thread_info * UnraisableHookArgsType: sys.unraisablehook * VersionInfoType: sys.version * WindowsVersionType: sys.getwindowsversion()
* bpo-46409: Make generators in bytecode (GH-30633)Mark Shannon2022-01-205-151/+139
| | | | | | | | | | | | * Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes. * Trim frame and generator by word each. * Minor refactor of frame.c * Update test.test_sys to account for smaller frames. * Treat generator functions as normal functions when evaluating and specializing.
* bpo-44024: Improve the TypeError message in getattr and hasattr (GH-25863)Géry Ogam2022-01-181-10/+0
| | | | | | Use common error message for non-string attribute name in the builtin functions getattr and hasattr. The special check no longer needed since Python 3.0.
* bpo-46161: Fix bug in starunpack_helper in compile.c (GH-30235)zq19972022-01-171-1/+4
|
* bpo-46405: fix msvc compiler warnings (GH-30627)Kumar Aditya2022-01-171-1/+1
|
* bpo-45953: Statically initialize all the non-object PyInterpreterState ↵Eric Snow2022-01-142-11/+0
| | | | | fields we can. (gh-30589) https://bugs.python.org/issue45953
* bpo-45953: Statically initialize all the PyThreadState fields we can. (gh-30590)Eric Snow2022-01-142-11/+5
| | | https://bugs.python.org/issue45953
* bpo-46362: Ensure ntpath.abspath() uses the Windows API correctly (GH-30571)neonene2022-01-131-36/+1
| | | This makes ntpath.abspath()/getpath_abspath() follow normpath(), since some WinAPIs such as PathCchSkipRoot() require backslashed paths.
* Statically initialize _PyRuntimeState fields. (gh-30588)Eric Snow2022-01-131-10/+0
| | | https://bugs.python.org/issue45953
* bpo-46370: Move the static initializer for _PyRuntime to its own header ↵Eric Snow2022-01-132-0/+2
| | | | | file. (gh-30587) https://bugs.python.org/issue46370
* bpo-46328: Add sys.exception() (GH-30514)Irit Katriel2022-01-132-2/+48
|
* bpo-46344: Fix trace bug in else of try and try-star blocks (GH-30544)Irit Katriel2022-01-131-2/+0
|
* bpo-46315: Add ifdef HAVE_ feature checks for WASI compatibility (GH-30507)Christian Heimes2022-01-131-1/+4
|
* bpo-45953: Statically allocate the main interpreter (and initial thread ↵Eric Snow2022-01-122-17/+34
| | | | | | | | | state). (gh-29883) Previously, the main interpreter was allocated on the heap during runtime initialization. Here we instead embed it into _PyRuntimeState, which means it is statically allocated as part of the _PyRuntime global. The same goes for the initial thread state (of each interpreter, including the main one). Consequently there are fewer allocations during runtime/interpreter init, fewer possible failures, and better memory locality. FYI, this also helps efforts to consolidate globals, which in turns helps work on subinterpreter isolation. https://bugs.python.org/issue45953
* bpo-46347: Yet another fix in the erorr path of PyEval_EvalCodeEx (#30554)Yury Selivanov2022-01-121-1/+0
|
* bpo-46347: Fix PyEval_EvalCodeEx to correctly cleanup in error paths (#30551)Yury Selivanov2022-01-111-13/+9
|
* bpo-46347: Fix memory leak in PyEval_EvalCodeEx. (#30546)Yury Selivanov2022-01-111-7/+0
| | | First introduced in 0332e569c12d3dc97171546c6dc10e42c27de34b
* bpo-45953: Statically allocate and initialize global bytes objects. (gh-30096)Eric Snow2022-01-111-6/+0
| | | | | The empty bytes object (b'') and the 256 one-character bytes objects were allocated at runtime init. Now we statically allocate and initialize them. https://bugs.python.org/issue45953
* bpo-46331: Do not set line number of instruction storing doc-string. (GH-30518)Mark Shannon2022-01-111-0/+1
|