gh-134584: Eliminate redundant refcounting from IS_OP (GH-143171)

Eliminate redundant refcounting from IS_OP
This commit is contained in:
Hai Zhu 2025-12-27 04:30:02 +08:00 committed by GitHub
parent b3f2d80569
commit a1c6308346
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 1061 additions and 919 deletions

View file

@ -2779,10 +2779,14 @@ dummy_func(
// It's always a bool, so we don't care about oparg & 16.
}
inst(IS_OP, (left, right -- b)) {
macro(IS_OP) = _IS_OP + POP_TOP + POP_TOP;
op(_IS_OP, (left, right -- b, l, r)) {
int res = Py_Is(PyStackRef_AsPyObjectBorrow(left), PyStackRef_AsPyObjectBorrow(right)) ^ oparg;
DECREF_INPUTS();
b = res ? PyStackRef_True : PyStackRef_False;
l = left;
r = right;
INPUTS_DEAD();
}
family(CONTAINS_OP, INLINE_CACHE_ENTRIES_CONTAINS_OP) = {