summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorDonghee Na <donghee.na@python.org>2024-11-21 22:52:16 (GMT)
committerGitHub <noreply@github.com>2024-11-21 22:52:16 (GMT)
commit78a530a57800264433d1874a41c91b0939156c03 (patch)
tree93599658400b15d14c46d73f4ff4c58d078cd413 /Python/bytecodes.c
parent09c240f20c47db126ad7e162df41e5c2596962d4 (diff)
downloadcpython-78a530a57800264433d1874a41c91b0939156c03.zip
cpython-78a530a57800264433d1874a41c91b0939156c03.tar.gz
cpython-78a530a57800264433d1874a41c91b0939156c03.tar.bz2
gh-115999: Add free-threaded specialization for ``TO_BOOL`` (gh-126616)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 71b1dc0..6ee886c 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -391,7 +391,7 @@ dummy_func(
};
specializing op(_SPECIALIZE_TO_BOOL, (counter/1, value -- value)) {
- #if ENABLE_SPECIALIZATION
+ #if ENABLE_SPECIALIZATION_FT
if (ADAPTIVE_COUNTER_TRIGGERS(counter)) {
next_instr = this_instr;
_Py_Specialize_ToBool(value, next_instr);
@@ -399,7 +399,7 @@ dummy_func(
}
OPCODE_DEFERRED_INC(TO_BOOL);
ADVANCE_ADAPTIVE_COUNTER(this_instr[1].counter);
- #endif /* ENABLE_SPECIALIZATION */
+ #endif /* ENABLE_SPECIALIZATION_FT */
}
op(_TO_BOOL, (value -- res)) {
@@ -435,7 +435,7 @@ dummy_func(
PyObject *value_o = PyStackRef_AsPyObjectBorrow(value);
EXIT_IF(!PyList_CheckExact(value_o));
STAT_INC(TO_BOOL, hit);
- res = Py_SIZE(value_o) ? PyStackRef_True : PyStackRef_False;
+ res = PyList_GET_SIZE(value_o) ? PyStackRef_True : PyStackRef_False;
DECREF_INPUTS();
}