Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
iritkatriel wants to merge4 commits intopython:mainfromiritkatriel:instrumented

Conversation

iritkatriel
Copy link
Member

@iritkatrieliritkatriel commentedJul 25, 2023
edited by bedevere-bot
Loading

….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
Copy link
MemberAuthor

@iritkatrieliritkatrielJul 26, 2023
edited
Loading

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.

@iritkatrieliritkatriel marked this pull request as draftJuly 26, 2023 15:42
@iritkatriel
Copy link
MemberAuthor

After speaking to@markshannon I decided not to add this metadata but to generate MIN_INSTRUMENTED_OPCODE to replicate what we have now.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gvanrossumgvanrossumAwaiting requested review from gvanrossum

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@iritkatriel@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp