mirror of
https://github.com/python/cpython.git
synced 2026-04-20 02:40:59 +00:00
gh-131798: JIT: Optimize _CHECK_IS_NOT_PY_CALLABLE_EX and _CHECK_IS_NOT_PY_CALLABLE_KW (GH-148494)
This commit is contained in:
parent
88e378cc1c
commit
afaf58b573
3 changed files with 55 additions and 0 deletions
|
|
@ -1320,6 +1320,20 @@ dummy_func(void) {
|
|||
}
|
||||
}
|
||||
|
||||
op(_CHECK_IS_NOT_PY_CALLABLE_EX, (func_st, unused, unused, unused -- func_st, unused, unused, unused)) {
|
||||
PyTypeObject *type = sym_get_type(func_st);
|
||||
if (type && type != &PyFunction_Type) {
|
||||
ADD_OP(_NOP, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
op(_CHECK_IS_NOT_PY_CALLABLE_KW, (callable, unused, unused[oparg], unused -- callable, unused, unused[oparg], unused)) {
|
||||
PyTypeObject *type = sym_get_type(callable);
|
||||
if (type && type != &PyFunction_Type && type != &PyMethod_Type) {
|
||||
ADD_OP(_NOP, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
op(_PUSH_FRAME, (new_frame -- )) {
|
||||
SYNC_SP();
|
||||
if (!CURRENT_FRAME_IS_INIT_SHIM()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue