8000 gh-105481: expose opcode metadata via the _opcode module by iritkatriel · Pull Request #106688 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-105481: expose opcode metadata via the _opcode module #106688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 14, 2023
Prev Previous commit
revert unintended change
  • Loading branch information
iritkatriel committed Jul 14, 2023
commit c2f33ceb941c3b174a2bd934ce907d2b45afcd30
4 changes: 2 additions & 2 deletions Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Tools/cases_generator/generate_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ def write_metadata(self) -> None:
self.out.emit(
"#define IS_VALID_OPCODE(OP) \\\n"
" (((OP) >= 0) && ((OP) < OPCODE_METADATA_SIZE) && \\\n"
" (_PyOpcode_opcode_metadata[OP].valid_entry))")
" (_PyOpcode_opcode_metadata[(OP)].valid_entry))")

self.out.emit("")
InstructionFlags.emit_macros(self.out)
Expand All @@ -1230,7 +1230,7 @@ def write_metadata(self) -> None:
self.out.emit("")

self.out.emit("#define OPCODE_METADATA_FMT(OP) "
"(_PyOpcode_opcode_metadata[OP].instr_format)")
"(_PyOpcode_opcode_metadata[(OP)].instr_format)")
self.out.emit("#define SAME_OPCODE_METADATA(OP1, OP2) \\")
self.out.emit(" (OPCODE_METADATA_FMT(OP1) == OPCODE_METADATA_FMT(OP2))")
self.out.emit("")
Expand Down
0