Visitar URL original
GH-103906: Remove immortal refcounting in the interpreter by brandtbucher · Pull Request #103909 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup
  • Loading branch information
brandtbucher committed Apr 26, 2023
commit fd95518a5b1edea6889ac66842e191168fe69e26
10 changes: 5 additions & 5 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ dummy_func(
ERROR_IF(res == NULL, error);
}

inst(UNARY_NOT, (value -- res)) { // XXX
inst(UNARY_NOT, (value -- res)) {
int err = PyObject_IsTrue(value);
DECREF_INPUTS();
ERROR_IF(err < 0, error);
Expand Down Expand Up @@ -2014,7 +2014,7 @@ dummy_func(
CHECK_EVAL_BREAKER();
}

inst(POP_JUMP_IF_FALSE, (cond -- )) { // XXX
inst(POP_JUMP_IF_FALSE, (cond -- )) {
if (Py_IsFalse(cond)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cause a performance change, since formerly IsTrue then IsFalse, now IsFalse then IsTrue

Though this comparison is lightweight.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I doubt it.

JUMPBY(oparg);
}
Expand All @@ -2030,7 +2030,7 @@ dummy_func(
}
}

inst(POP_JUMP_IF_TRUE, (cond -- )) { // XXX
inst(POP_JUMP_IF_TRUE, (cond -- )) {
if (Py_IsTrue(cond)) {
JUMPBY(oparg);
}
Expand All @@ -2046,14 +2046,14 @@ dummy_func(
}
}

inst(POP_JUMP_IF_NOT_NONE, (value -- )) { // XXX
inst(POP_JUMP_IF_NOT_NONE, (value -- )) {
if (!Py_IsNone(value)) {
DECREF_INPUTS();
JUMPBY(oparg);
}
}

inst(POP_JUMP_IF_NONE, (value -- )) { // XXX
inst(POP_JUMP_IF_NONE, (value -- )) {
if (Py_IsNone(value)) {
JUMPBY(oparg);
}
Expand Down