From 8bff940ad69ce176dcd2b8e91d0b30ddd09945f1 Mon Sep 17 00:00:00 2001 From: hms <18321626+polynomialherder@users.noreply.github.com> Date: Thu, 29 Jun 2023 10:34:00 -0600 Subject: gh-105775: Convert LOAD_CLOSURE to a pseudo-op (#106059) This enables super-instruction formation, removal of checks for uninitialized variables, and frees up an instruction. --- Python/bytecodes.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Python/bytecodes.c') diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 02857104f5a..1d9664bc27d 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -175,12 +175,9 @@ dummy_func( } } - inst(LOAD_CLOSURE, (-- value)) { - /* We keep LOAD_CLOSURE so that the bytecode stays more readable. */ - value = GETLOCAL(oparg); - ERROR_IF(value == NULL, unbound_local_error); - Py_INCREF(value); - } + pseudo(LOAD_CLOSURE) = { + LOAD_FAST, + }; inst(LOAD_FAST_CHECK, (-- value)) { value = GETLOCAL(oparg); -- cgit v1.2.3