Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-105481: add OPCODE_IS_INSTRUMENTED (generated from bytecodes.c) to replace MIN_INSTRUMENTED_OPCODE (defined in opcode.py)#107276
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
….c) to replace MIN_INSTRUMENTED_OPCODE (defined in opcode.py)
@@ -283,7 +283,8 @@ def write_metadata(self, metadata_filename: str, pymetadata_filename: str) -> No | |||
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)) || \\\n" | |||
" ((OP) == INSTRUMENTED_LINE)" # implemented in ceval.c, not bytecodes.c |
iritkatrielJul 26, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I had to special-case INSTRUMENTED_LINE because it's implemented in ceval.c rather than bytecodes.c, so doesn't appear in the metadata. We could instead do something else like add it to the instr list after bytecode.c is parsed. I'm not sure which option is less bad.
After speaking to@markshannon I decided not to add this metadata but to generate MIN_INSTRUMENTED_OPCODE to replicate what we have now. |
Uh oh!
There was an error while loading.Please reload this page.