gh-135474: Specialize arithmetic only on compact ints (GH-135479)

Specialize arithmetic only on compact ints. This also makes int operations non-escaping in the JIT and in tier 1.
This commit is contained in:
Ken Jin 2025-06-14 17:13:32 +08:00 committed by GitHub
parent c8319a3fea
commit 7b15873ed0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 81 additions and 155 deletions

View file

@ -635,6 +635,10 @@ NON_ESCAPING_FUNCTIONS = (
"_PyLong_IsNegative",
"_PyLong_IsNonNegativeCompact",
"_PyLong_IsZero",
"_PyLong_BothAreCompact",
"_PyCompactLong_Add",
"_PyCompactLong_Multiply",
"_PyCompactLong_Subtract",
"_PyManagedDictPointer_IsValues",
"_PyObject_GC_IS_SHARED",
"_PyObject_GC_IS_TRACKED",