Skip to content

Commit 1ce1889

Browse files
committed
remove _INTERNAL_INCREMENT_OPT_COUNTER
1 parent 843d1db commit 1ce1889

File tree

6 files changed

+92
-157
lines changed

6 files changed

+92
-157
lines changed

Include/internal/pycore_uop_ids.h

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

Include/internal/pycore_uop_metadata.h

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

Python/bytecodes.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5024,13 +5024,6 @@ dummy_func(
50245024
DECREF_INPUTS();
50255025
}
50265026

5027-
/* Internal -- for testing executors */
5028-
op(_INTERNAL_INCREMENT_OPT_COUNTER, (opt --)) {
5029-
_PyCounterOptimizerObject *exe = (_PyCounterOptimizerObject *)PyStackRef_AsPyObjectBorrow(opt);
5030-
exe->count++;
5031-
DEAD(opt);
5032-
}
5033-
50345027
tier2 op(_DYNAMIC_EXIT, (exit_p/4 --)) {
50355028
tstate->previous_executor = (PyObject *)current_executor;
50365029
_PyExitData *exit = (_PyExitData *)exit_p;

Python/executor_cases.c.h

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

Python/optimizer.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,43 +1346,6 @@ PyTypeObject _PyCounterExecutor_Type = {
13461346
.tp_clear = (inquiry)executor_clear,
13471347
};
13481348

1349-
static int
1350-
counter_optimize(
1351-
_PyOptimizerObject* self,
1352-
_PyInterpreterFrame *frame,
1353-
_Py_CODEUNIT *instr,
1354-
_PyExecutorObject **exec_ptr,
1355-
int Py_UNUSED(curr_stackentries),
1356-
bool Py_UNUSED(progress_needed)
1357-
)
1358-
{
1359-
PyCodeObject *code = _PyFrame_GetCode(frame);
1360-
int oparg = instr->op.arg;
1361-
while (instr->op.code == EXTENDED_ARG) {
1362-
instr++;
1363-
oparg = (oparg << 8) | instr->op.arg;
1364-
}
1365-
if (instr->op.code != JUMP_BACKWARD) {
1366-
/* Counter optimizer can only handle backward edges */
1367-
return 0;
1368-
}
1369-
_Py_CODEUNIT *target = instr + 1 + _PyOpcode_Caches[JUMP_BACKWARD] - oparg;
1370-
_PyUOpInstruction buffer[4] = {
1371-
{ .opcode = _START_EXECUTOR, .jump_target = 3, .format=UOP_FORMAT_JUMP },
1372-
{ .opcode = _LOAD_CONST_INLINE, .operand0 = (uintptr_t)self },
1373-
{ .opcode = _INTERNAL_INCREMENT_OPT_COUNTER },
1374-
{ .opcode = _EXIT_TRACE, .target = (uint32_t)(target - _PyCode_CODE(code)), .format=UOP_FORMAT_TARGET }
1375-
};
1376-
_PyExecutorObject *executor = make_executor_from_uops(buffer, 4, &EMPTY_FILTER);
1377-
if (executor == NULL) {
1378-
return -1;
1379-
}
1380-
Py_INCREF(self);
1381-
Py_SET_TYPE(executor, &_PyCounterExecutor_Type);
1382-
*exec_ptr = executor;
1383-
return 1;
1384-
}
1385-
13861349
static PyObject *
13871350
counter_get_counter(PyObject *self, PyObject *args)
13881351
{

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)