From 01852102df3258535e001ac59fa16c60f3021632 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:23:41 +0100 Subject: [PATCH 1/6] New opcodes; sys.monitoring --- Doc/whatsnew/3.12.rst | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 09d74fbc5c2845..775f9638e79b82 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -336,7 +336,7 @@ This means that you only pay for what you use, providing support for near-zero overhead debuggers and coverage tools. See :mod:`sys.monitoring` for details. -(Contributed by Mark Shannon in :gh:`103083`.) +(Contributed by Mark Shannon in :gh:`103082`.) New Features Related to Type Hints ================================== @@ -638,6 +638,9 @@ dis :data:`dis.hasarg` collection instead. (Contributed by Irit Katriel in :gh:`94216`.) +* Add the :data:`dis.hasexc` collection to signify instructions that set + an exception handler. (Contributed by Irit Katriel in :gh:`94216`.) + fractions --------- @@ -821,6 +824,10 @@ statistics sys --- +* Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 + ` monitoring API. + (Contributed by Mark Shannon in :gh:`103082`.) + * Add :func:`sys.activate_stack_trampoline` and :func:`sys.deactivate_stack_trampoline` for activating and deactivating stack profiler trampolines, @@ -1020,9 +1027,27 @@ CPython bytecode changes * Removed the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :gh:`92925`.) +* Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. + (Contributed by Mark Shannon in :gh`94163`.) + +* Add the :opcode:`CALL_INSTRINSIC_1` and :opcode:`CALL_INSTRINSIC_2` instructions. + (Contributed by Mark Shannon in :gh`99005`.) + +* Add the :opcode:`CALL_INSTRINSIC_2` instruction. + (Contributed by Irit Katriel in :gh`101799`.) + +* Add the :opcode:`CLEANUP_THROW` instruction. + (Contributed by Brandt Bucher in :gh`90997`.) + +* Add the :opcode:`END_SEND` instruction. + (Contributed by Mark Shannon in :gh`103082`.) + * Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.) +* Add the :opcode:`LOAD_FAST_CHECK` instruction. + (Contributed by Dennis Sweeney in :gh`93143`.) + * Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` opcode, which can be replaced with @@ -1032,6 +1057,8 @@ CPython bytecode changes * Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir Matveev in :gh:`103497`.) +* Add the :opcode:`RETURN_CONST` instruction. (:gh`101632`.) + Demos and Tools =============== From a4c1d225890e36fe87bfa416cfd68a865b082298 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:30:24 +0100 Subject: [PATCH 2/6] syntax --- Doc/whatsnew/3.12.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 775f9638e79b82..0aab63ecd93633 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1028,25 +1028,25 @@ CPython bytecode changes :gh:`92925`.) * Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. - (Contributed by Mark Shannon in :gh`94163`.) + (Contributed by Mark Shannon in :gh:`94163`.) * Add the :opcode:`CALL_INSTRINSIC_1` and :opcode:`CALL_INSTRINSIC_2` instructions. - (Contributed by Mark Shannon in :gh`99005`.) + (Contributed by Mark Shannon in :gh:`99005`.) * Add the :opcode:`CALL_INSTRINSIC_2` instruction. - (Contributed by Irit Katriel in :gh`101799`.) + (Contributed by Irit Katriel in :gh:`101799`.) * Add the :opcode:`CLEANUP_THROW` instruction. - (Contributed by Brandt Bucher in :gh`90997`.) + (Contributed by Brandt Bucher in :gh:`90997`.) * Add the :opcode:`END_SEND` instruction. - (Contributed by Mark Shannon in :gh`103082`.) + (Contributed by Mark Shannon in :gh:`103082`.) * Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.) * Add the :opcode:`LOAD_FAST_CHECK` instruction. - (Contributed by Dennis Sweeney in :gh`93143`.) + (Contributed by Dennis Sweeney in :gh:`93143`.) * Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of the implementation of :pep:`695`. @@ -1057,7 +1057,7 @@ CPython bytecode changes * Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir Matveev in :gh:`103497`.) -* Add the :opcode:`RETURN_CONST` instruction. (:gh`101632`.) +* Add the :opcode:`RETURN_CONST` instruction. (:gh:`101632`.) Demos and Tools =============== From d755483cf9a1ddc68d4c4062e68165c8dcf279c2 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Mon, 25 Sep 2023 08:51:32 +0100 Subject: [PATCH 3/6] CALL_INSTRINSIC_2 --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 0aab63ecd93633..11590e68731db8 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1030,7 +1030,7 @@ CPython bytecode changes * Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. (Contributed by Mark Shannon in :gh:`94163`.) -* Add the :opcode:`CALL_INSTRINSIC_1` and :opcode:`CALL_INSTRINSIC_2` instructions. +* Add the :opcode:`CALL_INSTRINSIC_1` instructions. (Contributed by Mark Shannon in :gh:`99005`.) * Add the :opcode:`CALL_INSTRINSIC_2` instruction. From d6384a2b740eb4b5b20c697027ea887310a99eb1 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:45:09 +0100 Subject: [PATCH 4/6] undocumented opcodes --- Doc/whatsnew/3.12.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 11590e68731db8..0d29dfeab0aa9b 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1030,16 +1030,16 @@ CPython bytecode changes * Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. (Contributed by Mark Shannon in :gh:`94163`.) -* Add the :opcode:`CALL_INSTRINSIC_1` instructions. +* Add the :opcode:`!CALL_INSTRINSIC_1` instructions. (Contributed by Mark Shannon in :gh:`99005`.) -* Add the :opcode:`CALL_INSTRINSIC_2` instruction. +* Add the :opcode:`!CALL_INSTRINSIC_2` instruction. (Contributed by Irit Katriel in :gh:`101799`.) * Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher in :gh:`90997`.) -* Add the :opcode:`END_SEND` instruction. +* Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:`103082`.) * Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the From 4bd178d693fe95fe70de01e635ab99421f638e0b Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Mon, 25 Sep 2023 13:43:59 +0100 Subject: [PATCH 5/6] 'intrinsic' --- Doc/whatsnew/3.12.rst | 4 ++-- Misc/NEWS.d/3.12.0a4.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 0d29dfeab0aa9b..4f01f9a46f2709 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1030,10 +1030,10 @@ CPython bytecode changes * Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. (Contributed by Mark Shannon in :gh:`94163`.) -* Add the :opcode:`!CALL_INSTRINSIC_1` instructions. +* Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark Shannon in :gh:`99005`.) -* Add the :opcode:`!CALL_INSTRINSIC_2` instruction. +* Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel in :gh:`101799`.) * Add the :opcode:`CLEANUP_THROW` instruction. diff --git a/Misc/NEWS.d/3.12.0a4.rst b/Misc/NEWS.d/3.12.0a4.rst index b3b39024056ccc..75246f3f13503e 100644 --- a/Misc/NEWS.d/3.12.0a4.rst +++ b/Misc/NEWS.d/3.12.0a4.rst @@ -23,10 +23,10 @@ Remove :opcode:`UNARY_POSITIVE`, :opcode:`ASYNC_GEN_WRAP` and .. nonce: D7H6j4 .. section: Core and Builtins -Add new :opcode:`CALL_INSTRINSIC_1` instruction. Remove +Add new :opcode:`CALL_INTRINSIC_1` instruction. Remove :opcode:`IMPORT_STAR`, :opcode:`PRINT_EXPR` and :opcode:`STOPITERATION_ERROR`, replacing them with the -:opcode:`CALL_INSTRINSIC_1` instruction. +:opcode:`CALL_INTRINSIC_1` instruction. .. From c29a5bb49b8f0b8fbc957f98e698b76a5a2c52ca Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 28 Sep 2023 07:28:58 +0300 Subject: [PATCH 6/6] Add credit --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 7c86536c089c91..ec39616d7c9d2b 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -1120,7 +1120,7 @@ CPython bytecode changes * Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir Matveev in :gh:`103497`.) -* Add the :opcode:`RETURN_CONST` instruction. (:gh:`101632`.) +* Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :gh:`101632`.) Demos and Tools ===============