summaryrefslogtreecommitdiffstats
path: root/Python/specialize.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2022-11-17 19:36:57 (GMT)
committerGitHub <noreply@github.com>2022-11-17 19:36:57 (GMT)
commit8555dee5aeedb2f37ee2e2216ef8707be0fc1d9d (patch)
tree24c7994850152002b8c22a737b875279b5f25e09 /Python/specialize.c
parent6f8b0e781ccd5d17f00f91d1c4eddba4f3e9a8ed (diff)
downloadcpython-8555dee5aeedb2f37ee2e2216ef8707be0fc1d9d.zip
cpython-8555dee5aeedb2f37ee2e2216ef8707be0fc1d9d.tar.gz
cpython-8555dee5aeedb2f37ee2e2216ef8707be0fc1d9d.tar.bz2
GH-98686: Get rid of BINARY_OP_GENERIC and COMPARE_OP_GENERIC (GH-99399)
Diffstat (limited to 'Python/specialize.c')
-rw-r--r--Python/specialize.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/Python/specialize.c b/Python/specialize.c
index f845967..eea9d1c 100644
--- a/Python/specialize.c
+++ b/Python/specialize.c
@@ -1880,16 +1880,6 @@ _Py_Specialize_BinaryOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
goto success;
}
break;
-#ifndef Py_STATS
- default:
- // These operators don't have any available specializations. Rather
- // than repeatedly attempting to specialize them, just convert them
- // back to BINARY_OP (unless we're collecting stats, where it's more
- // important to get accurate hit counts for the unadaptive version
- // and each of the different failure types):
- _Py_SET_OPCODE(*instr, BINARY_OP_GENERIC);
- return;
-#endif
}
SPECIALIZATION_FAIL(BINARY_OP, binary_op_fail_kind(oparg, lhs, rhs));
STAT_INC(BINARY_OP, failure);
@@ -1957,23 +1947,13 @@ _Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
assert(_PyOpcode_Caches[COMPARE_OP] == INLINE_CACHE_ENTRIES_COMPARE_OP);
_PyCompareOpCache *cache = (_PyCompareOpCache *)(instr + 1);
int next_opcode = _Py_OPCODE(instr[INLINE_CACHE_ENTRIES_COMPARE_OP + 1]);
- if (next_opcode != POP_JUMP_IF_FALSE &&
- next_opcode != POP_JUMP_IF_TRUE) {
- // Can't ever combine, so don't don't bother being adaptive (unless
- // we're collecting stats, where it's more important to get accurate hit
- // counts for the unadaptive version and each of the different failure
- // types):
-#ifndef Py_STATS
- _Py_SET_OPCODE(*instr, COMPARE_OP_GENERIC);
- return;
-#else
+ if (next_opcode != POP_JUMP_IF_FALSE && next_opcode != POP_JUMP_IF_TRUE) {
if (next_opcode == EXTENDED_ARG) {
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_EXTENDED_ARG);
goto failure;
}
SPECIALIZATION_FAIL(COMPARE_OP, SPEC_FAIL_COMPARE_OP_NOT_FOLLOWED_BY_COND_JUMP);
goto failure;
-#endif
}
assert(oparg <= Py_GE);
int when_to_jump_mask = compare_masks[oparg];