-
- Notifications
You must be signed in to change notification settings - Fork 33.4k
bpo-40222: "Zero cost" exception handling #25729
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
Changes from 1 commit
Commits
Show all changes
45 commits Select commit Hold shift + click to select a range
a414fa6 Add SETUP_CLEANUP bytecode to track lasti for re-raising exceptions i…
markshannon 902690d Move some handling of exceptions to bytecode from unwind code.
markshannon 21646b1 Move setting up except block out of unwind code into bytecode.
markshannon 9c9575a Move cleanup code for try-finally and try-except in bytecode.
markshannon 3be89db Move cleanup code for with and sync with into bytecode.
markshannon cf664f7 Simplify exit code for async for loops.
markshannon 722b722 Remove SETUP_EXCEPT opcode.
markshannon caa355f Remove EXCEPT_HANDLER as a type of exception handling block.
markshannon 4c21ddd Factor out all block pops and pushes into simple opcodes.
markshannon 6a8d90c Generate exception handling table
markshannon 9115cea Parse and verify exception table when unwinding exceptions.
markshannon 350334c Update test to account for new code object constructor.
markshannon d6da9cb Push lasti to stack when cleaning up exception handlers, and use it t…
markshannon a6b9292 Remove block stack from frames add convert SETUP/POP_BLOCK instructio…
markshannon 9d0a6c1 Make dis understand the exception table.
markshannon ca482d0 Merge branch 'master' into zero-cost-except
markshannon 4629a97 Set line numbers at start of exception handlers in try-except and try…
markshannon 58b4a5a Handle exceptions in trace functions correctly.
markshannon e7a9221 Fix syntax error test.
markshannon 062ffa4 Get frame.setlineno working again.
markshannon 71d95c1 Merge branch 'master' into zero-cost-except
markshannon e5c2c3e Remove debugging prints
markshannon 7571e90 Fix test_dis after merge
markshannon 812e78f Layout frameobject in most compact form.
markshannon 5801089 Add NEWS.
markshannon 8cb6366 Remove SETUP_FINALLY, SETUP_ASYNC_WITH, SETUP_CLEANUP, POP_BLOCK inst…
markshannon 4ec3417 Update dis.rst
markshannon 07cd46d fix NEWS formatting
markshannon 3b52a3f Fix typos and clarify text.
markshannon 594a636 Restore dis after discarded experiment.
markshannon 585f306 Bump magic number for 3.11
markshannon 0f11d34 Fix typo
markshannon 63a9b0e Merge branch 'master' into zero-cost-except
markshannon 133f74f Re-order optimization passes to remove more NOPs.
markshannon 299e051 Update importlib yet again.
markshannon 43c199d Assorted clarifications.
markshannon 630e755 Rename frame.setlineno assistant code to clarify that we now model th…
markshannon 6333f6c Revert mistaken change.
markshannon e1d6e1e Update Include/opcode.h
markshannon 73b600a Extend notes on exception handling.
markshannon f263ee2 Fix refleaks
markshannon 2f31c84 Merge branch 'main' into zero-cost-except
markshannon 0c3fd95 Document removal frame push/pop C-API functions.
markshannon b92ada2 Update importlib
markshannon 1878117 Clarify exception handling notes
markshannon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix NEWS formatting
- Loading branch information
commit 07cd46d931131d7e8cc9c5f3d5b9cea5b0a0064f
There are no files selected for viewing
8 changes: 4 additions & 4 deletions 8 Misc/NEWS.d/next/Core and Builtins/2021-04-30-15-48-36.bpo-40222.j3VxeX.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| "Zero cost" exceptino handling. | ||
| | ||
| * Uses a lookup table to determine how to handle exceptions * Removes | ||
| SETUP_FINALLY and POP_TOP block instructions, eliminating the runtime | ||
| overhead of try statements. * Reduces the size of the fram object by about | ||
| 60% | ||
| * Uses a lookup table to determine how to handle exceptions | ||
| * Removes SETUP_FINALLY and POP_TOP block instructions, eliminating the runtime overhead of try statements. | ||
| * Reduces the size of the fram object by about 60% | ||
ericsnowcurrently marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.