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

Specialization of some instructions does not conform to PEP 659, and prevents PEP 669 #100982

Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage
@markshannon

Description

@markshannon

As written, PEP 659 says that individual specializations are restricted to a single instruction.
PEP 669 relies on this, as it also wants to replace instructions at runtime, and it would break if specialization occurs across multiple instructions.

Currently there are a two places where we break this design by specializing pairs of instructions together:

  • COMPARE_OPPOP_JUMP_IF_ pairs are specialized together
  • FOR_ITERSTORE_FAST are specialized together

The second will go away with the register VM, and doesn't seem to be an issue in practice.
It is theCOMPARE_OPPOP_JUMP_IF_ specialization that is problematic, as PEP 669 wants to instrument branches.
Instrumenting thePOP_JUMP_IF_ doesn't work if theCOMPARE_OP specialization jumps over it.

The solution is to replace theCOMPARE_OPPOP_JUMP_IF_ pair with a singleCOMPARE_AND_BRANCH instruction that can be specialized or instrumented atomically.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp