Bytecode inspection and patching - like a simpler (faster!) bytecodehacks
Similar to the Python bytecodehacks package, this module supplies Code
and Function objects which are mutable versions of the real things. The
main difference between this module and bytecodehacks is that this module
values speed above nearly all other considerations, and thus only offers
in-place bytecode patching, and eschews most of the higher-level facilities
offered by bytecodehacks . But it's plenty enough for what PEAK needs.
The module makes available many useful values; you can get any opcode as a
constant from it by explicit import, such as:
from peak.util.Code import LOAD_NAME, STORE_NAME
There's also an opcode array that you can import that maps opcode names to
values.
|