Merged
Conversation
Member
Author
itamaro
reviewed
May 3, 2022
Contributor
itamaro
left a comment
There was a problem hiding this comment.
lgtm, thanks @markshannon !
| @@ -1466,6 +1467,11 @@ specialize_py_call(PyFunctionObject *func, _Py_CODEUNIT *instr, int nargs, | |||
| assert(_Py_OPCODE(*instr) == CALL_ADAPTIVE); | |||
| PyCodeObject *code = (PyCodeObject *)func->func_code; | |||
Contributor
There was a problem hiding this comment.
will we want to add a check here for overridden vectorcall on func as well, or is it already covered somewhere else? (assuming the vectorcall set API sets the version to zero)
Lib/test/test_capi.py
Outdated
Comment on lines
1165
to
1170
| def test_specialize_before_intercept(self): | ||
| def func2(): | ||
| pass | ||
| for _ in range(SUFFICIENT_TO_SPECIALIZE): | ||
| func2() | ||
| self.do_test(func2) |
Contributor
There was a problem hiding this comment.
more for my understanding - this test case fails without the added PEP-523 checks? (but the other one passes?)
Member
Author
There was a problem hiding this comment.
Both tests should fail without the checks.
|
|
||
| TARGET(CALL_PY_EXACT_ARGS) { | ||
| assert(call_shape.kwnames == NULL); | ||
| DEOPT_IF(tstate->interp->eval_frame, CALL); |
Contributor
There was a problem hiding this comment.
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 :)
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make sure that we respect PEP 523 when specializing