Closed
Description
As we move towards generating more components from the instruction definition file (bytecodes.c), it helps if the instructions have regular formats and stack effects.
Currently the stack effects can be simple, variable, conditional or complex.
- Simple: Does not depend on the operand (
oparg
) - Variable: Either pops or pushes
oparg * k
items. - Conditional: Pushes a value conditional on
oparg & 1
- Complex: The stack effect depends on a set of flags embedded in
oparg
.
We can easily get rid of the complex case. There are only two cases, MAKE_FUNCTION
and FORMAT_VALUE
. Both can easily broken down into simple (and faster) parts.
We might want to get rid of condition stack effects, as it would simplify things, but performance may suffer as both LOAD_GLOBAL
and LOAD_ATTR
are conditional and they are performance critical.