[Python-ideas] Exposing flat bytecode representation to optimizers

Cesare Di Mauro cesare.di.mauro at gmail.com
Sun May 15 09:48:30 EDT 2016


2016-02-05 21:35 GMT+01:00 Serhiy Storchaka <storchaka at gmail.com>:

> LGTM. I did have the same idea when added specialized 8-bit opcodes.
>
> Some optimization (like constant folding) it is worth to move yet one step
> earlier, to AST.
>

In fact. In WPython I moved all constant folding to the ASDL.


> Other idea - instead of EXTENDED_ARG have two sets of instructions: short
> 16-bit with 8-bit arg, and long 32-bit with 24-bit arg. For simplicity
> initially only long instructions are emitted (if it makes sense).


Don't do it with all instructions, but only with the jump ones, which are
the only susceptible of such changes. In all other cases you already know
the size of the argument, which will not change.

Regards,
Cesare
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160515/65905e24/attachment.html>


More information about the Python-ideas mailing list