bpo-46675: Allow object value arrays and split key dictionaries larger than 16 (GH-31191)

This commit is contained in:
Mark Shannon 2022-02-08 11:50:38 +00:00 committed by GitHub
parent 328fe3fd20
commit 25db2b361b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 90 additions and 50 deletions

View file

@ -3536,14 +3536,13 @@ handle_eval_breaker:
PyDictValues *values = *_PyObject_ValuesPointer(owner);
DEOPT_IF(values == NULL, STORE_ATTR);
STAT_INC(STORE_ATTR, hit);
int index = cache0->index;
Py_ssize_t index = cache0->index;
STACK_SHRINK(1);
PyObject *value = POP();
PyObject *old_value = values->values[index];
values->values[index] = value;
if (old_value == NULL) {
assert(index < 16);
values->mv_order = (values->mv_order << 4) | index;
_PyDictValues_AddToInsertionOrder(values, index);
}
else {
Py_DECREF(old_value);