FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL by iritkatriel · Pull Request #101529 · python/cpython · GitHub

/ cpython Public

gh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL - #101529

Merged
iritkatriel merged 2 commits into
python:mainfrom
iritkatriel:slice_etc
Feb 3, 2023
Merged

gh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL#101529
iritkatriel merged 2 commits into
python:mainfrom
iritkatriel:slice_etc

Conversation

iritkatriel commented Feb 3, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

iritkatriel added skip news interpreter-core (Objects, Python, Grammar, and Parser dirs) 🔨 test-with-buildbots Test PR w/ buildbots; report in status section labels Feb 3, 2023

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @iritkatriel for commit 90ff55e 🤖

If you want to schedule another build, you need to add the :hammer: test-with-buildbots label again.

bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Feb 3, 2023
Comment thread Python/bytecodes.c
kwdefaults if (oparg & 0x02),
annotations if (oparg & 0x04),
closure if (oparg & 0x08),
codeobj -- func)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Too bad we can't write func: PyFunctionObject * yet -- I've gotta add that to the grammar, it would add the casts and save the ugly extra func_obj variable.

Comment thread Python/bytecodes.c
Comment on lines 3042 to 3037
Py_DECREF(start);
Py_DECREF(stop);
Py_XDECREF(step);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Oh, we should augment DECREF_INPUTS() to use XDECREF for conditional inputs.

Comment on lines +3584 to +3591
PyObject *annotations = (oparg & 0x04) ? PEEK(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0)) : NULL;
PyObject *kwdefaults = (oparg & 0x02) ? PEEK(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0)) : NULL;
PyObject *defaults = (oparg & 0x01) ? PEEK(1 + ((oparg & 0x08) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x01) ? 1 : 0)) : NULL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let's hope the compiler optimizes this. (Though it's not perf critical.)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL