changeset 27782:f53ecb062478

(Fbyte_code) <Bvarset>: Inline most common case.
author Gerd Moellmann <gerd@gnu.org>
date Sun, 20 Feb 2000 15:55:38 +0000
parents f84c7b8308c5
children 7d38d1e5d9bb
files src/bytecode.c
diffstat 1 files changed, 34 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/bytecode.c	Sun Feb 20 15:55:07 2000 +0000
+++ b/src/bytecode.c	Sun Feb 20 15:55:38 2000 +0000
@@ -544,20 +544,47 @@
 	    break;
 	  }
 
-	case Bvarset+7:
-	  op = FETCH2;
+	case Bvarset:
+	case Bvarset+1:
+	case Bvarset+2:
+	case Bvarset+3:
+	case Bvarset+4:
+	case Bvarset+5:
+	  op -= Bvarset;
 	  goto varset;
 
-	case Bvarset: case Bvarset+1: case Bvarset+2: case Bvarset+3:
-	case Bvarset+4: case Bvarset+5:
-	  op -= Bvarset;
+	case Bvarset+7:
+	  op = FETCH2;
 	  goto varset;
 
 	case Bvarset+6:
 	  op = FETCH;
 	varset:
-	  set_internal (vectorp[op], POP, current_buffer, 0);
-	  /* Fset (vectorp[op], POP); */
+	  {
+	    Lisp_Object sym, val;
+	    extern int keyword_symbols_constant_flag;
+	      
+	    sym = vectorp[op];
+	    val = POP;
+
+	    /* Inline the most common case.  */
+	    if (SYMBOLP (sym)
+		&& !EQ (val, Qunbound)
+		&& !MISCP (XSYMBOL (sym)->value)
+		/* I think this should either be checked in the byte
+		   compiler, or there should be a flag indicating that
+		   a symbol might be constant in Lisp_Symbol, instead
+		   of checking this here over and over again. --gerd.  */
+		&& !EQ (sym, Qnil)
+		&& !EQ (sym, Qt)
+		&& !(XSYMBOL (sym)->name->data[0] == ':'
+		     && EQ (XSYMBOL (sym)->obarray, initial_obarray)
+		     && keyword_symbols_constant_flag
+		     && !EQ (val, sym)))
+	      XSYMBOL (sym)->value = val;
+	    else
+	      set_internal (sym, val, current_buffer, 0);
+	  }
 	  break;
 
 	case Bdup: