Skip to content

Commit 0e96ecb

Browse files
committed
remove misc. stuff
1 parent 44aa7ab commit 0e96ecb

File tree

6 files changed

+0
-58
lines changed

6 files changed

+0
-58
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ int _Py_uop_analyze_and_optimize(struct _PyInterpreterFrame *frame,
146146
_PyUOpInstruction *trace, int trace_len, int curr_stackentries,
147147
_PyBloomFilter *dependencies);
148148

149-
extern PyTypeObject _PyCounterExecutor_Type;
150149
extern PyTypeObject _PyDefaultOptimizer_Type;
151150
extern PyTypeObject _PyUOpExecutor_Type;
152151
extern PyTypeObject _PyUOpOptimizer_Type;

Lib/test/test_monitoring.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,36 +2086,6 @@ def callback(code, instruction_offset):
20862086
sys.monitoring.set_events(0, 0)
20872087

20882088

2089-
@unittest.skipUnless(hasattr(_testinternalcapi, "new_counter_optimizer"),
2090-
"Requires counter optimizer")
2091-
class TestOptimizer(MonitoringTestBase, unittest.TestCase):
2092-
2093-
def setUp(self):
2094-
if hasattr(_testinternalcapi, "get_optimizer"):
2095-
self.old_opt = _testinternalcapi.get_optimizer()
2096-
opt = _testinternalcapi.new_counter_optimizer()
2097-
_testinternalcapi.set_optimizer(opt)
2098-
super(TestOptimizer, self).setUp()
2099-
2100-
def tearDown(self):
2101-
super(TestOptimizer, self).tearDown()
2102-
import _testinternalcapi
2103-
if hasattr(_testinternalcapi, "get_optimizer"):
2104-
_testinternalcapi.set_optimizer(self.old_opt)
2105-
2106-
def test_for_loop(self):
2107-
def test_func(x):
2108-
i = 0
2109-
while i < x:
2110-
i += 1
2111-
2112-
code = test_func.__code__
2113-
sys.monitoring.set_local_events(TEST_TOOL, code, E.PY_START)
2114-
self.assertEqual(sys.monitoring.get_local_events(TEST_TOOL, code), E.PY_START)
2115-
test_func(1000)
2116-
sys.monitoring.set_local_events(TEST_TOOL, code, 0)
2117-
self.assertEqual(sys.monitoring.get_local_events(TEST_TOOL, code), 0)
2118-
21192089
class TestTier2Optimizer(CheckEvents):
21202090

21212091
def test_monitoring_already_opimized_loop(self):

Modules/_testinternalcapi.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,12 +1028,6 @@ add_executor_dependency(PyObject *self, PyObject *args)
10281028
if (!PyArg_ParseTuple(args, "OO", &exec, &obj)) {
10291029
return NULL;
10301030
}
1031-
/* No way to tell in general if exec is an executor, so we only accept
1032-
* counting_executor */
1033-
if (strcmp(Py_TYPE(exec)->tp_name, "counting_executor")) {
1034-
PyErr_SetString(PyExc_TypeError, "argument must be a counting_executor");
1035-
return NULL;
1036-
}
10371031
_Py_Executor_DependsOn((_PyExecutorObject *)exec, obj);
10381032
Py_RETURN_NONE;
10391033
}

Objects/object.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2380,7 +2380,6 @@ static PyTypeObject* static_types[] = {
23802380
&_PyContextTokenMissing_Type,
23812381
&_PyCoroWrapper_Type,
23822382
#ifdef _Py_TIER2
2383-
&_PyCounterExecutor_Type,
23842383
&_PyDefaultOptimizer_Type,
23852384
#endif
23862385
&_Py_GenericAliasIterType,

Python/optimizer.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,25 +1332,6 @@ _PyOptimizer_NewUOpOptimizer(void)
13321332
return (PyObject *)opt;
13331333
}
13341334

1335-
static void
1336-
counter_dealloc(_PyExecutorObject *self) {
1337-
/* The optimizer is the operand of the second uop. */
1338-
PyObject *opt = (PyObject *)self->trace[1].operand0;
1339-
Py_DECREF(opt);
1340-
uop_dealloc(self);
1341-
}
1342-
1343-
PyTypeObject _PyCounterExecutor_Type = {
1344-
PyVarObject_HEAD_INIT(&PyType_Type, 0)
1345-
.tp_name = "counting_executor",
1346-
.tp_basicsize = offsetof(_PyExecutorObject, exits),
1347-
.tp_itemsize = 1,
1348-
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION | Py_TPFLAGS_HAVE_GC,
1349-
.tp_dealloc = (destructor)counter_dealloc,
1350-
.tp_methods = executor_methods,
1351-
.tp_traverse = executor_traverse,
1352-
.tp_clear = (inquiry)executor_clear,
1353-
};
13541335

13551336
/*****************************************
13561337
* Executor management

Tools/c-analyzer/cpython/ignored.tsv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ Python/sysmodule.c - _PySys_ImplCacheTag -
384384
Python/sysmodule.c - _PySys_ImplName -
385385
Python/sysmodule.c - whatstrings -
386386
Python/optimizer.c - _PyDefaultOptimizer_Type -
387-
Python/optimizer.c - _PyCounterExecutor_Type -
388387
Python/optimizer.c - _PyUOpExecutor_Type -
389388
Python/optimizer.c - _PyUOpOptimizer_Type -
390389
Python/optimizer.c - _PyOptimizer_Default -

0 commit comments

Comments
 (0)