Commit 18b7331
Emit INTRINSIC_ADD_CONDITIONAL_ANNOTATION for 3.16 conditional annotations
Summary:
CPython gh-154902 changed how a conditional annotation's index is registered
into the `__conditional_annotations__` set: instead of `SET_ADD`, 3.16 emits the
new `INTRINSIC_ADD_CONDITIONAL_ANNOTATION` binary intrinsic
(`CALL_INTRINSIC_2`). This diff mirrors that in cinderx's static bytecode
compiler.
Extract the emission into `CodeGenerator.emit_add_conditional_annotation()`
(default: `SET_ADD 1`, preserving 3.12/3.14/3.15 output) and override it in
`CodeGenerator316` to emit `CALL_INTRINSIC_2 INTRINSIC_ADD_CONDITIONAL_ANNOTATION`.
The intrinsic index resolves via `emit_call_intrinsic_2`, which reads it from the
running interpreter's opcode table, so it stays correct across versions.
Fixes the 3.16 cinderx compiler-test breakage from the CPython main sync
(SET_ADD vs CALL_INTRINSIC_2 disassembly mismatch).
Reviewed By: DinoV
Differential Revision: D115052327
fbshipit-source-id: 393d4d487fd7145c0c9af68632048236df671c4a1 parent dcced3e commit 18b7331
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5992 | 5992 | | |
5993 | 5993 | | |
5994 | 5994 | | |
5995 | | - | |
| 5995 | + | |
5996 | 5996 | | |
5997 | 5997 | | |
| 5998 | + | |
| 5999 | + | |
| 6000 | + | |
| 6001 | + | |
| 6002 | + | |
5998 | 6003 | | |
5999 | 6004 | | |
6000 | 6005 | | |
| |||
6854 | 6859 | | |
6855 | 6860 | | |
6856 | 6861 | | |
| 6862 | + | |
| 6863 | + | |
| 6864 | + | |
| 6865 | + | |
| 6866 | + | |
6857 | 6867 | | |
6858 | 6868 | | |
6859 | 6869 | | |
| |||
0 commit comments