summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-91719: Add pycore_opcode.h internal header file (#91906)Victor Stinner2022-04-251-28/+59
| | | | | | | | | | | Move the following API from Include/opcode.h (public C API) to a new Include/internal/pycore_opcode.h header file (internal C API): * EXTRA_CASES * _PyOpcode_Caches * _PyOpcode_Deopt * _PyOpcode_Jump * _PyOpcode_OpName * _PyOpcode_RelativeJump
* gh-91575: Add a script for generating data for case-insensitive matching in ↵Serhiy Storchaka2022-04-221-0/+95
| | | | | re (GH-91660) Also test that all extra cases are in BMP.
* GH-91719: Make MSVC generate somewhat faster switch code (#91718)Guido van Rossum2022-04-211-0/+7
| | | | | | | | | | | 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
* bpo-47169: Export PyOS_CheckStack on Windows (GH-32414)Petr Viktorin2022-04-211-0/+1
|
* GH-88116: Use a compact format to represent end line and column offsets. ↵Mark Shannon2022-04-212-6/+0
| | | | | | | | | | | | (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
* bpo-46712: share more global strings in deepfreeze (gh-32152)Kumar Aditya2022-04-192-14/+9
| | | (for gh-90868)
* gh-91404: Use computed gotos and reduce indirection in re (#91495)Brandt Bucher2022-04-151-2/+18
|
* gh-91428: include specialized opcodes in _PyOpcode_OpName (GH-91467)Dennis Sweeney2022-04-141-8/+21
|
* bpo-47152: Automatically regenerate sre_constants.h (GH-91439)Serhiy Storchaka2022-04-121-0/+62
| | | | | | | * Move the code for generating Modules/_sre/sre_constants.h from Lib/re/_constants.py into a separate script Tools/scripts/generate_sre_constants.py. * Add target `regen-sre` in the makefile. * Make target `regen-all` depending on `regen-sre`.
* gh-91428: Add _PyOpcode_OpName to opcode.h of debug builds (GH-91430)Dennis Sweeney2022-04-111-0/+8
|
* Add feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definition ↵Petr Viktorin2022-04-081-2/+11
| | | | (GH-32365)
* bpo-47115: Document which parts of structs are in limited API/stable ABI ↵Petr Viktorin2022-04-061-2/+21
| | | | | | (GH-32196) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-47146: Stop Depending On regen-deepfreeze For regen-global-objects ↵Eric Snow2022-03-311-1/+0
| | | | | | | | | (gh-32218) This effectively reverts the Makefile change in gh-31637. I've added some notes so it is more clear what is going on. We also update the "Check if generated files are up to date" job to run "make regen-deepfreeze" to ensure "make regen-global-objects" catches deepfreeze.c. https://bugs.python.org/issue47146
* bpo-47146: Avoid Using make Recursively (gh-32206)Eric Snow2022-03-311-1/+6
| | | https://bugs.python.org/issue47146
* bpo-47126: Update to canonical PEP URLs specified by PEP 676 (GH-32124)Hugo van Kemenade2022-03-301-1/+1
|
* bpo-46429: tweak deepfreeze output (#32107)Kumar Aditya2022-03-271-0/+6
|
* bpo-46712: Do not Regen Deep-Frozen Modules before Generating Global Objects ↵Eric Snow2022-03-231-11/+30
| | | | | | | | | (gh-32061) We have to run "make regen-deepfreeze" before running Tools/scripts/generate-global-objects.py; otherwise we will miss any changes to global objects in deep-frozen modules (which aren't committed in the repo). However, building $(PYTHON_FOR_FREEZE) fails if one of its source files had a global object (e.g. via _Py_ID(...)) added or removed, without generate-global-objects.py running first. So "make regen-global-objects" would sometimes fail. We solve this by running generate-global-objects.py before *and* after "make regen-deepfreeze". To speed things up and cut down on noise, we also avoid updating the global objects files if there are no changes to them. https://bugs.python.org/issue46712
* bpo-47084: Clear Unicode cached representations on finalization (GH-32032)Jeremy Kloth2022-03-221-0/+1
|
* bpo-46841: Quicken code in-place (GH-31888)Brandt Bucher2022-03-212-28/+36
| | | | | | | | | | | | | | | | | | | * Moves the bytecode to the end of the corresponding PyCodeObject, and quickens it in-place. * Removes the almost-always-unused co_varnames, co_freevars, and co_cellvars member caches * _PyOpcode_Deopt is a new mapping from all opcodes to their un-quickened forms. * _PyOpcode_InlineCacheEntries is renamed to _PyOpcode_Caches * _Py_IncrementCountAndMaybeQuicken is renamed to _PyCode_Warmup * _Py_Quicken is renamed to _PyCode_Quicken * _co_quickened is renamed to _co_code_adaptive (and is now a read-only memoryview). * Do not emit unused nonzero opargs anymore in the compiler.
* summarize_stats.py: add pairs by opcode (GH-31957)Dennis Sweeney2022-03-181-9/+44
|
* CI: Fix patchcheck (GH-31708)Hugo van Kemenade2022-03-141-0/+2
|
* bpo-46881: Statically allocate and initialize the latin1 characters. (GH-31616)Kumar Aditya2022-03-091-0/+13
|
* Remove trailing spaces (GH-31695)Serhiy Storchaka2022-03-051-2/+2
|
* bpo-46712: Let generate_global_objects.py Run on Earlier Python Versions ↵Eric Snow2022-03-011-1/+1
| | | | | (gh-31637) https://bugs.python.org/issue46712
* bpo-46753: Add the empty tuple to the _PyRuntimeState.global_objects. (gh-31345)Eric Snow2022-02-282-0/+5
| | | https://bugs.python.org/issue46753
* bpo-46841: Move the cache for `LOAD_GLOBAL` inline. (GH-31575)Mark Shannon2022-02-281-8/+9
|
* Propagate errors (however unlikely) from _Py_Deepfreeze_Init() (GH-31596)Kumar Aditya2022-02-261-3/+5
|
* bpo-46712: Share global string identifiers in deepfreeze (GH-31261)Kumar Aditya2022-02-252-6/+13
| | | Where appropriate, deepfreeze.c now uses `&_Py_ID(blah)` references instead of locally defining constants. This saves some space.
* bpo-46841: Use *inline* caching for `BINARY_OP` (GH-31543)Brandt Bucher2022-02-251-1/+8
|
* bpo-46430: Fix memory leak in interned strings of deep-frozen modules (GH-31549)Kumar Aditya2022-02-241-1/+5
|
* Fix reporting of specialization stats. (GH-31503)Mark Shannon2022-02-221-1/+1
|
* Remove pair-counts from specialization stats. (GH-31500)Mark Shannon2022-02-221-2/+5
|
* bpo-46541: Scan Fewer Files in generate_global_objects.py (gh-31364)Eric Snow2022-02-161-15/+19
| | | https://bugs.python.org/issue46541
* bpo-46541: Drop the check for orphaned global strings. (gh-31363)Eric Snow2022-02-161-142/+1
| | | https://bugs.python.org/issue46541
* bpo-46541: Discover the global strings. (gh-31346)Eric Snow2022-02-151-255/+74
| | | | | | | Instead of manually enumerating the global strings in generate_global_objects.py, we extrapolate the list from usage of _Py_ID() and _Py_STR() in the source files. This is partly inspired by gh-31261. https://bugs.python.org/issue46541
* Regen the global objects using PYTHON_FOR_REGEN. (gh-31344)Eric Snow2022-02-141-1/+1
| | | https://bugs.python.org/issue46541
* Add pair counts to stats output and summary. (GH-31324)Mark Shannon2022-02-141-5/+35
|
* Add stats for PRECALL_FUNCTION. (GH-31250)Mark Shannon2022-02-101-0/+2
|
* Right justify numeric columns in stats summary script. (GH-31234)Mark Shannon2022-02-101-8/+17
|
* bpo-46430: Intern strings in deep-frozen modules (GH-30683)Kumar Aditya2022-02-091-0/+1
|
* bpo-46072: Output stats as markdown with collapsible sections. (GH-31228)Mark Shannon2022-02-091-70/+186
|
* bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized ↵Eric Snow2022-02-081-9/+486
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Print summary stats for overall success of specialization. (GH-31211)Mark Shannon2022-02-081-0/+32
|
* bpo-46608: Fix argument parsing in freeze_modules.py (GH-31131)Kumar Aditya2022-02-051-10/+12
|
* bpo-46608: exclude marshalled-frozen data if deep-freezing to save 300 KB ↵Kumar Aditya2022-02-041-16/+22
| | | | | | | | | | | | | 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-041-4/+8
|
* Add specialization stats for FOR_ITER. (GH-31079)Mark Shannon2022-02-021-1/+1
|
* bpo-46072: Add some frame stats. (GH-31060)Mark Shannon2022-02-021-0/+3
|
* bpo-46072: Add some object layout and allocation stats (GH-31051)Mark Shannon2022-02-011-1/+11
|
* bpo-46072: Add simple stats for Python calls. (GH-30989)Mark Shannon2022-01-281-0/+8
|