mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-131798: Split up and optimize CALL_TUPLE_1 in the JIT (GH-132851)
This commit is contained in:
parent
15ff60aff0
commit
08e3389e8c
10 changed files with 277 additions and 161 deletions
19
Python/optimizer_cases.c.h
generated
19
Python/optimizer_cases.c.h
generated
|
@ -1918,9 +1918,26 @@
|
|||
break;
|
||||
}
|
||||
|
||||
case _GUARD_CALLABLE_TUPLE_1: {
|
||||
JitOptSymbol *callable;
|
||||
callable = stack_pointer[-3];
|
||||
if (sym_get_const(ctx, callable) == (PyObject *)&PyTuple_Type) {
|
||||
REPLACE_OP(this_instr, _NOP, 0, 0);
|
||||
}
|
||||
sym_set_const(callable, (PyObject *)&PyTuple_Type);
|
||||
break;
|
||||
}
|
||||
|
||||
case _CALL_TUPLE_1: {
|
||||
JitOptSymbol *arg;
|
||||
JitOptSymbol *res;
|
||||
res = sym_new_not_null(ctx);
|
||||
arg = stack_pointer[-1];
|
||||
if (sym_matches_type(arg, &PyTuple_Type)) {
|
||||
res = arg;
|
||||
}
|
||||
else {
|
||||
res = sym_new_type(ctx, &PyTuple_Type);
|
||||
}
|
||||
stack_pointer[-3] = res;
|
||||
stack_pointer += -2;
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue