Skip to content

Commit 12c08f7

Browse files
committed
remove misc. stuff
1 parent 0d600c0 commit 12c08f7

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
@@ -2004,36 +2004,6 @@ def callback(code, instruction_offset):
20042004
sys.monitoring.set_events(0, 0)
20052005

20062006

2007-
@unittest.skipUnless(hasattr(_testinternalcapi, "new_counter_optimizer"),
2008-
"Requires counter optimizer")
2009-
class TestOptimizer(MonitoringTestBase, unittest.TestCase):
2010-
2011-
def setUp(self):
2012-
if hasattr(_testinternalcapi, "get_optimizer"):
2013-
self.old_opt = _testinternalcapi.get_optimizer()
2014-
opt = _testinternalcapi.new_counter_optimizer()
2015-
_testinternalcapi.set_optimizer(opt)
2016-
super(TestOptimizer, self).setUp()
2017-
2018-
def tearDown(self):
2019-
super(TestOptimizer, self).tearDown()
2020-
import _testinternalcapi
2021-
if hasattr(_testinternalcapi, "get_optimizer"):
2022-
_testinternalcapi.set_optimizer(self.old_opt)
2023-
2024-
def test_for_loop(self):
2025-
def test_func(x):
2026-
i = 0
2027-
while i < x:
2028-
i += 1
2029-
2030-
code = test_func.__code__
2031-
sys.monitoring.set_local_events(TEST_TOOL, code, E.PY_START)
2032-
self.assertEqual(sys.monitoring.get_local_events(TEST_TOOL, code), E.PY_START)
2033-
test_func(1000)
2034-
sys.monitoring.set_local_events(TEST_TOOL, code, 0)
2035-
self.assertEqual(sys.monitoring.get_local_events(TEST_TOOL, code), 0)
2036-
20372007
class TestTier2Optimizer(CheckEvents):
20382008

20392009
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
@@ -2379,7 +2379,6 @@ static PyTypeObject* static_types[] = {
23792379
&_PyContextTokenMissing_Type,
23802380
&_PyCoroWrapper_Type,
23812381
#ifdef _Py_TIER2
2382-
&_PyCounterExecutor_Type,
23832382
&_PyDefaultOptimizer_Type,
23842383
#endif
23852384
&_Py_GenericAliasIterType,

Python/optimizer.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,25 +1326,6 @@ _PyOptimizer_NewUOpOptimizer(void)
13261326
return (PyObject *)opt;
13271327
}
13281328

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

13491330
/*****************************************
13501331
* 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)