JIT: remove all uses of _PyType_LookupByVersion in optimizer_bytecodes.c
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Feature or enhancement
Proposal:
We should use recorded values instead, as that is not bounded by a limited-size cache, and it will be easier to make the optimizer thread safe for FT. See for example how I use recorded values for guards in this commit https://github.com/python/cpython/pull/148277/commits/8fab9d33c998d9c50a85f7705d0205aa175d03ab
Ops that need converting:
- _CHECK_ATTR_CLASS
- _GUARD_TYPE_VERSION
@NekoAsakura would you like to work on this?
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-148394
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in optimizer_bytecodes.c and inspect the remaining _CHECK_ATTR_CLASS use of _PyType_LookupByVersion, using the linked commit and PR 148277 as context for recorded-value guards. Check PR 148394 because the issue lists linked work. Done means the remaining listed operation is converted and its relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100