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-92239: Respect PEP 523#92245

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
markshannon merged 4 commits intopython:mainfromfaster-cpython:fix-92239
May 4, 2022
Merged

Conversation

@markshannon
Copy link
Member

Make sure that we respect PEP 523 when specializing

@markshannon
Copy link
MemberAuthor

@itamaro

Copy link
Contributor

@itamaroitamaro left a comment

Choose a reason for hiding this comment

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

lgtm, thanks@markshannon !

{
_PyCallCache*cache= (_PyCallCache*)(instr+1);
assert(_Py_OPCODE(*instr)==CALL_ADAPTIVE);
PyCodeObject*code= (PyCodeObject*)func->func_code;
Copy link
Contributor

Choose a reason for hiding this comment

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

will we want to add a check here for overriddenvectorcall onfunc as well, or is it already covered somewhere else? (assuming the vectorcall set API sets the version to zero)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think we want to check for that in#92257

Comment on lines 1165 to 1170
deftest_specialize_before_intercept(self):
deffunc2():
pass
for_inrange(SUFFICIENT_TO_SPECIALIZE):
func2()
self.do_test(func2)
Copy link
Contributor

Choose a reason for hiding this comment

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

more for my understanding - this test case fails without the addedPEP-523 checks? (but the other one passes?)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Both tests should fail without the checks.


TARGET(CALL_PY_EXACT_ARGS) {
assert(call_shape.kwnames==NULL);
DEOPT_IF(tstate->interp->eval_frame,CALL);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know how to verify that these opcodes (CALL_PY_EXACT_ARGS &CALL_PY_WITH_DEFAULTS) are the only ones where this check is needed - I trust you :)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Specializations ofCALL andPRECALL listedhere andhere

@markshannonmarkshannon merged commitf8a2fab intopython:mainMay 4, 2022
@markshannonmarkshannon deleted the fix-92239 branchSeptember 26, 2023 12:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@itamaroitamaroitamaro left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@markshannon@itamaro@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp