Thanks to visit codestin.com
Credit goes to github.com

Skip to content

GH-99005: Add CALL_INTRINSIC_1 instruction #100771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add news and update dis docs.
  • Loading branch information
markshannon committed Jan 5, 2023
commit 66d3ea41d503d8c3e96ba90c853c1153f6f35a7c
32 changes: 9 additions & 23 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -607,15 +607,6 @@ the original TOS1.
.. versionadded:: 3.12


.. opcode:: STOPITERATION_ERROR

Handles a StopIteration raised in a generator or coroutine.
If TOS is an instance of :exc:`StopIteration`, or :exc:`StopAsyncIteration`
replace it with a :exc:`RuntimeError`.

.. versionadded:: 3.12


.. opcode:: BEFORE_ASYNC_WITH

Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the
Expand All @@ -627,13 +618,6 @@ the original TOS1.

**Miscellaneous opcodes**

.. opcode:: PRINT_EXPR

Implements the expression statement for the interactive mode. TOS is removed
from the stack and printed. In non-interactive mode, an expression statement
is terminated with :opcode:`POP_TOP`.


.. opcode:: SET_ADD (i)

Calls ``set.add(TOS1[-i], TOS)``. Used to implement set comprehensions.
Expand Down Expand Up @@ -682,13 +666,6 @@ iterations of the loop.
.. versionadded:: 3.6


.. opcode:: IMPORT_STAR

Loads all symbols not starting with ``'_'`` directly from the module TOS to
the local namespace. The module is popped after loading all names. This
opcode implements ``from module import *``.


.. opcode:: POP_EXCEPT

Pops a value from the stack, which is used to restore the exception state.
Expand Down Expand Up @@ -1422,6 +1399,15 @@ iterations of the loop.
they use their arg.


.. opcode:: CALL_INTRINSIC_1

Calls an intrinsic function with one argument. Passes the TOS as the argument
and sets TOS to the result. Used to implement functionality that is necessary
but not performance critical.

.. versionadded:: 3.12


**Pseudo-instructions**

These opcodes do not appear in python bytecode, they are used by the compiler
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Add new :opcode:`CALL_INSTRINSIC_1` instruction. Remove
:opcode:`IMPORT_STAR`, :opcode:`PRINT_EXPR` and
:opcode:`STOPITERATION_ERROR`, replacing them with the
:opcode:`CALL_INSTRINSIC_1` instruction.