diff options
author | Mark Shannon <mark@hotpy.org> | 2021-11-23 09:53:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 09:53:24 (GMT) |
commit | 135cabd328504e1648d17242b42b675cdbd0193b (patch) | |
tree | 4efa5418b1816ba02c206678ecfa4e2d8e8d8f14 /Doc | |
parent | d82f2caf942fa8b94e797a2f116ee54ec303c2df (diff) | |
download | cpython-135cabd328504e1648d17242b42b675cdbd0193b.zip cpython-135cabd328504e1648d17242b42b675cdbd0193b.tar.gz cpython-135cabd328504e1648d17242b42b675cdbd0193b.tar.bz2 |
bpo-44525: Copy free variables in bytecode to allow calls to inner functions to be specialized (GH-29595)
* Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead.
* Add reference to function to frame, borrow references to builtins and globals.
* Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/dis.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 5fe9f65..6fe64be 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -991,6 +991,15 @@ All of the following opcodes use their arguments. ``i`` is no longer offset by the length of ``co_varnames``. +.. opcode:: COPY_FREE_VARS (n) + + Copies the ``n`` free variables from the closure into the frame. + Removes the need for special code on the caller's side when calling + closures. + + .. versionadded:: 3.11 + + .. opcode:: RAISE_VARARGS (argc) Raises an exception using one of the 3 forms of the ``raise`` statement, |