gh-134584: Eliminate redundant refcounting from _CALL_STR_1 (GH-136070)

Signed-off-by: Manjusaka <me@manjusaka.me>
This commit is contained in:
Nadeshiko Manju 2025-12-14 17:33:05 +08:00 committed by GitHub
parent d3ef5ba34d
commit a154c9ed4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 58 additions and 43 deletions

View file

@ -2855,6 +2855,7 @@
case _CALL_STR_1: {
JitOptRef arg;
JitOptRef res;
JitOptRef a;
arg = stack_pointer[-1];
if (sym_matches_type(arg, &PyUnicode_Type)) {
res = PyJitRef_StripReferenceInfo(arg);
@ -2862,9 +2863,11 @@
else {
res = sym_new_type(ctx, &PyUnicode_Type);
}
CHECK_STACK_BOUNDS(-2);
a = arg;
CHECK_STACK_BOUNDS(-1);
stack_pointer[-3] = res;
stack_pointer += -2;
stack_pointer[-2] = a;
stack_pointer += -1;
ASSERT_WITHIN_STACK_BOUNDS(__FILE__, __LINE__);
break;
}