From 4705a0343c785920bb96fdfa1cad8ca0505bfc3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Thu, 18 Apr 2024 12:26:10 +0200 Subject: [PATCH] Drop unnecessary type check in varref and varset byte ops * src/bytecode.c (exec_byte_code): We can safely assume that the immediate argument to varref and varset is a bare symbol; the byte-compiler should guarantee that. (cherry picked from commit dba115d6bcbc955858526740254bd9a169830d7e) --- src/bytecode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bytecode.c b/src/bytecode.c index 8d7240b9966..de25069d94a 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -625,8 +625,7 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, varref: { Lisp_Object v1 = vectorp[op], v2; - if (!BARE_SYMBOL_P (v1) - || XBARE_SYMBOL (v1)->u.s.redirect != SYMBOL_PLAINVAL + if (XBARE_SYMBOL (v1)->u.s.redirect != SYMBOL_PLAINVAL || (v2 = XBARE_SYMBOL (v1)->u.s.val.value, BASE_EQ (v2, Qunbound))) v2 = Fsymbol_value (v1); @@ -700,8 +699,7 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template, Lisp_Object val = POP; /* Inline the most common case. */ - if (BARE_SYMBOL_P (sym) - && !BASE_EQ (val, Qunbound) + if (!BASE_EQ (val, Qunbound) && XBARE_SYMBOL (sym)->u.s.redirect == SYMBOL_PLAINVAL && !XBARE_SYMBOL (sym)->u.s.trapped_write) SET_SYMBOL_VAL (XBARE_SYMBOL (sym), val); -- 2.39.5