Title: GH-98831: Implement super-instruction generation by gvanrossum · Pull Request #99084 · python/cpython · GitHub
Open Graph Title: GH-98831: Implement super-instruction generation by gvanrossum · Pull Request #99084 · python/cpython
X Title: GH-98831: Implement super-instruction generation by gvanrossum · Pull Request #99084 · python/cpython
Description: @markshannon Please see "PLEASE NOTE" below.
This is pretty straightforward: the expansion of
super(FOO__BAR) = FOO + BAR;
generates code like this:
TARGET(FOO__BAR) {
{
}
NEXTOPARG();
next_instr++;
{
}
DISPATCH();
}
The only tricky thing is that the code block for LOAD_CONST contains a PREDICTED() macro call, so we strip ththoseat out. (Eventually we'll auto-generate the PREDICTED() macros so we won't need to do this any more, but super-instruction generation is a simpler project than auto-PREDICTED insertion, so I figured I'd tackle it first.)
The new super-instructions are all placed at the end (the parser doesn't keep track of how instruction definitions are interspersed), so the diff for generated_cases.c.h looks perhaps a bit more imposing than it is.
PLEASE NOTE: The code for some of the generated super-instructions is different than the hand-written super-instructions because somehow the hand-written versions moved the NEXTOPARG(); next_instr++; pair up a few lines. I don't know why the originals were written that way -- @markshannon do you remember? Do you think it matters? (Another difference is that the parts each define their own variables, whereas the hand-written versions reused PyObject *value, but I assume the optimizer will handle that.)
Issue: gh-98831
Open Graph Description: @markshannon Please see "PLEASE NOTE" below. This is pretty straightforward: the expansion of super(FOO__BAR) = FOO + BAR; generates code like this: TARGET(FOO__BAR) { { <...
X Description: @markshannon Please see "PLEASE NOTE" below. This is pretty straightforward: the expansion of super(FOO__BAR) = FOO + BAR; generates code like this: TARGET(FOO__BAR) { { ...
Opengraph URL: https://github.com/python/cpython/pull/99084
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:52e7ab38-5369-28d9-2078-9e046f1d42d9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CF7E:CE9E9:5BA22A:802BE3:696A0F45 |
| html-safe-nonce | 48753a1702d500f930dde84d5cdd7463525bdad6de16ae421241455b80721d6a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjdFOkNFOUU5OjVCQTIyQTo4MDJCRTM6Njk2QTBGNDUiLCJ2aXNpdG9yX2lkIjoiNzA1Nzk3MDM0OTcwNTEzNzk4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8c81cab5b55f2872872ad01cb194f301205eb8d4a960e1e332d5378e1765ff3d |
| hovercard-subject-tag | pull_request:1110260194 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/99084/files |
| twitter:image | https://avatars.githubusercontent.com/u/2894642?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/2894642?s=400&v=4 |
| og:image:alt | @markshannon Please see "PLEASE NOTE" below. This is pretty straightforward: the expansion of super(FOO__BAR) = FOO + BAR; generates code like this: TARGET(FOO__BAR) { { <... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width