bytecode instead of on these mechanical issues. |
bytecode instead of on these mechanical issues. |
|
|
In addition to a low-level opcode-oriented API for directly generating specific |
In addition to a low-level opcode-oriented API for directly generating specific |
bytecodes, this module also offers an extensible mini-AST framework for |
Python bytecodes, this module also offers an extensible mini-AST framework for |
generating code from high-level specifications. This framework does most of |
generating code from high-level specifications. This framework does most of |
the work needed to transform tree-like structures into linear bytecode |
the work needed to transform tree-like structures into linear bytecode |
instructions, and includes the ability to do compile-time constant folding. |
instructions, and includes the ability to do compile-time constant folding. |
strings accepted (in the ``cmp_op`` tuple). ``"<>"`` is also accepted as an |
strings accepted (in the ``cmp_op`` tuple). ``"<>"`` is also accepted as an |
alias for ``"!="``. |
alias for ``"!="``. |
|
|
|
* Added code to verify that forward jump offsets don't exceed a 64KB span, and |
|
support absolute backward jumps to locations >64KB. |
|
|
Changes since version 0.1: |
Changes since version 0.1: |
|
|
* Constant handling has been fixed so that it doesn't confuse equal values of |
* Constant handling has been fixed so that it doesn't confuse equal values of |
* Various bug fixes |
* Various bug fixes |
|
|
There are a few features that aren't tested yet, and not all opcodes may be |
There are a few features that aren't tested yet, and not all opcodes may be |
fully supported. Notably, the following features are still NOT reliably |
fully supported. Also note the following limitations: |
supported yet: |
|
|
|
* Wide jump addressing (for generated bytecode>64K in size) |
* Jumps to as-yet-undefined labels cannot span a distance greater than 65,535 |
|
bytes. |
|
|
* The ``dis()`` module in Python 2.3 has a bug that makes it show incorrect |
* The ``dis()`` module in Python 2.3 has a bug that makes it show incorrect |
line numbers when the difference between two adjacent line numbers is |
line numbers when the difference between two adjacent line numbers is |