]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-104584: Baby steps towards generating and executing traces (#105924)
authorGuido van Rossum <guido@python.org>
Tue, 27 Jun 2023 02:02:57 +0000 (19:02 -0700)
committerGitHub <noreply@github.com>
Tue, 27 Jun 2023 02:02:57 +0000 (19:02 -0700)
commit51fc72511733353de15bc633a3d7b6da366842e4
tree13c7075d57530adf90f82ba0025649f163b51abb
parentd3af83b9342457d8b24476baeb799f7506ff04f3
gh-104584: Baby steps towards generating and executing traces (#105924)

Added a new, experimental, tracing optimizer and interpreter (a.k.a. "tier 2"). This currently pessimizes, so don't use yet -- this is infrastructure so we can experiment with optimizing passes. To enable it, pass ``-Xuops`` or set ``PYTHONUOPS=1``. To get debug output, set ``PYTHONUOPSDEBUG=N`` where ``N`` is a debug level (0-4, where 0 is no debug output and 4 is excessively verbose).

All of this code is likely to change dramatically before the 3.13 feature freeze. But this is a first step.
21 files changed:
.gitattributes
Include/cpython/optimizer.h
Include/internal/pycore_uops.h [new file with mode: 0644]
Include/pystats.h
Makefile.pre.in
Misc/NEWS.d/next/Core and Builtins/2023-06-27-00-58-26.gh-issue-104584.Wu-uXy.rst [new file with mode: 0644]
Modules/_testinternalcapi.c
Python/bytecodes.c
Python/ceval.c
Python/ceval_macros.h
Python/executor_cases.c.h [new file with mode: 0644]
Python/generated_cases.c.h
Python/opcode_metadata.h
Python/optimizer.c
Python/pylifecycle.c
Python/specialize.c
Tools/c-analyzer/cpython/_parser.py
Tools/c-analyzer/cpython/ignored.tsv
Tools/cases_generator/README.md
Tools/cases_generator/generate_cases.py
Tools/cases_generator/test_generator.py