mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-131798: JIT: replace _CHECK_METHOD_VERSION with _CHECK_FUNCTION_VERSION_INLINE (GH-135022)
Signed-off-by: Manjusaka <me@manjusaka.me> Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
This commit is contained in:
parent
60181f4ed0
commit
667a86e076
4 changed files with 43 additions and 0 deletions
10
Python/optimizer_cases.c.h
generated
10
Python/optimizer_cases.c.h
generated
|
|
@ -1833,6 +1833,16 @@
|
|||
}
|
||||
|
||||
case _CHECK_METHOD_VERSION: {
|
||||
JitOptSymbol *callable;
|
||||
callable = stack_pointer[-2 - oparg];
|
||||
uint32_t func_version = (uint32_t)this_instr->operand0;
|
||||
if (sym_is_const(ctx, callable) && sym_matches_type(callable, &PyMethod_Type)) {
|
||||
PyMethodObject *method = (PyMethodObject *)sym_get_const(ctx, callable);
|
||||
assert(PyMethod_Check(method));
|
||||
REPLACE_OP(this_instr, _CHECK_FUNCTION_VERSION_INLINE, 0, func_version);
|
||||
this_instr->operand1 = (uintptr_t)method->im_func;
|
||||
}
|
||||
sym_set_type(callable, &PyMethod_Type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue