mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
GH-131798: Split CALL_LIST_APPEND into several uops (GH-134240)
This commit is contained in:
parent
92f85ff3a0
commit
42d03f3933
10 changed files with 370 additions and 259 deletions
35
Python/executor_cases.c.h
generated
35
Python/executor_cases.c.h
generated
|
@ -5276,6 +5276,17 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _GUARD_NOS_NOT_NULL: {
|
||||
_PyStackRef nos;
|
||||
nos = stack_pointer[-2];
|
||||
PyObject *o = PyStackRef_AsPyObjectBorrow(nos);
|
||||
if (o == NULL) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case _GUARD_THIRD_NULL: {
|
||||
_PyStackRef null;
|
||||
null = stack_pointer[-3];
|
||||
|
@ -5920,6 +5931,18 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _GUARD_CALLABLE_LIST_APPEND: {
|
||||
_PyStackRef callable;
|
||||
callable = stack_pointer[-3];
|
||||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
|
||||
PyInterpreterState *interp = tstate->interp;
|
||||
if (callable_o != interp->callable_cache.list_append) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case _CALL_LIST_APPEND: {
|
||||
_PyStackRef arg;
|
||||
_PyStackRef self;
|
||||
|
@ -5929,18 +5952,8 @@
|
|||
self = stack_pointer[-2];
|
||||
callable = stack_pointer[-3];
|
||||
assert(oparg == 1);
|
||||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
|
||||
PyObject *self_o = PyStackRef_AsPyObjectBorrow(self);
|
||||
PyInterpreterState *interp = tstate->interp;
|
||||
if (callable_o != interp->callable_cache.list_append) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
if (self_o == NULL) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
if (!PyList_Check(self_o)) {
|
||||
if (!PyList_CheckExact(self_o)) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue