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-105481: remove regen-opcode. Generated _PyOpcode_Caches in regen-cases.#108367

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
iritkatriel merged 5 commits intopython:mainfromiritkatriel:caches
Aug 23, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatrieliritkatriel commentedAug 23, 2023
edited by bedevere-bot
Loading

if instr.cache_offset > 0:
self.out.emit(f'[{name}] = {instr.cache_offset},')
# Irregular case:
self.out.emit('[JUMP_BACKWARD] = 1,')
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

How should we deal with this case?

Copy link
Member

Choose a reason for hiding this comment

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

Put JUMP_BACKWARD in a family of its own, and add the cache effect notation to itsinstr? Or is that a problem because it's also part of the JUMP pseudo?

If it's complicated I'm fine with leaving this special case.

iritkatriel reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

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

Alas, it looks like it's in a pseudo with JUMP_FORWARD and those are required to have the same size. Maybe that requirement is too strict?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

In an offline discussion with@markshannon we decided to add a family forJUMP_BACKWARD which would declare its cache size. This causes the generator to emit an assertion that the cache size declared for the family (1) is equal to that which is calculated from the instruction signature (0). If I add the cache to the signature, then I get an error about the pseudo-instructions forJUMP (JUMP_FORWARD andJUMP_BACKWARD) not having the same instruction format.

So there is something here that we need to resolve, and it's not a trivial change. I suggest we commit this PR (which is large enough) with the workaround on line 553, and resolve it in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. LGTM.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ah, I didn't see your comment before I wrote this ^. Yes, we seem to agree.

if instr.cache_offset > 0:
self.out.emit(f'[{name}] = {instr.cache_offset},')
# Irregular case:
self.out.emit('[JUMP_BACKWARD] = 1,')
Copy link
Member

Choose a reason for hiding this comment

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

Put JUMP_BACKWARD in a family of its own, and add the cache effect notation to itsinstr? Or is that a problem because it's also part of the JUMP pseudo?

If it's complicated I'm fine with leaving this special case.

iritkatriel reacted with thumbs up emoji
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
@bedevere-bot
Copy link

There's a new commit after the PR has been approved.

@gvanrossum: please review the changes made to this pull request.

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

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@gvanrossumgvanrossumAwaiting requested review from gvanrossum

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Generate opcode metadata from bytecodes.c instead of opcode.py
3 participants
@iritkatriel@bedevere-bot@gvanrossum

[8]ページ先頭

©2009-2025 Movatter.jp