-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-131798: JIT: Split CALL_ISINSTANCE
into several uops
#133339
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
43ec167
0ab70a9
900472a
6f49dca
8ba53c3
6e11442
be50e24
ec61bc5
b0b31dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4353,26 +4353,25 @@ dummy_func( | |
res = PyStackRef_FromPyObjectSteal(res_o); | ||
} | ||
|
||
op(_GUARD_CALLABLE_ISINSTANCE, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) { | ||
op(_GUARD_CALLABLE_ISINSTANCE, (callable, unused, unused, unused -- callable, unused, unused, unused)) { | ||
PyObject *callable_o = PyStackRef_AsPyObjectBorrow(callable); | ||
PyInterpreterState *interp = tstate->interp; | ||
DEOPT_IF(callable_o != interp->callable_cache.isinstance); | ||
} | ||
|
||
op(_CALL_ISINSTANCE, (callable, null, args[oparg] -- res)) { | ||
op(_CALL_ISINSTANCE, (callable, null, inst_, cls -- res)) { | ||
/* isinstance(o, o2) */ | ||
assert(oparg == 2); | ||
STAT_INC(CALL, hit); | ||
PyObject *inst = PyStackRef_AsPyObjectBorrow(args[0]); | ||
PyObject *cls = PyStackRef_AsPyObjectBorrow(args[1]); | ||
int retval = PyObject_IsInstance(inst, cls); | ||
PyObject *inst_o = PyStackRef_AsPyObjectBorrow(inst_); | ||
PyObject *cls_o = PyStackRef_AsPyObjectBorrow(cls); | ||
int retval = PyObject_IsInstance(inst_o, cls_o); | ||
if (retval < 0) { | ||
ERROR_NO_POP(); | ||
} | ||
(void)null; // Silence compiler warnings about unused variables | ||
PyStackRef_CLOSE(cls); | ||
PyStackRef_CLOSE(inst_); | ||
|
||
DEAD(null); | ||
PyStackRef_CLOSE(args[0]); | ||
PyStackRef_CLOSE(args[1]); | ||
PyStackRef_CLOSE(callable); | ||
res = retval ? PyStackRef_True : PyStackRef_False; | ||
assert((!PyStackRef_IsNull(res)) ^ (_PyErr_Occurred(tstate) != NULL)); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
I don't love the trailing underscore. Not a huge deal, but maybe just rename to
instance
orobj
or something ?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.
I renamed it to
instance
in be50e24