Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
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
andFORMAT_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 bothLOAD_GLOBAL
andLOAD_ATTR
are conditional and they are performance critical.