mirror of
https://github.com/python/cpython.git
synced 2026-04-20 02:40:59 +00:00
gh-131798: Add _CHECK_IS_NOT_PY_CALLABLE to the JIT optimizer (GH-148434)
This commit is contained in:
parent
30c698a655
commit
03d2f035d6
3 changed files with 28 additions and 0 deletions
|
|
@ -1217,6 +1217,13 @@ dummy_func(void) {
|
|||
(void)framesize;
|
||||
}
|
||||
|
||||
op(_CHECK_IS_NOT_PY_CALLABLE, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) {
|
||||
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()) {
|
||||
|
|
|
|||
6
Python/optimizer_cases.c.h
generated
6
Python/optimizer_cases.c.h
generated
|
|
@ -3651,6 +3651,12 @@
|
|||
}
|
||||
|
||||
case _CHECK_IS_NOT_PY_CALLABLE: {
|
||||
JitOptRef callable;
|
||||
callable = stack_pointer[-2 - oparg];
|
||||
PyTypeObject *type = sym_get_type(callable);
|
||||
if (type && type != &PyFunction_Type && type != &PyMethod_Type) {
|
||||
ADD_OP(_NOP, 0, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue