gh-134584: Eliminate redundant refcounting from _STORE_SUBSCR_DICT (GH-142712)

Co-authored-by: Ken Jin <kenjin4096@gmail.com>
This commit is contained in:
Donghee Na 2025-12-16 01:42:32 +09:00 committed by GitHub
parent 872ab51f32
commit abaaeee6a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 74 additions and 23 deletions

View file

@ -1493,7 +1493,7 @@ _PyOpcode_macro_expansion[256] = {
[STORE_NAME] = { .nuops = 1, .uops = { { _STORE_NAME, OPARG_SIMPLE, 0 } } },
[STORE_SLICE] = { .nuops = 1, .uops = { { _STORE_SLICE, OPARG_SIMPLE, 0 } } },
[STORE_SUBSCR] = { .nuops = 1, .uops = { { _STORE_SUBSCR, OPARG_SIMPLE, 0 } } },
[STORE_SUBSCR_DICT] = { .nuops = 2, .uops = { { _GUARD_NOS_DICT, OPARG_SIMPLE, 0 }, { _STORE_SUBSCR_DICT, OPARG_SIMPLE, 1 } } },
[STORE_SUBSCR_DICT] = { .nuops = 3, .uops = { { _GUARD_NOS_DICT, OPARG_SIMPLE, 0 }, { _STORE_SUBSCR_DICT, OPARG_SIMPLE, 1 }, { _POP_TOP, OPARG_SIMPLE, 1 } } },
[STORE_SUBSCR_LIST_INT] = { .nuops = 5, .uops = { { _GUARD_TOS_INT, OPARG_SIMPLE, 0 }, { _GUARD_NOS_LIST, OPARG_SIMPLE, 0 }, { _STORE_SUBSCR_LIST_INT, OPARG_SIMPLE, 1 }, { _POP_TOP_INT, OPARG_SIMPLE, 1 }, { _POP_TOP, OPARG_SIMPLE, 1 } } },
[SWAP] = { .nuops = 1, .uops = { { _SWAP, OPARG_SIMPLE, 0 } } },
[TO_BOOL] = { .nuops = 1, .uops = { { _TO_BOOL, OPARG_SIMPLE, 2 } } },

View file

@ -1070,7 +1070,7 @@ extern "C" {
#define _STORE_NAME_r10 1263
#define _STORE_SLICE_r30 1264
#define _STORE_SUBSCR_r30 1265
#define _STORE_SUBSCR_DICT_r30 1266
#define _STORE_SUBSCR_DICT_r31 1266
#define _STORE_SUBSCR_LIST_INT_r32 1267
#define _SWAP_r11 1268
#define _SWAP_2_r02 1269

View file

@ -1274,7 +1274,7 @@ const _PyUopCachingInfo _PyUop_Caching[MAX_UOP_ID+1] = {
{ -1, -1, -1 },
{ -1, -1, -1 },
{ -1, -1, -1 },
{ 0, 0, _STORE_SUBSCR_DICT_r30 },
{ 1, 0, _STORE_SUBSCR_DICT_r31 },
},
},
[_DELETE_SUBSCR] = {
@ -3499,7 +3499,7 @@ const uint16_t _PyUop_Uncached[MAX_UOP_REGS_ID+1] = {
[_SET_ADD_r10] = _SET_ADD,
[_STORE_SUBSCR_r30] = _STORE_SUBSCR,
[_STORE_SUBSCR_LIST_INT_r32] = _STORE_SUBSCR_LIST_INT,
[_STORE_SUBSCR_DICT_r30] = _STORE_SUBSCR_DICT,
[_STORE_SUBSCR_DICT_r31] = _STORE_SUBSCR_DICT,
[_DELETE_SUBSCR_r20] = _DELETE_SUBSCR,
[_CALL_INTRINSIC_1_r11] = _CALL_INTRINSIC_1,
[_CALL_INTRINSIC_2_r21] = _CALL_INTRINSIC_2,
@ -4873,7 +4873,7 @@ const char *const _PyOpcode_uop_name[MAX_UOP_REGS_ID+1] = {
[_STORE_SUBSCR] = "_STORE_SUBSCR",
[_STORE_SUBSCR_r30] = "_STORE_SUBSCR_r30",
[_STORE_SUBSCR_DICT] = "_STORE_SUBSCR_DICT",
[_STORE_SUBSCR_DICT_r30] = "_STORE_SUBSCR_DICT_r30",
[_STORE_SUBSCR_DICT_r31] = "_STORE_SUBSCR_DICT_r31",
[_STORE_SUBSCR_LIST_INT] = "_STORE_SUBSCR_LIST_INT",
[_STORE_SUBSCR_LIST_INT_r32] = "_STORE_SUBSCR_LIST_INT_r32",
[_SWAP] = "_SWAP",