diff options
author | Guido van Rossum <guido@python.org> | 2024-02-20 20:24:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 20:24:35 (GMT) |
commit | 142502ea8d26b17732009b6e981e630c342054f7 (patch) | |
tree | ec422247c652811eb58ed555bfba2f03f957faac /Modules | |
parent | 520403ed4cdf4890d63403c9cf01ac63233f5ef4 (diff) | |
download | cpython-142502ea8d26b17732009b6e981e630c342054f7.zip cpython-142502ea8d26b17732009b6e981e630c342054f7.tar.gz cpython-142502ea8d26b17732009b6e981e630c342054f7.tar.bz2 |
Tier 2 cleanups and tweaks (#115534)
* Rename `_testinternalcapi.get_{uop,counter}_optimizer` to `new_*_optimizer`
* Use `_PyUOpName()` instead of` _PyOpcode_uop_name[]`
* Add `target` to executor iterator items -- `list(ex)` now returns `(opcode, oparg, target, operand)` quadruples
* Add executor methods `get_opcode()` and `get_oparg()` to get `vmdata.opcode`, `vmdata.oparg`
* Define a helper for printing uops, and unify various places where they are printed
* Add a hack to summarize_stats.py to fix legacy uop names (e.g. `POP_TOP` -> `_POP_TOP`)
* Define helpers in `test_opt.py` for accessing the set or list of opnames of an executor
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_testinternalcapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index bcc431a..0d23b18 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -960,13 +960,13 @@ iframe_getlasti(PyObject *self, PyObject *frame) } static PyObject * -get_counter_optimizer(PyObject *self, PyObject *arg) +new_counter_optimizer(PyObject *self, PyObject *arg) { return PyUnstable_Optimizer_NewCounter(); } static PyObject * -get_uop_optimizer(PyObject *self, PyObject *arg) +new_uop_optimizer(PyObject *self, PyObject *arg) { return PyUnstable_Optimizer_NewUOpOptimizer(); } @@ -1711,8 +1711,8 @@ static PyMethodDef module_functions[] = { {"get_optimizer", get_optimizer, METH_NOARGS, NULL}, {"set_optimizer", set_optimizer, METH_O, NULL}, {"get_executor", _PyCFunction_CAST(get_executor), METH_FASTCALL, NULL}, - {"get_counter_optimizer", get_counter_optimizer, METH_NOARGS, NULL}, - {"get_uop_optimizer", get_uop_optimizer, METH_NOARGS, NULL}, + {"new_counter_optimizer", new_counter_optimizer, METH_NOARGS, NULL}, + {"new_uop_optimizer", new_uop_optimizer, METH_NOARGS, NULL}, {"add_executor_dependency", add_executor_dependency, METH_VARARGS, NULL}, {"invalidate_executors", invalidate_executors, METH_O, NULL}, {"pending_threadfunc", _PyCFunction_CAST(pending_threadfunc), |