Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-145866: Eliminate redundant refcounting from_CALL_INTRINSIC_2#146262

Open
KevinH15291 wants to merge 1 commit intopython:mainfrom
KevinH15291:gh-145866-call_intrinsic_2
Open

gh-145866: Eliminate redundant refcounting from_CALL_INTRINSIC_2#146262
KevinH15291 wants to merge 1 commit intopython:mainfrom
KevinH15291:gh-145866-call_intrinsic_2

Conversation

@KevinH15291
Copy link

@KevinH15291KevinH15291 commentedMar 21, 2026
edited
Loading

@python-cla-bot
Copy link

python-cla-botbot commentedMar 21, 2026
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@KevinH15291
Copy link
Author

This is my first CPython PR and I'm not very experienced. This PR largely just copies the style of the other PRs in#145866 and#134584, mainly#145964.

I'm not sure if

self.assertLessEqual(count_ops(ex,"_POP_TOP"),4)

in my test is completely correct, as well as my testfunc

deftestfunc(n):x=0for_inrange(n):deftest_testfunc[T](n):passreturnx

I'm also not 100% sure if regenerated the opcode metadata stuff correctly. Otherwise I believe the PR should be good.

Copy link
Member

@Fidget-SpinnerFidget-Spinner left a comment

Choose a reason for hiding this comment

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

Nice, this looks really good, thanks for doing this!

uops = get_opnames(ex)

self.assertIn("_CALL_INTRINSIC_2", uops)
self.assertEqual(count_ops(ex, "_POP_TOP_NOP"), 2)

Choose a reason for hiding this comment

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

GreaterEqual might be better. Also did you count how manyPOP_TOP_NOPs this produces? You can print the trace logs by compiling with the tier 2 interpreter (--enable-experimental-jit=interpreter) and passing the env varPYTHON_LLTRACE=2.

Copy link
Author

Choose a reason for hiding this comment

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

Well honestly, I got lucky; I doubled the numbers used in the test for_CALL_INTRINSIC_1. Later I did verify this, by uh, modifying the end of the test function to printuops, and looking at the printed output, as I was not aware ofPYTHON_LLTRACE=2 yet.

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

Reviewers

@Fidget-SpinnerFidget-SpinnerFidget-Spinner left review comments

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@tomasr8tomasr8Awaiting requested review from tomasr8tomasr8 is a code owner

@savannahostrowskisavannahostrowskiAwaiting requested review from savannahostrowskisavannahostrowski is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@KevinH15291@Fidget-Spinner@savannahostrowski

[8]ページ先頭

©2009-2026 Movatter.jp