Skip to content

gh-145749: Optimize named exception blocks#145983

Draft
brijkapadia wants to merge 3 commits intopython:mainfrom
brijkapadia:named-exception
Draft

gh-145749: Optimize named exception blocks#145983
brijkapadia wants to merge 3 commits intopython:mainfrom
brijkapadia:named-exception

Conversation

@brijkapadia
Copy link
Copy Markdown
Contributor

@brijkapadia brijkapadia commented Mar 15, 2026

Instead of using LOAD_CONST None; STORE_FAST n; DELETE_FAST n for named exception blocks, I changed the bytecode to use PUSH_NULL; STORE_FAST n in an effort to remove the DELETE_FAST instruction.

Not sure if I need a NEWS entry

@Fidget-Spinner
Copy link
Copy Markdown
Member

Deleting a tier 1 (base interpreter) bytecode needs a news entry.

@brijkapadia brijkapadia marked this pull request as draft March 15, 2026 18:15
@brijkapadia
Copy link
Copy Markdown
Contributor Author

brijkapadia commented Mar 16, 2026

I realized that the reason why some tests do not pass is because STORE_NAME does not currently accept a NULL value. After making that fix, I realized that there are many more errors, all of which would be solved by implementing issue #145854. Thus, I am leaving this PR as a draft until the relevant additions are merged (i.e. PR #146006).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants