mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
gh-102859: Remove JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP (#102870)
This commit is contained in:
parent
04adf2df39
commit
3468c768ce
15 changed files with 235 additions and 437 deletions
|
@ -1918,56 +1918,6 @@ dummy_func(
|
|||
}
|
||||
}
|
||||
|
||||
inst(JUMP_IF_FALSE_OR_POP, (cond -- cond if (jump))) {
|
||||
bool jump = false;
|
||||
int err;
|
||||
if (Py_IsTrue(cond)) {
|
||||
_Py_DECREF_NO_DEALLOC(cond);
|
||||
}
|
||||
else if (Py_IsFalse(cond)) {
|
||||
JUMPBY(oparg);
|
||||
jump = true;
|
||||
}
|
||||
else {
|
||||
err = PyObject_IsTrue(cond);
|
||||
if (err > 0) {
|
||||
Py_DECREF(cond);
|
||||
}
|
||||
else if (err == 0) {
|
||||
JUMPBY(oparg);
|
||||
jump = true;
|
||||
}
|
||||
else {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inst(JUMP_IF_TRUE_OR_POP, (cond -- cond if (jump))) {
|
||||
bool jump = false;
|
||||
int err;
|
||||
if (Py_IsFalse(cond)) {
|
||||
_Py_DECREF_NO_DEALLOC(cond);
|
||||
}
|
||||
else if (Py_IsTrue(cond)) {
|
||||
JUMPBY(oparg);
|
||||
jump = true;
|
||||
}
|
||||
else {
|
||||
err = PyObject_IsTrue(cond);
|
||||
if (err > 0) {
|
||||
JUMPBY(oparg);
|
||||
jump = true;
|
||||
}
|
||||
else if (err == 0) {
|
||||
Py_DECREF(cond);
|
||||
}
|
||||
else {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inst(JUMP_BACKWARD_NO_INTERRUPT, (--)) {
|
||||
/* This bytecode is used in the `yield from` or `await` loop.
|
||||
* If there is an interrupt, we want it handled in the innermost
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue