mirror of
https://github.com/python/cpython.git
synced 2026-02-21 22:50:55 +00:00
GH-131798: Optimize _GUARD_TOS_SLICE (GH-144470)
This commit is contained in:
parent
d73634935c
commit
cfeede85a7
4 changed files with 31 additions and 0 deletions
|
|
@ -1374,6 +1374,13 @@ dummy_func(void) {
|
|||
}
|
||||
}
|
||||
|
||||
op(_GUARD_TOS_SLICE, (tos -- tos)) {
|
||||
if (sym_matches_type(tos, &PySlice_Type)) {
|
||||
ADD_OP(_NOP, 0, 0);
|
||||
}
|
||||
sym_set_type(tos, &PySlice_Type);
|
||||
}
|
||||
|
||||
op(_GUARD_NOS_NULL, (null, unused -- null, unused)) {
|
||||
if (sym_is_null(null)) {
|
||||
ADD_OP(_NOP, 0, 0);
|
||||
|
|
|
|||
6
Python/optimizer_cases.c.h
generated
6
Python/optimizer_cases.c.h
generated
|
|
@ -370,6 +370,12 @@
|
|||
}
|
||||
|
||||
case _GUARD_TOS_SLICE: {
|
||||
JitOptRef tos;
|
||||
tos = stack_pointer[-1];
|
||||
if (sym_matches_type(tos, &PySlice_Type)) {
|
||||
ADD_OP(_NOP, 0, 0);
|
||||
}
|
||||
sym_set_type(tos, &PySlice_Type);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue