mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
GH-116596: Better determination of escaping uops. (GH-116597)
This commit is contained in:
parent
6c4fc209e1
commit
b6ae6da1bd
5 changed files with 47 additions and 30 deletions
|
|
@ -335,6 +335,7 @@ def is_infallible(op: parser.InstDef) -> bool:
|
|||
"_PyDictOrValues_IsValues",
|
||||
"_PyObject_DictOrValuesPointer",
|
||||
"_PyDictOrValues_GetValues",
|
||||
"_PyDictValues_AddToInsertionOrder",
|
||||
"_PyObject_MakeInstanceAttributesFromDict",
|
||||
"Py_DECREF",
|
||||
"_Py_DECREF_SPECIALIZED",
|
||||
|
|
@ -355,8 +356,10 @@ def is_infallible(op: parser.InstDef) -> bool:
|
|||
"_PyLong_IsCompact",
|
||||
"_PyLong_IsNonNegativeCompact",
|
||||
"_PyLong_CompactValue",
|
||||
"_PyLong_DigitCount",
|
||||
"_Py_NewRef",
|
||||
"_Py_IsImmortal",
|
||||
"PyLong_FromLong",
|
||||
"_Py_STR",
|
||||
"_PyLong_Add",
|
||||
"_PyLong_Multiply",
|
||||
|
|
@ -368,6 +371,17 @@ def is_infallible(op: parser.InstDef) -> bool:
|
|||
"_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 @@ def is_infallible(op: parser.InstDef) -> bool:
|
|||
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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue