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 /Python/optimizer_analysis.c | |
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 'Python/optimizer_analysis.c')
-rw-r--r-- | Python/optimizer_analysis.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c index b104d2f..e7fb1e3 100644 --- a/Python/optimizer_analysis.c +++ b/Python/optimizer_analysis.c @@ -44,6 +44,7 @@ #define MAX_ABSTRACT_FRAME_DEPTH (TRACE_STACK_SIZE + 2) #ifdef Py_DEBUG + extern const char *_PyUOpName(int index); static const char *const DEBUG_ENV = "PYTHON_OPT_DEBUG"; static inline int get_lltrace(void) { char *uop_debug = Py_GETENV(DEBUG_ENV); @@ -632,7 +633,7 @@ uop_redundancy_eliminator( _Py_UOpsSymType **stack_pointer = ctx->frame->stack_pointer; DPRINTF(3, "Abstract interpreting %s:%d ", - _PyOpcode_uop_name[opcode], + _PyUOpName(opcode), oparg); switch (opcode) { #include "tier2_redundancy_eliminator_cases.c.h" |