GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164)

This commit is contained in:
Mark Shannon 2024-07-25 16:24:29 +01:00 committed by GitHub
parent 9bb2e4623f
commit 2e14a52cce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 306 additions and 478 deletions

View file

@ -1882,25 +1882,6 @@ dummy_func(
}
}
inst(BUILD_CONST_KEY_MAP, (values[oparg], keys -- map)) {
PyObject *keys_o = PyStackRef_AsPyObjectBorrow(keys);
assert(PyTuple_CheckExact(keys_o));
assert(PyTuple_GET_SIZE(keys_o) == (Py_ssize_t)oparg);
STACKREFS_TO_PYOBJECTS(values, oparg, values_o);
if (CONVERSION_FAILED(values_o)) {
DECREF_INPUTS();
ERROR_IF(true, error);
}
PyObject *map_o = _PyDict_FromItems(
&PyTuple_GET_ITEM(keys_o, 0), 1,
values_o, 1, oparg);
STACKREFS_TO_PYOBJECTS_CLEANUP(values_o);
DECREF_INPUTS();
ERROR_IF(map_o == NULL, error);
map = PyStackRef_FromPyObjectSteal(map_o);
}
inst(DICT_UPDATE, (dict, unused[oparg - 1], update -- dict, unused[oparg - 1])) {
PyObject *dict_o = PyStackRef_AsPyObjectBorrow(dict);
PyObject *update_o = PyStackRef_AsPyObjectBorrow(update);