mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
GH-131798: Split up and optimize CALL_STR_1 in the JIT (GH-132849)
This commit is contained in:
parent
c7a7aa9a57
commit
0a387b311e
10 changed files with 276 additions and 161 deletions
22
Python/executor_cases.c.h
generated
22
Python/executor_cases.c.h
generated
|
@ -5172,6 +5172,17 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _GUARD_CALLABLE_STR_1: {
|
||||
_PyStackRef callable;
|
||||
callable = stack_pointer[-3];
|
||||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
|
||||
if (callable_o != (PyObject *)&PyUnicode_Type) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case _CALL_STR_1: {
|
||||
_PyStackRef arg;
|
||||
_PyStackRef null;
|
||||
|
@ -5181,21 +5192,14 @@
|
|||
arg = stack_pointer[-1];
|
||||
null = stack_pointer[-2];
|
||||
callable = stack_pointer[-3];
|
||||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
|
||||
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
|
||||
assert(oparg == 1);
|
||||
if (!PyStackRef_IsNull(null)) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
if (callable_o != (PyObject *)&PyUnicode_Type) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
STAT_INC(CALL, hit);
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
PyObject *res_o = PyObject_Str(arg_o);
|
||||
stack_pointer = _PyFrame_GetStackPointer(frame);
|
||||
(void)callable;
|
||||
(void)null;
|
||||
stack_pointer += -3;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue