Title: Add `INSTRUCTION_SIZE` macro to code generator. · Issue #118423 · python/cpython · GitHub
Open Graph Title: Add `INSTRUCTION_SIZE` macro to code generator. · Issue #118423 · python/cpython
X Title: Add `INSTRUCTION_SIZE` macro to code generator. · Issue #118423 · python/cpython
Description: In bytecodes.c we use both next_instr - this_instr and 1 + INLINE_CACHE_ENTRIES_... to mean "instruction length". We should add a macro for the purpose that is understood by the code generator. Examples The somewhat confusing LOAD_IP(1 +...
Open Graph Description: In bytecodes.c we use both next_instr - this_instr and 1 + INLINE_CACHE_ENTRIES_... to mean "instruction length". We should add a macro for the purpose that is understood by the code generator. Exa...
X Description: In bytecodes.c we use both next_instr - this_instr and 1 + INLINE_CACHE_ENTRIES_... to mean "instruction length". We should add a macro for the purpose that is understood by the code gene...
Opengraph URL: https://github.com/python/cpython/issues/118423
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add `INSTRUCTION_SIZE` macro to code generator.","articleBody":"In bytecodes.c we use both `next_instr - this_instr` and `1 + INLINE_CACHE_ENTRIES_...` to mean \"instruction length\".\r\nWe should add a macro for the purpose that is understood by the code generator.\r\n\r\n### Examples\r\n\r\nThe somewhat confusing `LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND);` would become `LOAD_IP(INSTRUCTION_LENGTH)` \r\n\r\n`frame->return_offset = (uint16_t)(next_instr - this_instr);` would become `frame->return_offset = INSTRUCTION_LENGTH;` which is both easier to understand and wouldn't be rejected as tier 2 code.\r\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-125467\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/markshannon","@type":"Person","name":"markshannon"},"datePublished":"2024-04-30T10:32:45Z","url":"https://github.com/python/cpython/issues/118423"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:e3da8e60-7ffe-3b9b-ee07-1de32e3e8325 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8758:26E210:4473BC:59CCFD:6B023C4E |
| html-safe-nonce | 3028f681dd2f7d3d00f3fcd2db0d18f1a50b5c1e25894c1052dffcea670024c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzU4OjI2RTIxMDo0NDczQkM6NTlDQ0ZEOjZCMDIzQzRFIiwidmlzaXRvcl9pZCI6IjQ3NjEzNDgzNjA0MjQ3OTkzMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 440a3be3fd5fd3cb8f37ab8064f6d2fa7e372f45898ace41f2d3593bcee7d41f |
| hovercard-subject-tag | issue:2271101866 |
| 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/118423/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c3e8148195d193ccd991172dcf1130f89ec9344f9f369686409033a5517dd8f/python/cpython/issues/118423 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c3e8148195d193ccd991172dcf1130f89ec9344f9f369686409033a5517dd8f/python/cpython/issues/118423 |
| og:image:alt | In bytecodes.c we use both next_instr - this_instr and 1 + INLINE_CACHE_ENTRIES_... to mean "instruction length". We should add a macro for the purpose that is understood by the code generator. Exa... |
| 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 | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width