Skip to content

gh-149217: Avoid adding dependencies on immutable, immortal classes in the JIT#149256

Open
Wulian233 wants to merge 1 commit intopython:mainfrom
Wulian233:watch_type
Open

gh-149217: Avoid adding dependencies on immutable, immortal classes in the JIT#149256
Wulian233 wants to merge 1 commit intopython:mainfrom
Wulian233:watch_type

Conversation

@Wulian233
Copy link
Copy Markdown
Contributor

@Wulian233 Wulian233 commented May 2, 2026

Copy link
Copy Markdown
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

Produces better code, and is net -4 lines 🙂

Copy link
Copy Markdown
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

Actually, there is some code that should be removed.
Will be good once that's done.

@@ -148,8 +148,7 @@ dummy_func(void) {
sym_set_type(owner, probable_type);
sym_set_type_version(owner, type_version);
if ((probable_type->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) == 0) {
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.

Remove this test (which is wrong as it doesn't check for mortalitiy)

@@ -237,8 +236,7 @@ dummy_func(void) {
else {
sym_set_const(owner, type);
if ((((PyTypeObject *)type)->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) == 0) {
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.

Remove this test (which is wrong as it doesn't check for mortalitiy)

@@ -2026,8 +2022,7 @@ dummy_func(void) {
ADD_OP(_SWAP, 3, 0);
optimize_pop_top(ctx, this_instr, method_and_self[0]);
if ((type->tp_flags & Py_TPFLAGS_IMMUTABLETYPE) == 0) {
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.

And this one as well

@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 2, 2026

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants