mirror of
https://github.com/python/cpython.git
synced 2026-04-21 03:10:52 +00:00
gh-148171: Convert CALL_BUILTIN_FAST to leave inputs on the stack for refcount elimination in JIT (GH-148172)
This commit is contained in:
parent
aea0b91d65
commit
266247c9a6
14 changed files with 1199 additions and 1103 deletions
|
|
@ -405,6 +405,29 @@ lookup_attr(JitOptContext *ctx, _PyBloomFilter *dependencies, _PyUOpInstruction
|
|||
return sym_new_not_null(ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
optimize_pop_top(JitOptContext *ctx, _PyUOpInstruction *this_instr, JitOptRef value)
|
||||
{
|
||||
PyTypeObject *typ = sym_get_type(value);
|
||||
if (PyJitRef_IsBorrowed(value) ||
|
||||
sym_is_immortal(PyJitRef_Unwrap(value)) ||
|
||||
sym_is_null(value)) {
|
||||
ADD_OP(_POP_TOP_NOP, 0, 0);
|
||||
}
|
||||
else if (typ == &PyLong_Type) {
|
||||
ADD_OP(_POP_TOP_INT, 0, 0);
|
||||
}
|
||||
else if (typ == &PyFloat_Type) {
|
||||
ADD_OP(_POP_TOP_FLOAT, 0, 0);
|
||||
}
|
||||
else if (typ == &PyUnicode_Type) {
|
||||
ADD_OP(_POP_TOP_UNICODE, 0, 0);
|
||||
}
|
||||
else {
|
||||
ADD_OP(_POP_TOP, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Look up name via super (normal case from supercheck where
|
||||
su_obj_type = Py_TYPE(obj)). */
|
||||
static JitOptRef
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue