Skip to content

GH-109369: Exit tier 2 if executor is invalid - #111657

Merged
markshannon merged 11 commits into
python:mainfrom
faster-cpython:exit-if-invalid
Nov 9, 2023
Merged

markshannon merged 11 commits into
python:mainfrom
faster-cpython:exit-if-invalid

Conversation

@markshannon

@markshannon markshannon commented Nov 2, 2023 •

Copy link
Copy Markdown
Member

Fixes GH-109369.
Adds a _CHECK_VALIDITY uop which is inserted after any escaping operations.
Ensures that uop traces will be exited promptly if the code is instrumented.

@markshannon
markshannon marked this pull request as ready for review November 6, 2023 14:36
Comment thread Python/optimizer.c Resolved
Comment thread Tools/cases_generator/flags.py Resolved
markshannon and others added 2 commits November 8, 2023 12:28
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Comment thread Python/optimizer_analysis.c Resolved
@brandtbucher

Copy link
Copy Markdown
Member

So, on the JIT branch, we don't actually keep the executor handy when executing instructions (only when entering/exiting traces). I'm guessing we'll need it a lot more in the future once we start doing stitching and such, but I wonder: can we just stick it on the tstate or the frame? It feels a bit painful to dedicate a register to this thing, especially since it'll be hardly used in optimized traces (I think).

Not a big deal though, and can be deferred to a later date. Just something to ponder, or to do if it's easy now.

@brandtbucher

brandtbucher commented Nov 8, 2023 •

Copy link
Copy Markdown
Member

Idea: put the executor's address in _CHECK_VALIDITY's operand? Then the JIT would require no modifications to support this change.

@brandtbucher

Copy link
Copy Markdown
Member

Ah, never mind, the JIT can burn in the executor. I withdraw my comments. :)

@markshannon
markshannon merged commit 25c4956 into python:main Nov 9, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@markshannon
markshannon deleted the exit-if-invalid branch August 6, 2024 10:18
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants