Skip to content

Commit 8e03efc

Browse files
committed
Improve _CALL_TYPE_1
1 parent 9e1bb98 commit 8e03efc

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Python/optimizer_bytecodes.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,11 @@ dummy_func(void) {
847847
}
848848

849849
op(_CALL_TYPE_1, (callable, null, arg -- res)) {
850-
res = sym_new_type(ctx, &PyType_Type);
850+
if (sym_has_type(arg)) {
851+
res = sym_new_const(ctx, (PyObject*)sym_get_type(arg));
852+
} else {
853+
res = sym_new_not_null(ctx);
854+
}
851855
}
852856

853857
op(_GUARD_IS_TRUE_POP, (flag -- )) {

Python/optimizer_cases.c.h

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)