mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +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
|
|
@ -672,6 +672,16 @@ dummy_func(void) {
|
|||
sym_set_type(callable, &PyFunction_Type);
|
||||
}
|
||||
|
||||
op(_CHECK_METHOD_VERSION, (func_version/2, callable, null, unused[oparg] -- callable, null, unused[oparg])) {
|
||||
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);
|
||||
}
|
||||
|
||||
op(_CHECK_FUNCTION_EXACT_ARGS, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
|
||||
assert(sym_matches_type(callable, &PyFunction_Type));
|
||||
if (sym_is_const(ctx, callable)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue