Title: `n_popped`, `n_pushed` is the wrong abstraction for stack effect · Issue #105034 · python/cpython · GitHub
Open Graph Title: `n_popped`, `n_pushed` is the wrong abstraction for stack effect · Issue #105034 · python/cpython
X Title: `n_popped`, `n_pushed` is the wrong abstraction for stack effect · Issue #105034 · python/cpython
Description: The code generator produces metadata for use by the compiler that tells it how many stack entries were pushed and popped by an opcode. These two quantities are subtracted to compute the net stack effect. (The metadata is in the form of f...
Open Graph Description: The code generator produces metadata for use by the compiler that tells it how many stack entries were pushed and popped by an opcode. These two quantities are subtracted to compute the net stack e...
X Description: The code generator produces metadata for use by the compiler that tells it how many stack entries were pushed and popped by an opcode. These two quantities are subtracted to compute the net stack e...
Opengraph URL: https://github.com/python/cpython/issues/105034
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`n_popped`, `n_pushed` is the wrong abstraction for stack effect","articleBody":"The code generator produces metadata for use by the compiler that tells it how many stack entries were pushed and popped by an opcode. These two quantities are subtracted to compute the net stack effect. (The metadata is in the form of functions `_PyOpcode_num_popped` and `_PyOpcode_num_pushed` in opcode_metadata.h.)\r\n\r\nBut what we really need to know, if we want accurate information about what an opcode (or micro-op) does to the stack, is *three* numbers: how low it goes, how high it goes, and where it ends. For example, if we have a micro-op that pops two entries and then pushes one, and another that pushes two and then pops one, and we combine them into a macro, the macro's net effect is zero, but the lowest point is two below the initial stack level, and the highest point is one above it.\r\n\r\nThere are various ways to express this, but there is no way to express all this information with just two numbers.\r\n\r\nNote that the relevant calculation is already present in the generator, as part of `analyze_macro()`.","author":{"url":"https://github.com/gvanrossum","@type":"Person","name":"gvanrossum"},"datePublished":"2023-05-28T01:13:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/105034/cpython/issues/105034"}
| 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:65907835-78d8-f410-aabd-3690f01596c0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5D2:3545E1:1AABDAC:228D893:696B319C |
| html-safe-nonce | ff5b8a8c3f0876a10379003d833c316302228649fa3b59517b4ff469a1650b65 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUQyOjM1NDVFMToxQUFCREFDOjIyOEQ4OTM6Njk2QjMxOUMiLCJ2aXNpdG9yX2lkIjoiNjQwMjYyNTUyNjUwOTAyMzY0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 016bc820b2c7935180dcf63c60ac132b7ff5a66039a4771150bb076087bf484e |
| hovercard-subject-tag | issue:1729064552 |
| 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/105034/issue_layout |
| twitter:image | https://opengraph.githubassets.com/61650bbc2fe25f48f34a76f48176bba8666e8261e631bca5780cfd01ab7bf267/python/cpython/issues/105034 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/61650bbc2fe25f48f34a76f48176bba8666e8261e631bca5780cfd01ab7bf267/python/cpython/issues/105034 |
| og:image:alt | The code generator produces metadata for use by the compiler that tells it how many stack entries were pushed and popped by an opcode. These two quantities are subtracted to compute the net stack e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gvanrossum |
| 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