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-129709: Clean up tier two#129710

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
brandtbucher merged 5 commits intopython:mainfrombrandtbucher:clean-up-tier-two
Feb 7, 2025

Conversation

brandtbucher
Copy link
Member

@brandtbucherbrandtbucher commentedFeb 6, 2025
edited by bedevere-appbot
Loading

Sort of a grab-bag of improvements:

  • Silence some unused variable warnings in the tier two interpreter.
  • Replace the one remaining use ofGOTO_ERROR(error) withERROR_NO_POP().
  • Fix some bad format strings used for tier two debugging output.
  • Replace the handful of uses ofGOTO_UNWIND withGOTO_TIER_ONE, replaceEXIT_TO_TIER1 withGOTO_TIER_ONE, unify thegoto_to_tier1,exit_to_tier1, anderror_tier_two labels into theGOTO_TIER_ONE macro, and remove the unusedexit_to_tier1_dynamic label andEXIT_TO_TIER1_DYNAMIC macro.
  • Replace separatePy_DECREF andNULLs oftstate->previous_executor withPy_CLEAR calls, sincePy_DECREF escapes.
  • Move the refcounting to keep the first JIT executor alive from the shim frame into theGOTO_TIER_TWO macro.
  • Add aCURRENT_TARGET macro so the same return-to-tier-one logic can be shared by the interpreter and JIT.
  • Remove a bunch of unnecessary(void)item; lines from the abstract interpreter (these were ironically forcing the values to be loaded).
  • Mark_PyFrame_GetBytecode as non-escaping.
  • Use the samePATCH_VALUE implementation for the JIT templates and the shim frame.
  • Perform the same cleanups in the JIT that were done in the interpreter.

@markshannon
Copy link
Member

Replace separate Py_DECREF and NULLs of tstate->previous_executor with Py_CLEAR calls, since Py_DECREF escapes.

Py_CLEAR also escapes, so what does this do?

@brandtbucher
Copy link
MemberAuthor

Py_CLEAR also escapes, so what does this do?

Py_CLEAR setststate->previous_executor = NULL before the decref, so there's no chance of re-entering the interpreter/JIT with a staleprevious_executor. We assert that it'sNULL in a bunch of places.

Copy link
Member

@markshannonmarkshannon left a comment

Choose a reason for hiding this comment

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

One question, otherwise looks good.

@brandtbucherbrandtbucher merged commit70e387c intopython:mainFeb 7, 2025
73 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@markshannonmarkshannonmarkshannon approved these changes

@Fidget-SpinnerFidget-SpinnerAwaiting requested review from Fidget-SpinnerFidget-Spinner is a code owner

@savannahostrowskisavannahostrowskiAwaiting requested review from savannahostrowskisavannahostrowski is a code owner

Assignees

@brandtbucherbrandtbucher

Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)skip newstopic-JIT
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@brandtbucher@markshannon

[8]ページ先頭

©2009-2025 Movatter.jp