mirror of
https://github.com/python/cpython.git
synced 2026-04-20 10:51:00 +00:00
gh-131798: Add _IS_NONE to the JIT optimizer (GH-148369)
This commit is contained in:
parent
1c89817f51
commit
a059e85866
3 changed files with 37 additions and 1 deletions
|
|
@ -724,6 +724,16 @@ dummy_func(void) {
|
|||
r = right;
|
||||
}
|
||||
|
||||
op(_IS_NONE, (value -- b)) {
|
||||
if (sym_is_const(ctx, value)) {
|
||||
PyObject *value_o = sym_get_const(ctx, value);
|
||||
b = sym_new_const(ctx, Py_IsNone(value_o) ? Py_True : Py_False);
|
||||
}
|
||||
else {
|
||||
b = sym_new_type(ctx, &PyBool_Type);
|
||||
}
|
||||
}
|
||||
|
||||
op(_CONTAINS_OP, (left, right -- b, l, r)) {
|
||||
b = sym_new_type(ctx, &PyBool_Type);
|
||||
l = left;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue