gh-115999: Enable BINARY_SUBSCR_GETITEM for free-threaded build (gh-127737)

This commit is contained in:
Donghee Na 2024-12-19 11:08:17 +09:00 committed by GitHub
parent f802c8bf87
commit 48c70b8f7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 118 additions and 62 deletions

View file

@ -994,7 +994,7 @@ int _PyOpcode_max_stack_effect(int opcode, int oparg, int *effect) {
return 0;
}
case BINARY_SUBSCR: {
*effect = 0;
*effect = 1;
return 0;
}
case BINARY_SUBSCR_DICT: {
@ -1002,7 +1002,7 @@ int _PyOpcode_max_stack_effect(int opcode, int oparg, int *effect) {
return 0;
}
case BINARY_SUBSCR_GETITEM: {
*effect = 0;
*effect = 1;
return 0;
}
case BINARY_SUBSCR_LIST_INT: {

View file

@ -278,6 +278,7 @@ typedef int (*_py_validate_type)(PyTypeObject *);
// and if the validation is passed, it will set the ``tp_version`` as valid
// tp_version_tag from the ``ty``.
extern int _PyType_Validate(PyTypeObject *ty, _py_validate_type validate, unsigned int *tp_version);
extern int _PyType_CacheGetItemForSpecialization(PyHeapTypeObject *ht, PyObject *descriptor, uint32_t tp_version);
#ifdef __cplusplus
}

View file

@ -722,7 +722,7 @@ int _PyUop_num_popped(int opcode, int oparg)
case _BINARY_SUBSCR_CHECK_FUNC:
return 0;
case _BINARY_SUBSCR_INIT_CALL:
return 2;
return 3;
case _LIST_APPEND:
return 1;
case _SET_ADD: