-
Notifications
You must be signed in to change notification settings - Fork 19
jit: speed up exception construction, traceback, and property getters #1182
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 all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
59baf76
jit: allocate JIT-emitted traceback nodes in the nursery
youknowone 151ba8f
jit: specialize the SystemExit constructor in traced code
youknowone 45d6028
jit: inline raising property getters
youknowone 6cc8dea
import: root the traceback cursor across the bootstrap-frame walk
youknowone 75ab4cc
interpreter: retain function name objects on generators
youknowone 2663ed1
interpreter: cache the yields-inside-try bit on the code object
youknowone 49d947c
importing: reformat the bootstrap-frame walk
youknowone 8934323
majit-gc: route object sizing through one checked size-for-typeid
youknowone ceff92a
import: preserve surrogate module names on the Linux gate
youknowone b55e5f4
Apply suggestions from code review
youknowone 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
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
32 changes: 32 additions & 0 deletions
32
pyre/extra_tests/parity_tests/generator_function_name_objects.py
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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # CPython-suite gap: generator tests do not cover function-name object reuse. | ||
| # parity-tests reason: PyPy stores the function's existing names on a new generator. | ||
|
|
||
| """Generator construction retains the function's current immutable names.""" | ||
|
|
||
|
|
||
| def items(): | ||
| yield 1 | ||
|
|
||
|
|
||
| name = "renamed" | ||
| qualname = "qualified.items" | ||
| items.__name__ = name | ||
| items.__qualname__ = qualname | ||
| generator = items() | ||
|
|
||
| assert generator.__name__ is name | ||
| assert generator.__qualname__ is qualname | ||
|
|
||
| items.__name__ = "later" | ||
| items.__qualname__ = "later.items" | ||
| assert generator.__name__ == "renamed" | ||
| assert generator.__qualname__ == "qualified.items" | ||
|
|
||
| surrogate = "items\ud800" | ||
| items.__name__ = surrogate | ||
| items.__qualname__ = surrogate | ||
| surrogate_generator = items() | ||
| assert surrogate_generator.__name__ is surrogate | ||
| assert surrogate_generator.__qualname__ is surrogate | ||
|
|
||
| print("OK") |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep the error-layout calculation fallible.
Line 95 calls
allocation_size, which uses non-fallible rounding. An unrepresentabletotal_sizecan fail before this code emits the new contextualGC BUGmessage.Use
try_round_up(total_size.max(GcHeader::MIN_NURSERY_OBJ_SIZE))here. Then add and roundcard_header_byteswith the same checked sequence astry_alloc_with_card_header.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents