diff options
author | Tomas R. <tomas.roun8@gmail.com> | 2025-04-22 16:30:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-22 16:30:38 (GMT) |
commit | a6a3dbb7db0516a72c5ef149223d904f4e6a31ae (patch) | |
tree | 99b48ba60bf96d77b062d01966341f4a30c15be9 /Python/optimizer_bytecodes.c | |
parent | 87b1ea016b1454b1e83b9113fa9435849b7743aa (diff) | |
download | cpython-a6a3dbb7db0516a72c5ef149223d904f4e6a31ae.zip cpython-a6a3dbb7db0516a72c5ef149223d904f4e6a31ae.tar.gz cpython-a6a3dbb7db0516a72c5ef149223d904f4e6a31ae.tar.bz2 |
GH-131798: JIT: Split CALL_TYPE_1 into several uops (GH-132419)
Diffstat (limited to 'Python/optimizer_bytecodes.c')
-rw-r--r-- | Python/optimizer_bytecodes.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Python/optimizer_bytecodes.c b/Python/optimizer_bytecodes.c index 9f1e3f6..a14d5c0 100644 --- a/Python/optimizer_bytecodes.c +++ b/Python/optimizer_bytecodes.c @@ -846,6 +846,15 @@ dummy_func(void) { next = sym_new_type(ctx, &PyLong_Type); } + op(_CALL_TYPE_1, (unused, unused, arg -- res)) { + if (sym_has_type(arg)) { + res = sym_new_const(ctx, (PyObject *)sym_get_type(arg)); + } + else { + res = sym_new_not_null(ctx); + } + } + op(_GUARD_IS_TRUE_POP, (flag -- )) { if (sym_is_const(ctx, flag)) { PyObject *value = sym_get_const(ctx, flag); @@ -998,6 +1007,19 @@ dummy_func(void) { } } + op(_GUARD_NOS_NULL, (null, unused -- null, unused)) { + if (sym_is_null(null)) { + REPLACE_OP(this_instr, _NOP, 0, 0); + } + sym_set_null(null); + } + + op(_GUARD_CALLABLE_TYPE_1, (callable, unused, unused -- callable, unused, unused)) { + if (sym_get_const(ctx, callable) == (PyObject *)&PyType_Type) { + REPLACE_OP(this_instr, _NOP, 0, 0); + } + sym_set_const(callable, (PyObject *)&PyType_Type); + } // END BYTECODES // |