mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
GH-128914: Remove all but one conditional stack effects (GH-129226)
* Remove all 'if (0)' and 'if (1)' conditional stack effects * Use array instead of conditional for BUILD_SLICE args * Refactor LOAD_GLOBAL to use a common conditional uop * Remove conditional stack effects from LOAD_ATTR specializations * Replace conditional stack effects in LOAD_ATTR with a 0 or 1 sized array. * Remove conditional stack effects from CALL_FUNCTION_EX
This commit is contained in:
parent
8ec76d9034
commit
75b4962157
19 changed files with 518 additions and 758 deletions
|
@ -109,10 +109,14 @@ convert_global_to_const(_PyUOpInstruction *inst, PyObject *obj)
|
|||
return NULL;
|
||||
}
|
||||
if (_Py_IsImmortal(res)) {
|
||||
inst->opcode = (inst->oparg & 1) ? _LOAD_CONST_INLINE_BORROW_WITH_NULL : _LOAD_CONST_INLINE_BORROW;
|
||||
inst->opcode = _LOAD_CONST_INLINE_BORROW;
|
||||
}
|
||||
else {
|
||||
inst->opcode = (inst->oparg & 1) ? _LOAD_CONST_INLINE_WITH_NULL : _LOAD_CONST_INLINE;
|
||||
inst->opcode = _LOAD_CONST_INLINE;
|
||||
}
|
||||
if (inst->oparg & 1) {
|
||||
assert(inst[1].opcode == _PUSH_NULL_CONDITIONAL);
|
||||
assert(inst[1].oparg & 1);
|
||||
}
|
||||
inst->operand0 = (uint64_t)res;
|
||||
return res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue