Skip to content

gh-145749: Optimize named exception blocks#145983

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

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

Conversation

@bkap123
Copy link
Contributor

@bkap123 bkap123 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
Member

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

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

bkap123 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