gh-131798: Split _CHECK_AND_ALLOCATE_OBJECT into smaller uops#148433
Draft
Sacul0457 wants to merge 3 commits intopython:mainfrom
Draft
gh-131798: Split _CHECK_AND_ALLOCATE_OBJECT into smaller uops#148433Sacul0457 wants to merge 3 commits intopython:mainfrom
_CHECK_AND_ALLOCATE_OBJECT into smaller uops#148433Sacul0457 wants to merge 3 commits intopython:mainfrom
Conversation
Contributor
Author
|
Hey @Fidget-Spinner, I'm a little lost here
|
| assert(init != NULL); | ||
| assert(PyFunction_Check(init)); | ||
| callable = sym_new_const(ctx, init); | ||
| sym_set_const(callable, init); |
Member
There was a problem hiding this comment.
- This should go into the new _ALLOCATE_OBJECT
- It should be
callable = sym_new_const(ctx, init);notsym_set_const(callable, init);. There's a difference --- the first overrides the current callable with a new one, the second sets the current callable to a known constant. If you read the code in bytecodes.c, you'll see it's the first one.
cocolato
reviewed
Apr 12, 2026
| // type watcher, as we do not remove this _CHECK_AND_ALLOCATE_OBJECT guard. | ||
| // TODO: split up _CHECK_AND_ALLOCATE_OBJECT to the check then alloate, so we can | ||
| // eliminate the check. | ||
| if (sym_is_not_null(self_or_null) && sym_matches_type(callable, &PyType_Type)) { |
Member
There was a problem hiding this comment.
We should make sure self_or_null is null like bytecodes.c
Suggested change
| if (sym_is_not_null(self_or_null) && sym_matches_type(callable, &PyType_Type)) { | |
| if (sym_is_null(self_or_null) && sym_matches_type(callable, &PyType_Type)) { |
| PyType_Watch(TYPE_WATCHER_ID, (PyObject *)type); | ||
| _Py_BloomFilter_Add(dependencies, type); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Same to bytecodes.c:
Suggested change
| } | |
| } | |
| self_or_null = sym_new_not_null(ctx); |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.