8000 Remove attempted specialization of COMPARE_OP. · python/cpython@358393d · GitHub
[go: up one dir, main page]

Skip to content

Commit 358393d

Browse files
committed
Remove attempted specialization of COMPARE_OP.
1 parent 482777c commit 358393d

File tree

4 files changed

+1
-31
lines changed

4 files changed

+1
-31
lines changed

Include/internal/pycore_code.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,6 @@ extern void _Py_Specialize_Call(PyObject *callable, _Py_CODEUNIT *instr,
228228
int nargs, PyObject *kwnames);
229229
extern void _Py_Specialize_BinaryOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
230230
int oparg, PyObject **locals);
231-
extern void _Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs,
232-
_Py_CODEUNIT *instr, int oparg);
233231
extern void _Py_Specialize_CompareAndBranch(PyObject *lhs, PyObject *rhs,
234232
_Py_CODEUNIT *instr, int oparg);
235233
extern void _Py_Specialize_UnpackSequence(PyObject *seq, _Py_CODEUNIT *instr,

Python/bytecodes.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1825,15 +1825,7 @@ dummy_func(
18251825
}
18261826

18271827
inst(COMPARE_OP, (unused/1, left, right -- res)) {
1828-
_PyCompareOpCache *cache = (_PyCompareOpCache *)next_instr;
1829-
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
1830-
assert(cframe.use_tracing == 0);
1831-
next_instr--;
1832-
_Py_Specialize_CompareOp(left, right, next_instr, oparg);
1833-
DISPATCH_SAME_OPARG();
1834-
}
18351828
STAT_INC(COMPARE_OP, deferred);
1836-
DECREMENT_ADAPTIVE_COUNTER(cache->counter);
18371829
assert((oparg >> 4) <= Py_GE);
18381830
res = PyObject_RichCompare(left, right, oparg>>4);
18391831
Py_DECREF(left);

Python/generated_cases.c.h

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/specialize.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ print_spec_stats(FILE *out, OpcodeStats *stats)
126126
/* Mark some opcodes as specializable for stats,
127127
* even though we don't specialize them yet. */
128128
fprintf(out, "opcode[%d].specializable : 1\n", BINARY_SLICE);
129+
fprintf(out, "opcode[%d].specializable : 1\n", COMPARE_OP);
129130
fprintf(out, "opcode[%d].specializable : 1\n", STORE_SLICE);
130131
for (int i = 0; i < 256; i++) {
131132
if (_PyOpcode_Caches[i]) {
@@ -1998,19 +1999,6 @@ compare_op_fail_kind(PyObject *lhs, PyObject *rhs)
19981999
}
19992000
#endif
20002001

2001-
void
2002-
_Py_Specialize_CompareOp(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
2003-
int oparg)
2004-
{
2005-
assert(_PyOpcode_Caches[COMPARE_OP] == INLINE_CACHE_ENTRIES_COMPARE_OP);
2006-
_PyCompareOpCache *cache = (_PyCompareOpCache *)(instr + 1);
2007-
SPECIALIZATION_FAIL(COMPARE_OP, compare_op_fail_kind(lhs, rhs));
2008-
STAT_INC(COMPARE_OP, failure);
2009-
_py_set_opcode(instr, COMPARE_OP);
2010-
cache->counter = adaptive_counter_backoff(cache->counter);
2011-
return;
2012-
}
2013-
20142002
void
20152003
_Py_Specialize_CompareAndBranch(PyObject *lhs, PyObject *rhs, _Py_CODEUNIT *instr,
20162004
int oparg)

0 commit comments

Comments
 (0)
0