diff --git a/compiler.rst b/compiler.rst index 40384cb07..0038b6113 100644 --- a/compiler.rst +++ b/compiler.rst @@ -285,6 +285,12 @@ Emission of bytecode is handled by the following macros: ``ADDOP(struct compiler *, int)`` add a specified opcode +``ADDOP_NOLINE(struct compiler *, int)`` + like ``ADDOP`` without a line number; used for artificial opcodes without + no corresponding token in the source code +``ADDOP_IN_SCOPE(struct compiler *, int)`` + like ``ADDOP``, but also exits current scope; used for adding return value + opcodes in lambdas and closures ``ADDOP_I(struct compiler *, int, Py_ssize_t)`` add an opcode that takes an integer argument ``ADDOP_O(struct compiler *, int, PyObject *, TYPE)`` @@ -305,10 +311,14 @@ Emission of bytecode is handled by the following macros: position of the specified PyObject in the consts table. ``ADDOP_LOAD_CONST_NEW(struct compiler *, PyObject *)`` just like ``ADDOP_LOAD_CONST_NEW``, but steals a reference to PyObject -``ADDOP_JABS(struct compiler *, int, basicblock *)`` - create an absolute jump to a basic block -``ADDOP_JREL(struct compiler *, int, basicblock *)`` - create a relative jump to a basic block +``ADDOP_JUMP(struct compiler *, int, basicblock *)`` + create a jump to a basic block +``ADDOP_JUMP_NOLINE(struct compiler *, int, basicblock *)`` + like ``ADDOP_JUMP`` without a line number; used for artificial jumps + without no corresponding token in the source code. +``ADDOP_JUMP_COMPARE(struct compiler *, cmpop_ty)`` + depending on the second argument, add an ``ADDOP_I`` with either an + ``IS_OP``, ``CONTAINS_OP``, or ``COMPARE_OP`` opcode. Several helper functions that will emit bytecode and are named :samp:`compiler_{xx}()` where *xx* is what the function helps with (``list``,