Skip to content
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

bpo-45923: Handle call events in bytecode #30364

Merged

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jan 3, 2022

This PR:

Adds a RESUME instruction which is a no-op unless tracing is active.
This replaces the current approach of testing for tracing on every call or resume.
In itself this has no real effect, but will enable faster dispatch and more streamlined tracing in the future.

No significant impact on performance

https://bugs.python.org/issue45923

@markshannon
Copy link
Member Author

@lpereira

@lpereira
Copy link
Contributor

lpereira commented Jan 4, 2022

Ah, you did something I suggested a while back: instead of the START_FUNCTION opcode as you suggested a while back, you're doing this where you'd actually would jump to start_function. I'll go ahead and implement the quickening to NOP these too. The patch I wrote had also a new RETURN_VALUE_QUICK opcode that skipped some things if tracing was disabled. So I might combine the patches.

@markshannon markshannon requested a review from a team as a code owner January 4, 2022 14:08
@markshannon markshannon removed the request for review from a team January 4, 2022 14:20
@markshannon
Copy link
Member Author

Might even be a bit faster although I suspect that is just random fluctuations.

Copy link
Member

@brandtbucher brandtbucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good! I like the direction we're headed in with this stuff.

Just a few questions:

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

And if you don't make the requested changes, you will be poked with soft cushions!

@markshannon
Copy link
Member Author

Merging this now to get it into 3.11a4 and provide a fix/workaround for https://bugs.python.org/issue46225

@markshannon markshannon merged commit e028ae9 into python:main Jan 6, 2022
@markshannon markshannon deleted the handle-call-events-in-bytecode branch January 6, 2022 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants