GH-131798: JIT: Split CALL_TYPE_1 into several uops (GH-132419)

This commit is contained in:
Tomas R. 2025-04-22 18:30:38 +02:00 committed by GitHub
parent 87b1ea016b
commit a6a3dbb7db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 348 additions and 216 deletions

View file

@ -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 //