Title: Interpreter code generators need to be able to handle basic flow control · Issue #123391 · python/cpython · GitHub
Open Graph Title: Interpreter code generators need to be able to handle basic flow control · Issue #123391 · python/cpython
X Title: Interpreter code generators need to be able to handle basic flow control · Issue #123391 · python/cpython
Description: In order to be able to flush the stack efficiently around escaping calls, the interpreter code generators need to be able to handle simple-ish flow control. For example, in this code: op(_CHECK_PERIODIC, (--)) { if (_Py_atomic_load_uintp...
Open Graph Description: In order to be able to flush the stack efficiently around escaping calls, the interpreter code generators need to be able to handle simple-ish flow control. For example, in this code: op(_CHECK_PER...
X Description: In order to be able to flush the stack efficiently around escaping calls, the interpreter code generators need to be able to handle simple-ish flow control. For example, in this code: op(_CHECK_PER...
Opengraph URL: https://github.com/python/cpython/issues/123391
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Interpreter code generators need to be able to handle basic flow control","articleBody":"In order to be able to flush the stack efficiently around escaping calls, the interpreter code generators need to be able to handle simple-ish flow control.\r\n\r\nFor example, in this code:\r\n```\r\n op(_CHECK_PERIODIC, (--)) {\r\n if (_Py_atomic_load_uintptr_relaxed(\u0026tstate-\u003eeval_breaker) \u0026 _PY_EVAL_EVENTS_MASK) {\r\n int err = _Py_HandlePending(tstate);\r\n ERROR_IF(err != 0, error);\r\n }\r\n }\r\n```\r\nThe general shape is:\r\n```\r\n if (cond) {\r\n *escaping_call()*\r\n }\r\n```\r\n\r\nWe want to be able to track the flow control so that we can spill around the call, but not on the fast path:\r\n```\r\n if (cond) {\r\n SPILL_STACK();\r\n *escaping_call()*\r\n RELOAD_STACK();\r\n }\r\n```\r\n\r\nWe cannot currently do this.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-123397\n* gh-123469\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/markshannon","@type":"Person","name":"markshannon"},"datePublished":"2024-08-27T13:26:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/123391/cpython/issues/123391"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:46e609cc-e37c-98da-aa3a-354535402ab1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E150:2DE4E0:9903CC:C885F3:696B5506 |
| html-safe-nonce | dd3a1630ac5584857a1ec326b2a4423f698a46ad832c35eab2ca8874ceddeadd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTUwOjJERTRFMDo5OTAzQ0M6Qzg4NUYzOjY5NkI1NTA2IiwidmlzaXRvcl9pZCI6Ijc4OTU5Njg4NjkzMzM5NDY5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8c51f5e97d7bf84bfad946875ca91754857a966abc7878bb52d1dea506d001b9 |
| hovercard-subject-tag | issue:2489368289 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/python/cpython/123391/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b8429eaffd74e7487b801fdc9fa6cb16fd5b7d0172da6f03bc04ce55f6ba4ba7/python/cpython/issues/123391 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b8429eaffd74e7487b801fdc9fa6cb16fd5b7d0172da6f03bc04ce55f6ba4ba7/python/cpython/issues/123391 |
| og:image:alt | In order to be able to flush the stack efficiently around escaping calls, the interpreter code generators need to be able to handle simple-ish flow control. For example, in this code: op(_CHECK_PER... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markshannon |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| 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 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width