File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -408,6 +408,24 @@ The Python compiler currently generates the following bytecode instructions.
408
408
.. versionadded :: 3.11
409
409
410
410
411
+ .. opcode :: CACHE
412
+
413
+ Rather than being an actual instruction, this opcode is used to mark extra
414
+ space for the interpreter to cache useful data directly in the bytecode
415
+ itself. It is automatically hidden by all ``dis `` utilities, but can be
416
+ viewed with ``show_caches=True ``.
417
+
418
+ Logically, this space is part of the preceding instruction. Many opcodes
419
+ expect to be followed by an exact number of caches, and will instruct the
420
+ interpreter to skip over them at runtime.
421
+
422
+ Populated caches can look like arbitrary instructions, so great care should
423
+ be taken when reading or modifying raw, adaptive bytecode containing
424
+ quickened data.
425
+
426
+ .. versionadded :: 3.11
427
+
428
+
411
429
**Unary operations **
412
430
413
431
Unary operations take the top of the stack, apply the operation, and push the
Original file line number Diff line number Diff line change @@ -1165,6 +1165,13 @@ contributors are volunteers from the community.
1165
1165
CPython bytecode changes
1166
1166
========================
1167
1167
1168
+ * The bytecode now contains inline cache entries, which take the form of
1169
+ :opcode: `CACHE ` instructions. Many opcodes expect to be followed by an exact
1170
+ number of caches, and instruct the interpreter to skip over them at runtime.
1171
+ Populated caches can look like arbitrary instructions, so great care should be
1172
+ taken when reading or modifying raw, adaptive bytecode containing quickened
1173
+ data.
1174
+
1168
1175
* Replaced all numeric ``BINARY_* `` and ``INPLACE_* `` instructions with a single
1169
1176
:opcode: `BINARY_OP ` implementation.
1170
1177
You can’t perform that action at this time.
0 commit comments