summaryrefslogtreecommitdiffstats
path: root/Tools
Commit message (Collapse)AuthorAgeFilesLines
* GH-100026: Include the number of raw input files in summarize_stats.py ↵Michael Droettboom2022-12-061-0/+4
| | | | (GH-100027)
* gh-99741: Implement Multi-Phase Init for the _xxsubinterpreters Module ↵Eric Snow2022-12-051-7/+0
| | | | | | | (gh-99742) _xxsubinterpreters is an internal module used for testing. https://github.com/python/cpython/issues/99741
* GH-98831: Support cache effects in super- and macro instructions (#99601)Guido van Rossum2022-12-033-270/+480
|
* GH-99905: Fix output of misses in summarize_stats.py execution counts (GH-99906)Michael Droettboom2022-11-301-3/+3
| | | This was an indentation error introduced in 2844aa6a
* gh-64490: Fix bugs in argument clinic varargs processing (#32092)colorfulappl2022-11-241-5/+6
|
* gh-99240: Fix double-free bug in Argument Clinic str_converter generated ↵colorfulappl2022-11-241-2/+23
| | | | | | | | code (GH-99241) Fix double-free bug mentioned at https://github.com/python/cpython/issues/99240, by moving memory clean up out of "exit" label. Automerge-Triggered-By: GH:erlend-aasland
* gh-64490: Fix refcount error when arguments are packed to tuple in argument ↵colorfulappl2022-11-241-1/+1
| | | | clinic (#99233)
* GH-98831: Add `macro` and `op` and their implementation to DSL (#99495)Guido van Rossum2022-11-234-73/+246
| | | | | | | | | | | | | | Newly supported interpreter definition syntax: - `op(NAME, (input_stack_effects -- output_stack_effects)) { ... }` - `macro(NAME) = OP1 + OP2;` Also some other random improvements: - Convert `WITH_EXCEPT_START` to use stack effects - Fix lexer to balk at unrecognized characters, e.g. `@` - Fix moved output names; support object pointers in cache - Introduce `error()` method to print errors - Introduce read_uint16(p) as equivalent to `*p` Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* gh-96002: Add functional test for Argument Clinic (#96178)colorfulappl2022-11-211-0/+1
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* GH-98831: Refactor and fix cases generator (#99526)Guido van Rossum2022-11-184-241/+344
| | | | Also complete cache effects for BINARY_SUBSCR family.
* gh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497)Eric Snow2022-11-161-3/+0
| | | | | We also move the global func version. https://github.com/python/cpython/issues/81057
* gh-81057: Move contextvars-related Globals to _PyRuntimeState (gh-99400)Eric Snow2022-11-162-8/+3
| | | | | This is part of the effort to consolidate global variables, to make them easier to manage (and make it easier to later move some of them to PyInterpreterState). https://github.com/python/cpython/issues/81057
* gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)Eric Snow2022-11-162-68/+96
| | | https://github.com/python/cpython/issues/81057
* GH-98831: Implement basic cache effects (#99313)Guido van Rossum2022-11-162-72/+154
|
* gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496)Eric Snow2022-11-152-101/+108
| | | | | This is the first of several changes to consolidate non-object globals in core code. https://github.com/python/cpython/issues/81057
* gh-81057: Move the Remaining Import State Globals to _PyRuntimeState (gh-99488)Eric Snow2022-11-141-6/+0
| | | https://github.com/python/cpython/issues/81057
* gh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (gh-99487)Eric Snow2022-11-142-29/+5
| | | | | This moves nearly all remaining object-holding globals in core code (other than static types). https://github.com/python/cpython/issues/81057
* gh-81057: Move PyImport_Inittab to _PyRuntimeState (gh-99402)Eric Snow2022-11-122-2/+2
| | | | | We actually don't move PyImport_Inittab. Instead, we make a copy that we keep on _PyRuntimeState and use only that after Py_Initialize(). We also prevent folks from modifying PyImport_Inittab (the best we can) after that point. https://github.com/python/cpython/issues/81057
* gh-81057: Move the Allocators to _PyRuntimeState (gh-99217)Eric Snow2022-11-111-14/+1
| | | | | The global allocators were stored in 3 static global variables: _PyMem_Raw, _PyMem, and _PyObject. State for the "small block" allocator was stored in another 13. That makes a total of 16 global variables. We are moving all 16 to the _PyRuntimeState struct as part of the work for gh-81057. (If PEP 684 is accepted then we will follow up by moving them all to PyInterpreterState.) https://github.com/python/cpython/issues/81057
* gh-81057: Add PyInterpreterState.static_objects (gh-99397)Eric Snow2022-11-111-2/+4
| | | | | As we consolidate global variables, we find some objects that are almost suitable to add to _PyRuntimeState.global_objects, but have some small/sneaky bit of per-interpreter state (e.g. a weakref list). We're adding PyInterpreterState.static_objects so we can move such objects there. (We'll removed the _not_used field once we've added others.) https://github.com/python/cpython/issues/81057
* gh-81057: Move the Extension Modules Cache to _PyRuntimeState (gh-99355)Eric Snow2022-11-111-2/+0
| | | | | We also move the closely related max_module_number and add comments documenting the group of struct members. https://github.com/python/cpython/issues/81057
* gh-81057: Generate a Separate Initializer For Each Part of the Global ↵Eric Snow2022-11-111-48/+49
| | | | | | | Objects Initializer (gh-99389) Up until now we had a single generated initializer macro for all the statically declared global objects in _PyRuntimeState, including several one-offs (e.g. the empty tuple). The one-offs don't need to be generated, but were because we had one big initializer. Having separate initializers for set of generated global objects allows us to generate only the ones we need to. This allows us to add initializers for one-off global objects without having to generate them. https://github.com/python/cpython/issues/81057
* Fix typo in Tools/wasm/README.md (GH-99384)Ikko Ashimine2022-11-111-1/+1
| | | | | Noticable -> Noticeable Automerge-Triggered-By: GH:AlexWaygood
* Update github CI to use OpenSSL 1.1.1s and 3.0.7. (#99364)Gregory P. Smith2022-11-111-2/+2
|
* gh-90110: Update the C-analyzer Tool (gh-99307)Eric Snow2022-11-103-89/+13
|
* gh-99300: Use Py_NewRef() in Parser/ directory (#99330)Victor Stinner2022-11-101-2/+1
| | | | Replace Py_INCREF() with Py_NewRef() in C files of the Parser/ directory and in the PEG generator.
* GH-96421: Insert shim frame on entry to interpreter (GH-96319)Mark Shannon2022-11-101-8/+10
| | | | | | * Adds EXIT_INTERPRETER instruction to exit PyEval_EvalDefault() * Simplifies RETURN_VALUE, YIELD_VALUE and RETURN_GENERATOR instructions as they no longer need to check for entry frames.
* GH-98686: Get rid of "adaptive" and "quick" instructions (GH-99182)Brandt Bucher2022-11-092-2/+3
|
* gh-90868: Add _PyStaticObject_CheckRefcnt() function (#99261)Victor Stinner2022-11-091-5/+2
| | | | | | Add _PyStaticObject_CheckRefcnt() function to make _PyStaticObjects_CheckRefcnt() shorter. Use _PyObject_ASSERT_FAILED_MSG() to log the object causing the fatal error.
* gh-90868: Adjust the Generated Objects (gh-99223)Eric Snow2022-11-081-3/+49
| | | | | | | | | | | We do the following: * move the generated _PyUnicode_InitStaticStrings() to its own file * move the generated _PyStaticObjects_CheckRefcnt() to its own file * include pycore_global_objects.h in extension modules instead of pycore_runtime_init.h These changes help us avoid including things that aren't needed. https://github.com/python/cpython/issues/90868
* gh-98627: Add the _testsinglephase Module (gh-99039)Eric Snow2022-11-082-1/+2
| | | | | This makes it more clear that a given test is definitely testing against a single-phase init (legacy) extension module. The new module is a companion to _testmultiphase. https://github.com/python/cpython/issues/98627
* GH-98831: Simple input-output stack effects for bytecodes.c (#99120)Guido van Rossum2022-11-082-56/+113
|
* gh-72719: Remove asyncore and asynchat modules (#96580)Nikita Sobolev2022-11-081-2/+0
| | | | | Remove modules asyncore and asynchat, which were deprecated by PEP 594. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* GH-98831: Implement super-instruction generation (#99084)Guido van Rossum2022-11-062-14/+66
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* GH-99104: Update headers for bytecodes.c and generate_cases.py (#99112)Guido van Rossum2022-11-051-1/+2
| | | Also tweak the labels near the end of bytecodes.c.
* GH-98831: Auto-generate PREDICTED() macro calls (#99102)Guido van Rossum2022-11-041-0/+7
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* Support comparing two sets of pystats (GH-98816)Michael Droettboom2022-11-041-122/+364
| | | | | | | | | | This adds support for comparing pystats collected from two different builds. - The `--json-output` can be used to load in a set of raw stats and output a JSON file. - Two of these JSON files can be provided on the next run, and then comparative results between the two are output.
* gh-92584: Remove the distutils package (#99061)Victor Stinner2022-11-033-4/+2
| | | | | | | | | | | | Remove the distutils package. It was deprecated in Python 3.10 by PEP 632 "Deprecate distutils module". For projects still using distutils and cannot be updated to something else, the setuptools project can be installed: it still provides distutils. * Remove Lib/distutils/ directory * Remove test_distutils * Remove references to distutils * Skip test_check_c_globals and test_peg_generator since they use distutils
* gh-92584: Remove references to removed _bootsubprocess (#99062)Victor Stinner2022-11-031-1/+0
| | | | The _bootsubprocess module was removed in gh-93939 by commit 81dca70d704d0834d8c30580e648a973250b2973.
* gh-98401: Invalid escape sequences emits SyntaxWarning (#99011)Victor Stinner2022-11-032-2/+2
| | | | | | | | | | | | | | | | | | | | | | A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+\.\d+") now emits a SyntaxWarning ("\d" is an invalid escape sequence), use raw strings for regular expression: re.compile(r"\d+\.\d+"). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. Octal escapes with value larger than 0o377 (ex: "\477"), deprecated in Python 3.11, now produce a SyntaxWarning, instead of DeprecationWarning. In a future Python version they will be eventually a SyntaxError. codecs.escape_decode() and codecs.unicode_escape_decode() are left unchanged: they still emit DeprecationWarning. * The parser only emits SyntaxWarning for Python 3.12 (feature version), and still emits DeprecationWarning on older Python versions. * Fix SyntaxWarning by using raw strings in Tools/c-analyzer/ and wasm_build.py.
* GH-98831: Remove redundant extract_cases.py script (GH-99065)Guido van Rossum2022-11-033-338/+0
| | | Debt I owe from PR GH-98830.
* gh-98948: Remove obsolete readelf dependency (#98949)serge-sans-paille2022-11-032-6/+0
| | | | | This got introduced in commit 5884449539510313c826d69835829c7957c7154a to determine if readline is already linked against curses or tinfo in the setup.py, which is no longer present.
* GH-98831: "Generate" the interpreter (#98830)Guido van Rossum2022-11-037-0/+1079
| | | | | | | | | | | The switch cases (really TARGET(opcode) macros) have been moved from ceval.c to generated_cases.c.h. That file is generated from instruction definitions in bytecodes.c (which impersonates a C file so the C code it contains can be edited without custom support in e.g. VS Code). The code generator lives in Tools/cases_generator (it has a README.md explaining how it works). The DSL used to describe the instructions is a work in progress, described in https://github.com/faster-cpython/ideas/blob/main/3.12/interpreter_definition.md. This is surely a work-in-progress. An easy next step could be auto-generating super-instructions. **IMPORTANT: Merge Conflicts** If you get a merge conflict for instruction implementations in ceval.c, your best bet is to port your changes to bytecodes.c. That file looks almost the same as the original cases, except instead of `TARGET(NAME)` it uses `inst(NAME)`, and the trailing `DISPATCH()` call is omitted (the code generator adds it automatically).
* gh-99016: Make build scripts compatible with Python 3.8 (GH-99017)Serhiy Storchaka2022-11-022-3/+3
|
* GH-98686: Quicken everything (GH-98687)Brandt Bucher2022-11-022-19/+11
|
* gh-90716: add _pylong.py module (#96673)Neil Schemenauer2022-10-261-0/+56
| | | | | | | | | | | | Add Python implementations of certain longobject.c functions. These use asymptotically faster algorithms that can be used for operations on integers with many digits. In those cases, the performance overhead of the Python implementation is not significant since the asymptotic behavior is what dominates runtime. Functions provided by this module should be considered private and not part of any public API. Co-author: Tim Peters <tim.peters@gmail.com> Co-author: Mark Dickinson <dickinsm@gmail.com> Co-author: Bjorn Martinsson
* gh-96143: Move the perf trampoline files to the Python directory (#98675)Pablo Galindo Salgado2022-10-252-8/+8
|
* gh-97669: Create Tools/build/ directory (#97963)Victor Stinner2022-10-1716-23/+41
| | | | | | | | | | | | | | | | | | | | | | | Create Tools/build/ directory. Move the following scripts from Tools/scripts/ to Tools/build/: * check_extension_modules.py * deepfreeze.py * freeze_modules.py * generate_global_objects.py * generate_levenshtein_examples.py * generate_opcode_h.py * generate_re_casefix.py * generate_sre_constants.py * generate_stdlib_module_names.py * generate_token.py * parse_html5_entities.py * smelly.py * stable_abi.py * umarshal.py * update_file.py * verify_ensurepip_wheels.py Update references to these scripts.
* gh-95731: Fix module docstring extraction in pygettext (#95732)Jakub Kuczys2022-10-151-3/+4
|
* gh-97669: Remove Tools/scripts/startuptime.py (#98214)Victor Stinner2022-10-121-22/+0
| | | | | | | | | | The "pyperf command" tool be used instead. Example: $ python3 -m pyperf command -- python3 -c pass ..................... command: Mean +- std dev: 17.8 ms +- 0.4 ms pyperf also computes the standard deviation which gives an idea of the benchmark looks reliable or not.