Skip to content
Merged
Show file tree
Hide file tree
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
Clean up some commnts
  • Loading branch information
brandtbucher committed Jun 23, 2023
commit c2d4a33f51c200f3c70c3b4f84fd808ecd122b3b
9 changes: 3 additions & 6 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ dummy_func(
}

inst(TO_BOOL_BOOL, (unused/1, unused/2, value -- value)) {
// Coolest (and dumbest-named) specialization ever:
DEOPT_IF(!PyBool_Check(value), TO_BOOL);
STAT_INC(TO_BOOL, hit);
}
Expand All @@ -342,8 +341,7 @@ dummy_func(
}

inst(TO_BOOL_NONE, (unused/1, unused/2, value -- res)) {
// This one is a bit weird, because we expect *some* failures...
// it might be worth combining with TO_BOOL_ALWAYS_TRUE somehow:
// This one is a bit weird, because we expect *some* failures:
DEOPT_IF(!Py_IsNone(value), TO_BOOL);
STAT_INC(TO_BOOL, hit);
res = Py_False;
Expand All @@ -352,7 +350,7 @@ dummy_func(
inst(TO_BOOL_STR, (unused/1, unused/2, value -- res)) {
DEOPT_IF(!PyUnicode_CheckExact(value), TO_BOOL);
STAT_INC(TO_BOOL, hit);
if (Py_Is(value, &_Py_STR(empty))) {
if (value == &_Py_STR(empty)) {
assert(_Py_IsImmortal(value));
res = Py_False;
}
Expand All @@ -364,8 +362,7 @@ dummy_func(
}

inst(TO_BOOL_ALWAYS_TRUE, (unused/1, version/2, value -- res)) {
// This one is a bit weird, because we expect *some* failures...
// it might be worth combining with TO_BOOL_NONE somehow:
// This one is a bit weird, because we expect *some* failures:
assert(version);
DEOPT_IF(Py_TYPE(value)->tp_version_tag != version, TO_BOOL);
STAT_INC(TO_BOOL, hit);
Expand Down
Loading