mirror of
https://github.com/python/cpython.git
synced 2026-04-13 23:31:02 +00:00
gh-134584: Eliminate redundant refcounting from _CALL{_BUILTIN_O, _METHOD_DESCRIPTOR_O} (GH-143330)
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
This commit is contained in:
parent
422ca074bc
commit
1fb8e0eb51
9 changed files with 177 additions and 76 deletions
|
|
@ -131,7 +131,7 @@ dummy_func(void) {
|
|||
}
|
||||
|
||||
op(_PUSH_NULL, (-- res)) {
|
||||
res = sym_new_null(ctx);
|
||||
res = PyJitRef_Borrow(sym_new_null(ctx));
|
||||
}
|
||||
|
||||
op(_GUARD_TOS_INT, (value -- value)) {
|
||||
|
|
@ -1064,6 +1064,35 @@ dummy_func(void) {
|
|||
none = sym_new_const(ctx, Py_None);
|
||||
}
|
||||
|
||||
op(_CALL_BUILTIN_O, (callable, self_or_null, args[oparg] -- res, c, s)) {
|
||||
res = sym_new_not_null(ctx);
|
||||
c = callable;
|
||||
if (sym_is_not_null(self_or_null)) {
|
||||
args--;
|
||||
s = args[0];
|
||||
}
|
||||
else if (sym_is_null(self_or_null)) {
|
||||
s = args[0];
|
||||
}
|
||||
else {
|
||||
s = sym_new_unknown(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
op(_CALL_METHOD_DESCRIPTOR_O, (callable, self_or_null, args[oparg] -- res, c, s, a)) {
|
||||
res = sym_new_not_null(ctx);
|
||||
c = callable;
|
||||
if (sym_is_not_null(self_or_null)) {
|
||||
args--;
|
||||
s = args[0];
|
||||
a = args[1];
|
||||
}
|
||||
else {
|
||||
s = sym_new_unknown(ctx);
|
||||
a = sym_new_unknown(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
op(_GUARD_IS_FALSE_POP, (flag -- )) {
|
||||
if (sym_is_const(ctx, flag)) {
|
||||
PyObject *value = sym_get_const(ctx, flag);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue