mirror of
https://github.com/python/cpython.git
synced 2025-08-24 18:55:00 +00:00
GH-106529: Define POP_JUMP_IF_NONE in terms of POP_JUMP_IF_TRUE (GH-106599)
This commit is contained in:
parent
1f2921b72c
commit
c0c041a31b
4 changed files with 283 additions and 237 deletions
|
@ -2282,21 +2282,19 @@ dummy_func(
|
|||
JUMPBY(oparg * Py_IsTrue(cond));
|
||||
}
|
||||
|
||||
inst(POP_JUMP_IF_NOT_NONE, (value -- )) {
|
||||
if (!Py_IsNone(value)) {
|
||||
op(IS_NONE, (value -- b)) {
|
||||
if (Py_IsNone(value)) {
|
||||
b = Py_True;
|
||||
}
|
||||
else {
|
||||
b = Py_False;
|
||||
DECREF_INPUTS();
|
||||
JUMPBY(oparg);
|
||||
}
|
||||
}
|
||||
|
||||
inst(POP_JUMP_IF_NONE, (value -- )) {
|
||||
if (Py_IsNone(value)) {
|
||||
JUMPBY(oparg);
|
||||
}
|
||||
else {
|
||||
DECREF_INPUTS();
|
||||
}
|
||||
}
|
||||
macro(POP_JUMP_IF_NONE) = IS_NONE + POP_JUMP_IF_TRUE;
|
||||
|
||||
macro(POP_JUMP_IF_NOT_NONE) = IS_NONE + POP_JUMP_IF_FALSE;
|
||||
|
||||
inst(JUMP_BACKWARD_NO_INTERRUPT, (--)) {
|
||||
/* This bytecode is used in the `yield from` or `await` loop.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue