Title: gh-115999: Stop the world when invalidating function versions by mpage · Pull Request #124997 · python/cpython · GitHub
Open Graph Title: gh-115999: Stop the world when invalidating function versions by mpage · Pull Request #124997 · python/cpython
X Title: gh-115999: Stop the world when invalidating function versions by mpage · Pull Request #124997 · python/cpython
Description: The tier1 interpreter specializes CALL instructions based on the values of certain function attributes (e.g. __code__, __defaults__). The tier1 interpreter uses function versions to verify that the attributes of a function during execution of a specialization match those seen during specialization. A function's version is initialized in MAKE_FUNCTION and is invalidated when any of the critical function attributes are changed. The tier1 interpreter stores the function version in the inline cache during specialization. A guard is used by the specialized instruction to verify that the version of the function on the operand stack matches the cached version (and therefore has all of the expected attributes). It is assumed that once the guard passes, all attributes will remain unchanged while executing the rest of the specialized instruction. Stopping the world when invalidating function versions ensures that all critical function attributes will remain unchanged after the function version guard passes in free-threaded builds. It's important to note that this is only true if the remainder of the specialized instruction does not enter and exit a stop-the-world point. We will stop the world the first time any of the following function attributes are mutated: defaults vectorcall kwdefaults closure code This should happen rarely and only happens once per function, so the performance impact on majority of code should be minimal. Additionally, refactor the API for manipulating function versions to more clearly match the stated semantics. Issue: gh-115999
Open Graph Description: The tier1 interpreter specializes CALL instructions based on the values of certain function attributes (e.g. __code__, __defaults__). The tier1 interpreter uses function versions to verify that the...
X Description: The tier1 interpreter specializes CALL instructions based on the values of certain function attributes (e.g. __code__, __defaults__). The tier1 interpreter uses function versions to verify that the...
Opengraph URL: https://github.com/python/cpython/pull/124997
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:59529cfd-8d02-dab3-5959-a3640934e686 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AF62:21B953:7E0CB:A892B:6A567400 |
| html-safe-nonce | 684b53ced082800b7bc96a034e3e9d44d00c3f3b822277dcbea0cc0e81a806cb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjYyOjIxQjk1Mzo3RTBDQjpBODkyQjo2QTU2NzQwMCIsInZpc2l0b3JfaWQiOiIxOTU5MjY5NDI1NDM1MDE0MTQ0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d7825b6c2fd866818ecbac5dc32cadd15f6129c89abe8351ad7681157b805cb1 |
| hovercard-subject-tag | pull_request:2108610099 |
| 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/124997/files |
| twitter:image | https://avatars.githubusercontent.com/u/577841?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/577841?s=400&v=4 |
| og:image:alt | The tier1 interpreter specializes CALL instructions based on the values of certain function attributes (e.g. __code__, __defaults__). The tier1 interpreter uses function versions to verify that the... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b5ee9431dcfce15ab4b001d626e4e3a6ba1acb7be814813a52bbebd9a86ef5 |
| 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 | afc01ffdb045f4ff81c6122091366ade7b6166b7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width