[Python-ideas] Exposing flat bytecode representation to optimizers

Victor Stinner victor.stinner at gmail.com
Fri Feb 5 19:06:04 EST 2016


2016-02-05 20:58 GMT+01:00 Andrew Barnert via Python-ideas
<python-ideas at python.org>:
>   [^3]: The compiler doesn't actually have exactly what the optimizers would want, but it's pretty close: it has a linked list of block objects, each of which has an array of instruction objects, with jump targets being pointers to blocks.

This thread was hijacked by discussion the bytecode bytes format. I
was confused by the discussion on extended arguments and size of
bytecode instructions in bytes.

Hopefully, the annoying case of "extended arguments" does not matter
here! Compiler instructions use 32-bit signed integer (let's say
"integers without arbitrary limit :-D"), and EXTENDED_ARG instructions
are only emitted later when the blocks of instructions are compiled to
effective bytecode.

That's another nice advantage to work on blocks of instructions :-)

Victor


More information about the Python-ideas mailing list