.. class:: Bytecode(x, *, first_line=None, current_offset=None,\
show_caches=False, adaptive=False, show_offsets=False,\
- show_positions=False)
+ show_positions=False, show_jit=False)
Analyse the bytecode corresponding to a function, generator, asynchronous
generator, coroutine, method, string of source code, or a code object (as
If *show_positions* is ``True``, :meth:`.dis` will include instruction
source code positions in the output.
+ If *show_jit* is ``True``, :meth:`.dis` will show ``ENTER_EXECUTOR``
+ instructions, which mark JIT entry points and are hidden by default.
+
.. classmethod:: from_traceback(tb, *, show_caches=False)
Construct a :class:`Bytecode` instance from the given traceback, setting
.. versionchanged:: 3.14
Added the *show_positions* parameter.
+ .. versionchanged:: next
+ Added the *show_jit* parameter.
+
Example:
.. doctest::
.. function:: dis(x=None, *, file=None, depth=None, show_caches=False,\
- adaptive=False, show_offsets=False, show_positions=False)
+ adaptive=False, show_offsets=False, show_positions=False,\
+ show_jit=False)
Disassemble the *x* object. *x* can denote either a module, a class, a
method, a function, a generator, an asynchronous generator, a coroutine,
If *adaptive* is ``True``, this function will display specialized bytecode
that may be different from the original bytecode.
+ If *show_jit* is ``True``, this function will show ``ENTER_EXECUTOR``
+ instructions, which mark JIT entry points and are hidden by default.
+
.. versionchanged:: 3.4
Added *file* parameter.
.. versionchanged:: 3.14
Added the *show_positions* parameter.
+ .. versionchanged:: next
+ Added the *show_jit* parameter.
+
.. function:: distb(tb=None, *, file=None, show_caches=False, adaptive=False,\
- show_offset=False, show_positions=False)
+ show_offsets=False, show_positions=False, show_jit=False)
Disassemble the top-of-stack function of a traceback, using the last
traceback if none was passed. The instruction causing the exception is
.. versionchanged:: 3.14
Added the *show_positions* parameter.
+ .. versionchanged:: next
+ Added the *show_jit* parameter.
+
.. function:: disassemble(code, lasti=-1, *, file=None, show_caches=False,\
- adaptive=False, show_offsets=False, show_positions=False)
+ adaptive=False, show_offsets=False, show_positions=False,\
+ show_jit=False)
disco(code, lasti=-1, *, file=None, show_caches=False, adaptive=False,\
- show_offsets=False, show_positions=False)
+ show_offsets=False, show_positions=False, show_jit=False)
Disassemble a code object, indicating the last instruction if *lasti* was
provided. The output is divided in the following columns:
.. versionchanged:: 3.14
Added the *show_positions* parameter.
-.. function:: get_instructions(x, *, first_line=None, show_caches=False, adaptive=False)
+ .. versionchanged:: next
+ Added the *show_jit* parameter.
+
+.. function:: get_instructions(x, *, first_line=None, show_caches=False, adaptive=False, show_jit=False)
Return an iterator over the instructions in the supplied function, method,
source code string or code object.
The *adaptive* parameter works as it does in :func:`dis`.
+ The *show_jit* parameter works as it does in :func:`dis`.
+
.. versionadded:: 3.4
.. versionchanged:: 3.11
field populated (regardless of the value of *show_caches*) and it no longer
generates separate items for the cache entries.
+ .. versionchanged:: next
+ Added the *show_jit* parameter.
+
.. function:: findlinestarts(code)
This generator function uses the :meth:`~codeobject.co_lines` method