-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
bpo-46564: Optimize super().meth()
calls via adaptive superinstructions
#30992
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
3b12d1b
5b7a98d
efb0ae3
e037a56
9d64819
ac19aa1
1f9bb6c
f4cd3f9
19880a9
696a0e8
01202ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5088,7 +5088,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | |
PyObject *super_callable = TOP(); | ||
|
||
DEOPT_IF(_PyType_CAST(super_callable) != &PySuper_Type, CALL); | ||
|
||
/* super() - zero argument form */ | ||
if (_PySuper_GetTypeArgs(frame, frame->f_code, &su_type, &su_obj) < 0) { | ||
PyErr_Clear(); | ||
|
@@ -5097,7 +5096,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | |
assert(su_obj != NULL); | ||
DEOPT_IF(lm_adaptive->version != Py_TYPE(su_obj)->tp_version_tag, CALL); | ||
DEOPT_IF(cache0->version != su_type->tp_version_tag, CALL); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When can this fail? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
8000
I wanted assurance that |
||
|
||
STAT_INC(CALL, hit); | ||
|
||
/* LOAD_METHOD_CACHED */ | ||
|
@@ -5133,11 +5131,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | |
PyObject *meth; | ||
|
||
DEOPT_IF(_PyType_CAST(super_callable) != &PySuper_Type, CALL); | ||
|
||
assert(su_obj != NULL); | ||
DEOPT_IF(lm_adaptive->version != Py_TYPE(su_obj)->tp_version_tag, CALL); | ||
DEOPT_IF(cache0->version != su_type->tp_version_tag, CALL); | ||
|
||
STAT_INC(CALL, hit); | ||
|
||
(void)(POP()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we do this at specialization time? The number of locals, the index of "self", and whether it is a cell are all known then. Likewise the nature of
__class__
is also known.