From: Mattias EngdegÄrd Date: Thu, 18 Apr 2024 10:26:10 +0000 (+0200) Subject: Drop unnecessary type check in varref and varset byte ops X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4705a0343c785920bb96fdfa1cad8ca0505bfc3d;p=emacs.git 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) --- 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);