Description
It looks like "families" have a double meaning: they server to map specialized/super instructions back to their "base" instruction, and they are used to double check that all family members have the same cache and stack effects. From the DSL spec it appeared that the latter was the most important, so I only implemented that, but found out that super-instructions are also in the families as defined by opcode.py (_specializations
).
ISTM that super-instructions shouldn't be required to have the same stack/cache effects as their first constituent -- their effects should be the combination of all constituents. The table that maps these back to their base can be generated separately from the super-instruction definitions (e.g., LOAD_FAST__LOAD_CONST
clearly maps to LOAD_FAST
).
I also finally realized there are some pseudo-super-instructions (e.g. BINARY_OP_INPLACE_ADD_UNICODE
). These behave like super-instructions in that they skip the next opcode, but are not generated using super(X) = Y + Z;
-- instead, they use an explicit code block. We might be able to define these as proper super-instructions constructed from constituent parts where the second part is a dummy that ends up shrinking the stack but does nothing else. I'll play with this.
Sorry for the ramble. Thanks to @brandtbucher for clearing up some of my confusion.