-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-128563: Move lltrace into the frame struct #129113
gh-128563: Move lltrace into the frame struct #129113
Conversation
Fidget-Spinner
commented
Jan 21, 2025
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: A new tail-calling interpreter for significantly better interpreter performance #128563
This reverts commit 6ba4e59.
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.
The change to the size of the frame can be avoided by using a bitfield.
I'm curious why the atomic loads and stores are needed.
When you're done making the requested changes, leave the comment: |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @markshannon: please review the changes made to this pull request. |
Include/internal/pycore_frame.h
Outdated
@@ -76,7 +76,12 @@ typedef struct _PyInterpreterFrame { | |||
_PyStackRef *stackpointer; | |||
uint16_t return_offset; /* Only relevant during a function call */ | |||
char owner; | |||
#ifdef Py_DEBUG | |||
char visited:4; | |||
char lltrace:4; |
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.
Why 4?
You only need one bit (although it is best to use uint8_t
as the signedness of char
is implementation defined.
My mistake, lltrace
is not boolean.
Since char
might be signed, it is best to make this a uint8_t
to avoid overflow for PYTHON_LLTRACE=9
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.
One small issue, otherwise looks good.
lltrace
should be unsigned (uint8_t
), and maybe bigger, to avoid overflow. visited
only needs one bit, so lltrace
could use the rest.
For consistency, make visited
a uint8_t
in the non-debug build as well.
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.
Looks good.
Sorry for being late here. These lines seem to be unused, since the PR did not have to touch them? Lines 1066 to 1071 in 05d12ee
|
@chris-eibl it seems so. If you would like to, could you please open a PR to either update to fix them or remove them? Thanks! |
Yeah, but since this is gonna be my first PR, I'll have to work myself through the devguide. Most probably not before the weekend ... |