-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Bytecode parity #7504
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
Bytecode parity #7504
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a6aab76
Match CPython LOAD_SPECIAL stack semantics for with/async-with
youknowone d015f02
Normalize LOAD_FAST_CHECK and JUMP_BACKWARD_NO_INTERRUPT
youknowone 37d1e03
Add EXTENDED_ARG to SKIP_OPS, normalize LOAD_FAST_CHECK and JUMP_BACK…
youknowone b559a6e
Remove duplicate return-None when block already has return
youknowone 6b200d9
Improve __static_attributes__ collection accuracy
youknowone 122f76a
Use method mode for function-local import attribute calls
youknowone d1641dd
Optimize constant iterable before GET_ITER to LOAD_CONST tuple
youknowone 5b19b70
Fix cell variable ordering: parameters first, then alphabetical
youknowone 5b32c68
Emit COPY_FREE_VARS before MAKE_CELL matching CPython order
youknowone 96462fa
Fix RESUME AfterYield encoding to match CPython 3.14 (value 5)
youknowone 296eaa1
Address code review feedback from #7481
youknowone b2eaa71
Fold constant list/set/tuple literals in compiler
youknowone c7f505d
Use BUILD_MAP 0 + MAP_ADD for large dicts (>= 16 pairs)
youknowone a23315a
Fix clippy warnings and cargo fmt
youknowone cab59e7
fix surrogate
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
Fix cell variable ordering: parameters first, then alphabetical
CPython orders cell variables with parameter cells first (in parameter definition order), then non-parameter cells sorted alphabetically. Previously all cells were sorted alphabetically. Also add for-loop iterable optimization: constant BUILD_LIST/SET before GET_ITER is folded to just LOAD_CONST tuple.
- Loading branch information
commit 5b19b7031ef036dd3ece601b0d5202021e37d855
Some comments aren't visible on the classic Files Changed page.
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
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.
Detect parameter cells from
PARAMETER, not fromvarname_cache.Line 1082 is using
varname_cache.contains(&name), butvarname_cachecontains every local, not just arguments. That means ordinary captured locals also land inparam_cells, so non-parameter cellvars keep local-definition order instead of the advertised alphabetical order. Becausecellvarsare indexed positionally later, this still shiftsco_cellvars/localsplus metadata away from CPython.Possible fix
📝 Committable suggestion
🤖 Prompt for AI Agents