-
Notifications
You must be signed in to change notification settings - Fork 49
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
Remove RETURN_CONST
to allow static specialization of RETURN
and LOAD_CONST
bytecodes
#577
Comments
So I think what you are saying is that in Tier 1: (1) For (2) We'd have two variants for (3) (4) In addition we'd need instrumented versions (?). Of course we could choose to only generate the "super" instruction And in Tier 2 there would be no difference -- So yeah, once we're ready to do this (or part of this, e.g. the @markshannon Do you feel that Separately, I'm not sure what benefit we'd get from having |
It might be, but the real benefit of removing
Is that part of the language spec, or can we change that?
The code paths for generators and normal functions are quite different. Most of the work in |
It's not, but changing it might require some refactoring elsewhere (basically, code objects don't have a field to store the docstring). We played with this in the 3.11 era but never dared do it. The rest is clear, thank you. |
With immortal objects and the desire to shrink code objects, we want to add
LOAD_COMMON_CONST
for loadingNone
,True
, etc.The
RETURN
bytecodes do largely different things for generators and normal frames. It would make sense to split this into "normal" and "generator" returns.The existence of
RETURN_CONST
prevents this, as we would need 4 versions of it to allow specialization of return for generator/normal frames and for normal/"common" const.The text was updated successfully, but these errors were encountered: