mirror of
https://github.com/python/cpython.git
synced 2025-10-27 11:44:39 +00:00
GH-131798: Add _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW (GH-134268)
This commit is contained in:
parent
1fbb0603a8
commit
a7f317d730
8 changed files with 121 additions and 53 deletions
18
Python/optimizer_cases.c.h
generated
18
Python/optimizer_cases.c.h
generated
|
|
@ -2143,12 +2143,12 @@
|
|||
PyTypeObject *inst_type = sym_get_type(instance);
|
||||
PyTypeObject *cls_o = (PyTypeObject *)sym_get_const(ctx, cls);
|
||||
if (inst_type && cls_o && sym_matches_type(cls, &PyType_Type)) {
|
||||
PyObject *out = Py_False;
|
||||
if (inst_type == cls_o || PyType_IsSubtype(inst_type, cls_o)) {
|
||||
sym_set_const(res, Py_True);
|
||||
}
|
||||
else {
|
||||
sym_set_const(res, Py_False);
|
||||
out = Py_True;
|
||||
}
|
||||
sym_set_const(res, out);
|
||||
REPLACE_OP(this_instr, _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW, 0, (uintptr_t)out);
|
||||
}
|
||||
stack_pointer[-4] = res;
|
||||
stack_pointer += -3;
|
||||
|
|
@ -2556,6 +2556,16 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW: {
|
||||
JitOptSymbol *value;
|
||||
PyObject *ptr = (PyObject *)this_instr->operand0;
|
||||
value = sym_new_const(ctx, ptr);
|
||||
stack_pointer[-4] = value;
|
||||
stack_pointer += -3;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
break;
|
||||
}
|
||||
|
||||
case _CHECK_FUNCTION: {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue