]> git.eshelyaron.com Git - emacs.git/commitdiff
Drop unnecessary type check in varref and varset byte ops
authorMattias EngdegÄrd <mattiase@acm.org>
Thu, 18 Apr 2024 10:26:10 +0000 (12:26 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 20 Apr 2024 11:06:33 +0000 (14:06 +0300)
* 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

index 8d7240b99668ac6cc6c042cf5fb411d3bfbb2cc9..de25069d94a19698b3276ffc4bd949d9b645d52a 100644 (file)
@@ -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);