summaryrefslogtreecommitdiffstats
path: root/Tools/cases_generator
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-03-11 13:37:48 (GMT)
committerGitHub <noreply@github.com>2024-03-11 13:37:48 (GMT)
commitb6ae6da1bd987506b599a30e37fb452f909b5cbe (patch)
treee7f37b0435ca1a5d314e2f6184ec1386d8c2bc52 /Tools/cases_generator
parent6c4fc209e1941958164509204cdc3505130c1820 (diff)
downloadcpython-b6ae6da1bd987506b599a30e37fb452f909b5cbe.zip
cpython-b6ae6da1bd987506b599a30e37fb452f909b5cbe.tar.gz
cpython-b6ae6da1bd987506b599a30e37fb452f909b5cbe.tar.bz2
GH-116596: Better determination of escaping uops. (GH-116597)
Diffstat (limited to 'Tools/cases_generator')
-rw-r--r--Tools/cases_generator/analyzer.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tools/cases_generator/analyzer.py b/Tools/cases_generator/analyzer.py
index b0a15e6..27e6ba2 100644
--- a/Tools/cases_generator/analyzer.py
+++ b/Tools/cases_generator/analyzer.py
@@ -335,6 +335,7 @@ NON_ESCAPING_FUNCTIONS = (
"_PyDictOrValues_IsValues",
"_PyObject_DictOrValuesPointer",
"_PyDictOrValues_GetValues",
+ "_PyDictValues_AddToInsertionOrder",
"_PyObject_MakeInstanceAttributesFromDict",
"Py_DECREF",
"_Py_DECREF_SPECIALIZED",
@@ -355,8 +356,10 @@ NON_ESCAPING_FUNCTIONS = (
"_PyLong_IsCompact",
"_PyLong_IsNonNegativeCompact",
"_PyLong_CompactValue",
+ "_PyLong_DigitCount",
"_Py_NewRef",
"_Py_IsImmortal",
+ "PyLong_FromLong",
"_Py_STR",
"_PyLong_Add",
"_PyLong_Multiply",
@@ -368,6 +371,17 @@ NON_ESCAPING_FUNCTIONS = (
"_Py_atomic_load_uintptr_relaxed",
"_PyFrame_GetCode",
"_PyThreadState_HasStackSpace",
+ "_PyUnicode_Equal",
+ "_PyFrame_SetStackPointer",
+ "_PyType_HasFeature",
+ "PyUnicode_Concat",
+ "_PyList_FromArraySteal",
+ "_PyTuple_FromArraySteal",
+ "PySlice_New",
+ "_Py_LeaveRecursiveCallPy",
+ "CALL_STAT_INC",
+ "maybe_lltrace_resume_frame",
+ "_PyUnicode_JoinArray",
)
ESCAPING_FUNCTIONS = (
@@ -379,6 +393,8 @@ ESCAPING_FUNCTIONS = (
def makes_escaping_api_call(instr: parser.InstDef) -> bool:
if "CALL_INTRINSIC" in instr.name:
return True
+ if instr.name == "_BINARY_OP":
+ return True
tkns = iter(instr.tokens)
for tkn in tkns:
if tkn.kind != lexer.IDENTIFIER: