gh-134584: Eliminate redundant refcounting from _BINARY_OP_SUBSCR_TUPLE_INT (GH-143094)

This commit is contained in:
Hai Zhu 2025-12-24 05:47:12 +08:00 committed by GitHub
parent cbe0cb779a
commit cc48bf0fde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 65 additions and 34 deletions

View file

@ -836,6 +836,8 @@
JitOptRef sub_st;
JitOptRef tuple_st;
JitOptRef res;
JitOptRef ts;
JitOptRef ss;
sub_st = stack_pointer[-1];
tuple_st = stack_pointer[-2];
assert(sym_matches_type(tuple_st, &PyTuple_Type));
@ -855,9 +857,13 @@
else {
res = sym_new_not_null(ctx);
}
CHECK_STACK_BOUNDS(-1);
ts = tuple_st;
ss = sub_st;
CHECK_STACK_BOUNDS(1);
stack_pointer[-2] = res;
stack_pointer += -1;
stack_pointer[-1] = ts;
stack_pointer[0] = ss;
stack_pointer += 1;
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
break;
}