René's URL Explorer Experiment


Title: GH-98831: Support cache effects in super- and macro instructions by gvanrossum · Pull Request #99601 · python/cpython · GitHub

Open Graph Title: GH-98831: Support cache effects in super- and macro instructions by gvanrossum · Pull Request #99601 · python/cpython

X Title: GH-98831: Support cache effects in super- and macro instructions by gvanrossum · Pull Request #99601 · python/cpython

Description: Note: this doesn't yet support cache effects in the macro definition itself (e.g. macro(X) = counter/1 + FOO + BAR + unused/2). That seems something for a follow-up (we don't even have a use case for the current thing yet). Details (From two original commits that were since merged.) Super-instructions can now have cache effects. To do this I mostly just had to move the cache effects code into Instr*.write_body(), reducing the responsibilities of Instr*.write(). (I also had to fiddle a bit with indents.) For macros the same approach would almost work, except that next_instr might point in the middle of the cache when we encounter DEOPT_IF() or ERROR_IF() in a second or further component. I have to think more about that. NOTES: There is no test example yet (I manually tested it with a fake new super-instruction). The cache-related generated code is in different place. This shouldn't matter. Macro instructions can now also have cache effects. We pass the initial cache offset into write_body(). This is a little fiddly because everything is different for super-instructions vs macros: For super, cache_adjust is always zero because we bump next_instr after each op. For macro, cache_adjust accumulates previous cache offsets, and we bump next_instr at the end. Also, I had to move the bump of next_instr back into Instr*.write(). It is better placed there anyway because that function avoids the bump if the C code already ends in a goto, return or DISPATCH*() call. (The previous commit emitted one unreachable bump, which is now fixed.) Tested manually. NOTES There's more refactoring coming. Also included: Fix dedent of comments in to_text() Flatten InstDef Improve CLI help output Other refactoring (quite a bit, sorry) Issue: gh-98831

Open Graph Description: Note: this doesn't yet support cache effects in the macro definition itself (e.g. macro(X) = counter/1 + FOO + BAR + unused/2). That seems something for a follow-up (we don't even have a us...

X Description: Note: this doesn't yet support cache effects in the macro definition itself (e.g. macro(X) = counter/1 + FOO + BAR + unused/2). That seems something for a follow-up (we don't even h...

Opengraph URL: https://github.com/python/cpython/pull/99601

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e08d9c66-486e-9d2d-c178-26c1cce4bf15
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB21C:87739:4DFE3D:6E41FE:696A1793
html-safe-nonce92d689c9c8936dc800bb88afe1324f41486fddacc20e16ef09e4a8edbc9749cb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjFDOjg3NzM5OjRERkUzRDo2RTQxRkU6Njk2QTE3OTMiLCJ2aXNpdG9yX2lkIjoiMTY4MzI4NTI1NTE1OTE1ODY3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7c6cf0626d1ca24e1f949efe488e51d26673898b43a756cd11b5788512a54a31
hovercard-subject-tagpull_request:1128907643
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/99601/files
twitter:imagehttps://avatars.githubusercontent.com/u/2894642?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/2894642?s=400&v=4
og:image:altNote: this doesn't yet support cache effects in the macro definition itself (e.g. macro(X) = counter/1 + FOO + BAR + unused/2). That seems something for a follow-up (we don't even have a us...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None34a52bd10bd674f68e5c1b6b74413b79bf2ca20c551055ace3f7cdd112803923
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee8bd37502700f365b18a4d39acf7cb7947e11b1a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/99601/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F99601%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F99601%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/99601/files
Reloadhttps://github.com/python/cpython/pull/99601/files
Reloadhttps://github.com/python/cpython/pull/99601/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/99601/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/99601/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
gvanrossumhttps://github.com/gvanrossum
python:mainhttps://github.com/python/cpython/tree/main
gvanrossum:macro-cache-effectshttps://github.com/gvanrossum/cpython/tree/macro-cache-effects
Conversation 23 https://github.com/python/cpython/pull/99601
Commits 7 https://github.com/python/cpython/pull/99601/commits
Checks 0 https://github.com/python/cpython/pull/99601/checks
Files changed https://github.com/python/cpython/pull/99601/files
Please reload this pagehttps://github.com/python/cpython/pull/99601/files
GH-98831: Support cache effects in super- and macro instructions https://github.com/python/cpython/pull/99601/files#top
Show all changes 7 commits https://github.com/python/cpython/pull/99601/files
e6d8fdf Fix dedent of comments in to_text() gvanrossum Nov 23, 2022 https://github.com/python/cpython/pull/99601/commits/e6d8fdf0757277b61c08a9e158c427d84ade9440
2731077 Implement cache effects for super- and macro instruction gvanrossum Nov 23, 2022 https://github.com/python/cpython/pull/99601/commits/27310777f0ca0c9a4bb3fc4125610ceda3b81181
5c97e3f Regenerated cases gvanrossum Nov 23, 2022 https://github.com/python/cpython/pull/99601/commits/5c97e3f4f12b93b200ce56483983bd334459812f
a3af889 Consistently rename sup(er), mac(ro) gvanrossum Nov 23, 2022 https://github.com/python/cpython/pull/99601/commits/a3af8899729f0542fe215ef825ca413e1615e7fd
4687fba Flatten InstDef; improve CLI help output gvanrossum Nov 23, 2022 https://github.com/python/cpython/pull/99601/commits/4687fba9f3f9d34f634d3bed862f41edcc46162d
59e63d4 Tweak the structure of Instruction and {Super,Macro}Instruction gvanrossum Nov 24, 2022 https://github.com/python/cpython/pull/99601/commits/59e63d40c4eb2739d1bbeb823032895127982ec3
d5717e3 Refactor write_{super,macro} to share more code gvanrossum Nov 24, 2022 https://github.com/python/cpython/pull/99601/commits/d5717e3670a41b7f8a3dac08f80f41ffe13c0d5b
Clear filters https://github.com/python/cpython/pull/99601/files
Please reload this pagehttps://github.com/python/cpython/pull/99601/files
Please reload this pagehttps://github.com/python/cpython/pull/99601/files
generated_cases.c.h https://github.com/python/cpython/pull/99601/files#diff-4ef46fa654f95502e49a24f7dc8ee31a4cac9b3433fe9cd2b2d4dd78cfbad448
generate_cases.py https://github.com/python/cpython/pull/99601/files#diff-65feee563fa44b472b07751184c6f557699f84b3c2ef79174bfd5d538d748272
lexer.py https://github.com/python/cpython/pull/99601/files#diff-6540be8db4a255ba36e1b4dea6cf12db11ee7c44e29bfd3c0a4d4f53bb8ef2d8
parser.py https://github.com/python/cpython/pull/99601/files#diff-bc6851ce97efb76ebfd0bc2f37d62ac0902080d0749be72d29d978f0ee2fa0e4
Python/generated_cases.c.hhttps://github.com/python/cpython/pull/99601/files#diff-4ef46fa654f95502e49a24f7dc8ee31a4cac9b3433fe9cd2b2d4dd78cfbad448
View file https://github.com/gvanrossum/cpython/blob/d5717e3670a41b7f8a3dac08f80f41ffe13c0d5b/Python/generated_cases.c.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/99601/files
Please reload this pagehttps://github.com/python/cpython/pull/99601/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.