mirror of
https://github.com/python/cpython.git
synced 2025-08-26 03:34:43 +00:00
GH-131798: Split up and optimize CALL_ISINSTANCE (GH-133339)
This commit is contained in:
parent
b2fabce6ab
commit
c492ac7252
11 changed files with 392 additions and 301 deletions
25
Python/optimizer_cases.c.h
generated
25
Python/optimizer_cases.c.h
generated
|
@ -1935,6 +1935,16 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _GUARD_THIRD_NULL: {
|
||||
JitOptSymbol *null;
|
||||
null = stack_pointer[-3];
|
||||
if (sym_is_null(null)) {
|
||||
REPLACE_OP(this_instr, _NOP, 0, 0);
|
||||
}
|
||||
sym_set_null(null);
|
||||
break;
|
||||
}
|
||||
|
||||
case _GUARD_CALLABLE_TYPE_1: {
|
||||
JitOptSymbol *callable;
|
||||
callable = stack_pointer[-3];
|
||||
|
@ -2102,11 +2112,22 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _GUARD_CALLABLE_ISINSTANCE: {
|
||||
JitOptSymbol *callable;
|
||||
callable = stack_pointer[-4];
|
||||
PyObject *isinstance = _PyInterpreterState_GET()->callable_cache.isinstance;
|
||||
if (sym_get_const(ctx, callable) == isinstance) {
|
||||
REPLACE_OP(this_instr, _NOP, 0, 0);
|
||||
}
|
||||
sym_set_const(callable, isinstance);
|
||||
break;
|
||||
}
|
||||
|
||||
case _CALL_ISINSTANCE: {
|
||||
JitOptSymbol *res;
|
||||
res = sym_new_not_null(ctx);
|
||||
stack_pointer[-2 - oparg] = res;
|
||||
stack_pointer += -1 - oparg;
|
||||
stack_pointer[-4] = res;
|
||||
stack_pointer += -3;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue