]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-146073: Add fitness/exit quality mechanism for JIT trace frontend (GH-148089)
authorHai Zhu <haiizhu@outlook.com>
Fri, 24 Apr 2026 09:37:01 +0000 (17:37 +0800)
committerGitHub <noreply@github.com>
Fri, 24 Apr 2026 09:37:01 +0000 (10:37 +0100)
commit618b726d68ccd7ae933ced615fd384d62a42ac51
treeb1b323f7a48e69af9a0280ec5cc542f10bc1fafc
parent448d7b96c181d13ca7f8977780e85b53b2716294
gh-146073: Add fitness/exit quality mechanism for JIT trace frontend (GH-148089)

* Replaces ad-hoc logic for ending traces with a simple inequality: `fitness < exit_quality`
* Fitness starts high and is reduced for branches, backward edges, calls and trace length
* Exit quality reflect how good a spot that instruction is to end a trace. Closing a loop is very, specializable instructions are very low and the others in between.
Include/cpython/pystats.h
Include/internal/pycore_interp_structs.h
Include/internal/pycore_optimizer.h
Lib/test/test_capi/test_opt.py
Modules/_testinternalcapi/test_cases.c.h
Python/bytecodes.c
Python/generated_cases.c.h
Python/optimizer.c
Python/pystate.c
Python/pystats.c