Skip to content

Commit cb03b20

Browse files
committed
Update section for Step1, reworded as per review comments for clarity
1 parent 10a7144 commit cb03b20

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

InternalDocs/interpreter.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,7 @@ Let's use the example of [`CONTAINS_OP`](../Doc/library/dis.rst#contains_op):
525525
op(_CONTAINS_OP, ...);
526526
```
527527
528-
- Add a uop that calls the specializing function `_SPECIALIZE_CONTAINS_OP`.
529-
For example.
528+
- Add a uop that calls the specializing function:
530529
531530
```c
532531
specializing op(_SPECIALIZE_CONTAINS_OP, (counter/1, left, right -- left, right)) {
@@ -542,8 +541,11 @@ Let's use the example of [`CONTAINS_OP`](../Doc/library/dis.rst#contains_op):
542541
}
543542
```
544543

545-
- The original `CONTAINS_OP` is now a new macro consisting of
546-
`_SPECIALIZE_CONTAINS_OP` and `_CONTAINS_OP`.
544+
- Create a macro for the original bytecode name:
545+
546+
```c
547+
macro(CONTAINS_OP) = _SPECIALIZE_CONTAINS_OP + _CONTAINS_OP;
548+
```
547549
548550
2. Define the cache structure in [Include/internal/pycore_code.h](../Include/internal/pycore_code.h),
549551
at the very least, a 16-bit counter is needed.

0 commit comments

Comments
 (0)