mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
GH-131798: JIT: Split CALL_TYPE_1 into several uops (GH-132419)
This commit is contained in:
parent
87b1ea016b
commit
a6a3dbb7db
10 changed files with 348 additions and 216 deletions
|
@ -3966,20 +3966,35 @@ dummy_func(
|
|||
_SAVE_RETURN_OFFSET +
|
||||
_PUSH_FRAME;
|
||||
|
||||
inst(CALL_TYPE_1, (unused/1, unused/2, callable, null, arg -- res)) {
|
||||
op(_GUARD_NOS_NULL, (null, unused -- null, unused)) {
|
||||
DEOPT_IF(!PyStackRef_IsNull(null));
|
||||
}
|
||||
|
||||
op(_GUARD_CALLABLE_TYPE_1, (callable, unused, unused -- callable, unused, unused)) {
|
||||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
|
||||
DEOPT_IF(callable_o != (PyObject *)&PyType_Type);
|
||||
}
|
||||
|
||||
op(_CALL_TYPE_1, (callable, null, arg -- res)) {
|
||||
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
|
||||
|
||||
assert(oparg == 1);
|
||||
DEOPT_IF(!PyStackRef_IsNull(null));
|
||||
DEAD(null);
|
||||
DEOPT_IF(callable_o != (PyObject *)&PyType_Type);
|
||||
DEAD(callable);
|
||||
(void)callable; // Silence compiler warnings about unused variables
|
||||
(void)null;
|
||||
STAT_INC(CALL, hit);
|
||||
res = PyStackRef_FromPyObjectNew(Py_TYPE(arg_o));
|
||||
PyStackRef_CLOSE(arg);
|
||||
}
|
||||
|
||||
macro(CALL_TYPE_1) =
|
||||
unused/1 +
|
||||
unused/2 +
|
||||
_GUARD_NOS_NULL +
|
||||
_GUARD_CALLABLE_TYPE_1 +
|
||||
_CALL_TYPE_1;
|
||||
|
||||
op(_CALL_STR_1, (callable, null, arg -- res)) {
|
||||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable);
|
||||
PyObject *arg_o = PyStackRef_AsPyObjectBorrow(arg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue