mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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
This commit is contained in:
parent
520403ed4c
commit
142502ea8d
8 changed files with 206 additions and 124 deletions
|
|
@ -1799,7 +1799,7 @@ class TestOptimizer(MonitoringTestBase, unittest.TestCase):
|
|||
def setUp(self):
|
||||
import _testinternalcapi
|
||||
self.old_opt = _testinternalcapi.get_optimizer()
|
||||
opt = _testinternalcapi.get_counter_optimizer()
|
||||
opt = _testinternalcapi.new_counter_optimizer()
|
||||
_testinternalcapi.set_optimizer(opt)
|
||||
super(TestOptimizer, self).setUp()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue