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

JIT code has too many validity checks #131726

Open
Labels
3.14bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetopic-JIT
@brandtbucher

Description

@brandtbucher

We currently remove_CHECK_VALIDITY ops as part of a final linear pass over JIT code, with the heuristic being:

  • If any op escaped since the last validity check, leave it in.
  • Otherwise, remove it.

However, this is too strict. A looser, still correct heuristic would be:

  • If any op escaped since the last validity check,and we have an optimization that relies on that validity before the next validity check, leave it in.
  • Otherwise, remove it.

As a simple example:_POP_TOP escapes. If we have twoPOP_TOP instructions in a row, the JIT will check validity between them, which isn't necessary.

Since it's our optimizations that create a reliance on validity checks, the removal of validity checks and the tracking of validity should be done as part of the abstract interpretation. If could be as simple as callingrequire_validity(ctx); whenever we perform a validity-requiring optimization. This helper would just re-insert the last seen_CHECK_VALIDITY instruction.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetopic-JIT

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp