diff options
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 // |