mirror of
https://github.com/python/cpython.git
synced 2025-11-26 21:33:10 +00:00
GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164)
This commit is contained in:
parent
9bb2e4623f
commit
2e14a52cce
16 changed files with 306 additions and 478 deletions
36
Python/generated_cases.c.h
generated
36
Python/generated_cases.c.h
generated
|
|
@ -589,42 +589,6 @@
|
|||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(BUILD_CONST_KEY_MAP) {
|
||||
frame->instr_ptr = next_instr;
|
||||
next_instr += 1;
|
||||
INSTRUCTION_STATS(BUILD_CONST_KEY_MAP);
|
||||
_PyStackRef *values;
|
||||
_PyStackRef keys;
|
||||
_PyStackRef map;
|
||||
keys = stack_pointer[-1];
|
||||
values = &stack_pointer[-1 - oparg];
|
||||
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)) {
|
||||
for (int _i = oparg; --_i >= 0;) {
|
||||
PyStackRef_CLOSE(values[_i]);
|
||||
}
|
||||
PyStackRef_CLOSE(keys);
|
||||
if (true) { stack_pointer += -1 - oparg; goto error; }
|
||||
}
|
||||
PyObject *map_o = _PyDict_FromItems(
|
||||
&PyTuple_GET_ITEM(keys_o, 0), 1,
|
||||
values_o, 1, oparg);
|
||||
STACKREFS_TO_PYOBJECTS_CLEANUP(values_o);
|
||||
for (int _i = oparg; --_i >= 0;) {
|
||||
PyStackRef_CLOSE(values[_i]);
|
||||
}
|
||||
PyStackRef_CLOSE(keys);
|
||||
if (map_o == NULL) { stack_pointer += -1 - oparg; goto error; }
|
||||
map = PyStackRef_FromPyObjectSteal(map_o);
|
||||
stack_pointer[-1 - oparg] = map;
|
||||
stack_pointer += -oparg;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
DISPATCH();
|
||||
}
|
||||
|
||||
TARGET(BUILD_LIST) {
|
||||
frame->instr_ptr = next_instr;
|
||||
next_instr += 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue