@@ -69,7 +69,7 @@ we ignore `oparg`.
6969
7070A simplified version of the interpreter's main loop looks like this:
7171
72- ```
72+ ``` c
7373 _Py_CODEUNIT *first_instr = code->co_code_adaptive;
7474 _Py_CODEUNIT *next_instr = first_instr;
7575 while (1 ) {
@@ -89,7 +89,7 @@ The instruction format supports 256 different opcodes, which is sufficient.
8989However, it also limits `oparg` to 8-bit values, which is too restrictive.
9090To overcome this, the `EXTENDED_ARG` opcode allows us to prefix any instruction
9191with one or more additional data bytes, which combine into a larger oparg.
92- For example, this sequence of code units::
92+ For example, this sequence of code units:
9393
9494 EXTENDED_ARG 1
9595 EXTENDED_ARG 0
@@ -106,7 +106,7 @@ a primary opcode.
106106The following loop, to be inserted just above the `switch` statement, will make the above
107107snippet decode a complete instruction:
108108
109- ```
109+ ```c
110110 while (opcode == EXTENDED_ARG) {
111111 word = *next_instr++;
112112 opcode = _Py_OPCODE(word);
@@ -132,7 +132,7 @@ Inline cache entries
132132
133133Some (specialized or specializable) instructions have an associated "inline cache".
134134The inline cache consists of one or more two-byte entries included in the bytecode
135- array as additional words following the ` opcode ` /` oparg ` pair.
135+ array as additional words following the ` opcode ` /` oparg ` pair.
136136The size of the inline cache for a particular instruction is fixed by its ` opcode ` .
137137Moreover, the inline cache size for all instructions in a
138138[ family of specialized/specializable instructions] ( adaptive.md )
@@ -190,9 +190,9 @@ that may be `NULL` are known.
190190A few other instructions (` GET_ITER ` , ` FOR_ITER ` ) push or pop an object that is known to
191191be an iterator.
192192
193- Instruction sequences that do not allow statically knowing the stack depth are deemed illegal
194- and the bytecode compiler never generates such sequences.
195- For example, the following sequence is illegal, because it keeps pushing items on the stack::
193+ Instruction sequences that do not allow statically knowing the stack depth are deemed illegal;
194+ the bytecode compiler never generates such sequences.
195+ For example, the following sequence is illegal, because it keeps pushing items on the stack:
196196
197197 LOAD_FAST 0
198198 JUMP_BACKWARD 2
@@ -318,12 +318,12 @@ First, you must choose a name for the bytecode, implement it in
318318and add a documentation entry in
319319[ ` Doc/library/dis.rst ` ] ( https://github.com/python/cpython/blob/main/Doc/library/dis.rst ) .
320320Then run ` make regen-cases ` to assign a number for it (see
321- [ ` Include/opcode_ids.h ` ] ( https://github.com/python/cpython/blob/main/Include/opcode_ids.h )
321+ [ ` Include/opcode_ids.h ` ] ( https://github.com/python/cpython/blob/main/Include/opcode_ids.h ) )
322322and regenerate a number of files with the actual implementation of the bytecode in
323323[ ` Python/generated_cases.c.h ` ] ( https://github.com/python/cpython/blob/main/Python/generated_cases.c.h )
324324and metadata about it in additional files.
325325
326- With a new bytecode you must also change what is called the magic number for
326+ With a new bytecode you must also change what is called the " magic number" for
327327.pyc files: bump the value of the variable ` MAGIC_NUMBER ` in
328328[ ` Lib/importlib/_bootstrap_external.py ` ] ( https://github.com/python/cpython/blob/main/Lib/importlib/_bootstrap_external.py ) .
329329Changing this number will lead to all .pyc files with the old ` MAGIC_NUMBER `
0 commit comments