mirror of
https://github.com/python/cpython.git
synced 2026-04-20 10:51:00 +00:00
gh-gh-131798: optimize LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN in the JIT (#148555)
This commit is contained in:
parent
c88c27b0c1
commit
1aa7e7ee6d
11 changed files with 1353 additions and 1168 deletions
|
|
@ -1016,6 +1016,27 @@ dummy_func(void) {
|
|||
new_frame = PyJitRef_WrapInvalid(f);
|
||||
}
|
||||
|
||||
op(_LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN_FRAME, (func_version/2, getattribute/4, owner -- new_frame)) {
|
||||
PyFunctionObject *func = (PyFunctionObject *)getattribute;
|
||||
if (sym_get_type_version(owner) == 0 ||
|
||||
func->func_version != func_version) {
|
||||
ctx->contradiction = true;
|
||||
ctx->done = true;
|
||||
break;
|
||||
}
|
||||
_Py_BloomFilter_Add(dependencies, func);
|
||||
PyCodeObject *co = (PyCodeObject *)func->func_code;
|
||||
_Py_UOpsAbstractFrame *f = frame_new(ctx, co, NULL, 0);
|
||||
if (f == NULL) {
|
||||
break;
|
||||
}
|
||||
PyObject *name = get_co_name(ctx, oparg >> 1);
|
||||
f->locals[0] = owner;
|
||||
f->locals[1] = sym_new_const(ctx, name);
|
||||
f->func = func;
|
||||
new_frame = PyJitRef_WrapInvalid(f);
|
||||
}
|
||||
|
||||
op(_INIT_CALL_BOUND_METHOD_EXACT_ARGS, (callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) {
|
||||
PyObject *bound_method = sym_get_probable_value(callable);
|
||||
if (bound_method != NULL && Py_TYPE(bound_method) == &PyMethod_Type) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue