gh-102859: Remove JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP (#102870)

This commit is contained in:
Irit Katriel 2023-03-22 18:10:48 +00:00 committed by GitHub
parent 04adf2df39
commit 3468c768ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 235 additions and 437 deletions

View file

@ -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