unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* threaded code in bytecode.c
@ 2004-05-03  1:10 jay
  2004-05-03  1:35 ` Miles Bader
  2004-05-03 22:20 ` Richard Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: jay @ 2004-05-03  1:10 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 149 bytes --]

Hello, 

I've just added gcc's computed goto based bytecode interpretation in
bytecode.c without affecting any other parts. 

Can anybody try this?


[-- Attachment #2: threaded-bytecode.patch --]
[-- Type: text/plain, Size: 37719 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.3655
diff -u -r1.3655 ChangeLog
--- ChangeLog	2 May 2004 18:47:57 -0000	1.3655
+++ ChangeLog	3 May 2004 01:04:07 -0000
@@ -1,3 +1,8 @@
+2004-05-03  Jaeyoun Chung  <jay@kldp.org>
+
+	* bytecode.c (Fbyte_code): theaded bytecode interpretation code added.
+	Define THREADED_CODE to enable computed goto based interpretation.
+
 2004-05-02  Eli Zaretskii  <eliz@gnu.org>
 
 	* syntax.h (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY_INT): Avoid
cvs server: ChangeLog.22 no longer exists, no comparison available
cvs server: ChangeLog.lexbind no longer exists, no comparison available
cvs server: alloca.s no longer exists, no comparison available
cvs server: bidi.c no longer exists, no comparison available
Index: bytecode.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/bytecode.c,v
retrieving revision 1.79
diff -u -r1.79 bytecode.c
--- bytecode.c	11 Sep 2003 21:58:32 -0000	1.79
+++ bytecode.c	3 May 2004 01:04:07 -0000
@@ -55,6 +55,10 @@
 /* #define BYTE_CODE_SAFE */
 /* #define BYTE_CODE_METER */
 
+/* define THREADED_CODE to enable the gcc's computed goto based jump instead
+ * of while(1) switch bytecod dispatch */
+/* #define THREADED_CODE */
+
 \f
 #ifdef BYTE_CODE_METER
 
@@ -90,146 +94,181 @@
 
 /*  Byte codes: */
 
-#define Bvarref 010
-#define Bvarset 020
-#define Bvarbind 030
-#define Bcall 040
-#define Bunbind 050
-
-#define Bnth 070
-#define Bsymbolp 071
-#define Bconsp 072
-#define Bstringp 073
-#define Blistp 074
-#define Beq 075
-#define Bmemq 076
-#define Bnot 077
-#define Bcar 0100
-#define Bcdr 0101
-#define Bcons 0102
-#define Blist1 0103
-#define Blist2 0104
-#define Blist3 0105
-#define Blist4 0106
-#define Blength 0107
-#define Baref 0110
-#define Baset 0111
-#define Bsymbol_value 0112
+#define Bvarref0  010
+#define Bvarref1  011
+#define Bvarref2  012
+#define Bvarref3  013
+#define Bvarref4  014
+#define Bvarref5  015
+#define Bvarref6  016
+#define Bvarref7  017
+#define Bvarset0  020
+#define Bvarset1  021
+#define Bvarset2  022
+#define Bvarset3  023
+#define Bvarset4  024
+#define Bvarset5  025
+#define Bvarset6  026
+#define Bvarset7  027
+#define Bvarbind0 030
+#define Bvarbind1 031
+#define Bvarbind2 032
+#define Bvarbind3 033
+#define Bvarbind4 034
+#define Bvarbind5 035
+#define Bvarbind6 036
+#define Bvarbind7 037
+#define Bcall0    040
+#define Bcall1    041
+#define Bcall2    042
+#define Bcall3    043
+#define Bcall4    044
+#define Bcall5    045
+#define Bcall6    046
+#define Bcall7    047
+#define Bunbind0  050
+#define Bunbind1  051
+#define Bunbind2  052
+#define Bunbind3  053
+#define Bunbind4  054
+#define Bunbind5  055
+#define Bunbind6  056
+#define Bunbind7  057
+
+#define Bnth             070
+#define Bsymbolp         071
+#define Bconsp           072
+#define Bstringp         073
+#define Blistp           074
+#define Beq              075
+#define Bmemq            076
+#define Bnot             077
+#define Bcar             0100
+#define Bcdr             0101
+#define Bcons            0102
+#define Blist1           0103
+#define Blist2           0104
+#define Blist3           0105
+#define Blist4           0106
+#define Blength          0107
+#define Baref            0110
+#define Baset            0111
+#define Bsymbol_value    0112
 #define Bsymbol_function 0113
-#define Bset 0114
-#define Bfset 0115
-#define Bget 0116
-#define Bsubstring 0117
-#define Bconcat2 0120
-#define Bconcat3 0121
-#define Bconcat4 0122
-#define Bsub1 0123
-#define Badd1 0124
-#define Beqlsign 0125
-#define Bgtr 0126
-#define Blss 0127
-#define Bleq 0130
-#define Bgeq 0131
-#define Bdiff 0132
-#define Bnegate 0133
-#define Bplus 0134
-#define Bmax 0135
-#define Bmin 0136
-#define Bmult 0137
+#define Bset             0114
+#define Bfset            0115
+#define Bget             0116
+#define Bsubstring       0117
+#define Bconcat2         0120
+#define Bconcat3         0121
+#define Bconcat4         0122
+#define Bsub1            0123
+#define Badd1            0124
+#define Beqlsign         0125
+#define Bgtr             0126
+#define Blss             0127
+#define Bleq             0130
+#define Bgeq             0131
+#define Bdiff            0132
+#define Bnegate          0133
+#define Bplus            0134
+#define Bmax             0135
+#define Bmin             0136
+#define Bmult            0137
 
-#define Bpoint 0140
+#define Bpoint                 0140
 /* Was Bmark in v17.  */
-#define Bsave_current_buffer 0141
-#define Bgoto_char 0142
-#define Binsert 0143
-#define Bpoint_max 0144
-#define Bpoint_min 0145
-#define Bchar_after 0146
-#define Bfollowing_char 0147
-#define Bpreceding_char 0150
-#define Bcurrent_column 0151
-#define Bindent_to 0152
-#define Bscan_buffer 0153 /* No longer generated as of v18 */
-#define Beolp 0154
-#define Beobp 0155
-#define Bbolp 0156
-#define Bbobp 0157
-#define Bcurrent_buffer 0160
-#define Bset_buffer 0161
+#define Bsave_current_buffer   0141
+#define Bgoto_char             0142
+#define Binsert                0143
+#define Bpoint_max             0144
+#define Bpoint_min             0145
+#define Bchar_after            0146
+#define Bfollowing_char        0147
+#define Bpreceding_char        0150
+#define Bcurrent_column        0151
+#define Bindent_to             0152
+#define Bscan_buffer           0153 /* No longer generated as of v18 */
+#define Beolp                  0154
+#define Beobp                  0155
+#define Bbolp                  0156
+#define Bbobp                  0157
+#define Bcurrent_buffer        0160
+#define Bset_buffer            0161
 #define Bsave_current_buffer_1 0162 /* Replacing Bsave_current_buffer.  */
-#define Bread_char 0162 /* No longer generated as of v19 */
-#define Bset_mark 0163 /* this loser is no longer generated as of v18 */
-#define Binteractive_p 0164 /* Needed since interactive-p takes unevalled args */
-
-#define Bforward_char 0165
-#define Bforward_word 0166
-#define Bskip_chars_forward 0167
+#define Bread_char             0162 /* No longer generated as of v19 */
+#define Bset_mark              0163 /* this loser is no longer generated as of v18 */
+#define Binteractive_p         0164 /* Needed since interactive-p takes unevalled args */
+
+#define Bforward_char        0165
+#define Bforward_word        0166
+#define Bskip_chars_forward  0167
 #define Bskip_chars_backward 0170
-#define Bforward_line 0171
-#define Bchar_syntax 0172
-#define Bbuffer_substring 0173
-#define Bdelete_region 0174
-#define Bnarrow_to_region 0175
-#define Bwiden 0176
-#define Bend_of_line 0177
-
-#define Bconstant2 0201
-#define Bgoto 0202
-#define Bgotoifnil 0203
-#define Bgotoifnonnil 0204
-#define Bgotoifnilelsepop 0205
+#define Bforward_line        0171
+#define Bchar_syntax         0172
+#define Bbuffer_substring    0173
+#define Bdelete_region       0174
+#define Bnarrow_to_region    0175
+#define Bwiden               0176
+#define Bend_of_line         0177
+
+#define Bconstant2           0201
+#define Bgoto                0202
+#define Bgotoifnil           0203
+#define Bgotoifnonnil        0204
+#define Bgotoifnilelsepop    0205
 #define Bgotoifnonnilelsepop 0206
-#define Breturn 0207
-#define Bdiscard 0210
-#define Bdup 0211
+#define Breturn              0207
+#define Bdiscard             0210
+#define Bdup                 0211
 
-#define Bsave_excursion 0212
+#define Bsave_excursion        0212
 #define Bsave_window_excursion 0213
-#define Bsave_restriction 0214
-#define Bcatch 0215
+#define Bsave_restriction      0214
+#define Bcatch                 0215
 
-#define Bunwind_protect 0216
-#define Bcondition_case 0217
+#define Bunwind_protect           0216
+#define Bcondition_case           0217
 #define Btemp_output_buffer_setup 0220
-#define Btemp_output_buffer_show 0221
+#define Btemp_output_buffer_show  0221
 
 #define Bunbind_all 0222
 
-#define Bset_marker 0223
+#define Bset_marker      0223
 #define Bmatch_beginning 0224
-#define Bmatch_end 0225
-#define Bupcase 0226
-#define Bdowncase 0227
+#define Bmatch_end       0225
+#define Bupcase          0226
+#define Bdowncase        0227
 
 #define Bstringeqlsign 0230
-#define Bstringlss 0231
-#define Bequal 0232
-#define Bnthcdr 0233
-#define Belt 0234
-#define Bmember 0235
-#define Bassq 0236
-#define Bnreverse 0237
-#define Bsetcar 0240
-#define Bsetcdr 0241
-#define Bcar_safe 0242
-#define Bcdr_safe 0243
-#define Bnconc 0244
-#define Bquo 0245
-#define Brem 0246
-#define Bnumberp 0247
-#define Bintegerp 0250
-
-#define BRgoto 0252
-#define BRgotoifnil 0253
-#define BRgotoifnonnil 0254
-#define BRgotoifnilelsepop 0255
+#define Bstringlss     0231
+#define Bequal         0232
+#define Bnthcdr        0233
+#define Belt           0234
+#define Bmember        0235
+#define Bassq          0236
+#define Bnreverse      0237
+#define Bsetcar        0240
+#define Bsetcdr        0241
+#define Bcar_safe      0242
+#define Bcdr_safe      0243
+#define Bnconc         0244
+#define Bquo           0245
+#define Brem           0246
+#define Bnumberp       0247
+#define Bintegerp      0250
+
+#define BRgoto                0252
+#define BRgotoifnil           0253
+#define BRgotoifnonnil        0254
+#define BRgotoifnilelsepop    0255
 #define BRgotoifnonnilelsepop 0256
 
-#define BlistN 0257
+#define BlistN   0257
 #define BconcatN 0260
 #define BinsertN 0261
 
-#define Bconstant 0300
+#define Bconstant   0300
 #define CONSTANTLIM 0100
 
 \f
@@ -417,6 +456,198 @@
   Lisp_Object *top;
   Lisp_Object result;
 
+#ifdef THREADED_CODE
+# define OPCODE(X)   lbl_ ##X
+# define Next() goto *op_tbls[op = FETCH]
+# define DEFAULT     lbl_default
+
+  static int op_inited = 0;
+  static void **op_tbls[256] = {
+# define OPLABL(X)   [X] = &&lbl_ ##X
+OPLABL(Bvarref7),
+OPLABL(Bvarref0),
+OPLABL(Bvarref1),
+OPLABL(Bvarref2),
+OPLABL(Bvarref3),
+OPLABL(Bvarref4),
+OPLABL(Bvarref5),
+OPLABL(Bvarref6),
+OPLABL(Bgotoifnil),
+OPLABL(Bcar),
+OPLABL(Beq),
+OPLABL(Bmemq),
+OPLABL(Bcdr),
+OPLABL(Bvarset0),
+OPLABL(Bvarset1),
+OPLABL(Bvarset2),
+OPLABL(Bvarset3),
+OPLABL(Bvarset4),
+OPLABL(Bvarset5),
+OPLABL(Bvarset7),
+OPLABL(Bvarset6),
+OPLABL(Bdup),
+OPLABL(Bvarbind6),
+OPLABL(Bvarbind7),
+OPLABL(Bvarbind0),
+OPLABL(Bvarbind1),
+OPLABL(Bvarbind2),
+OPLABL(Bvarbind3),
+OPLABL(Bvarbind4),
+OPLABL(Bvarbind5),
+OPLABL(Bcall6),
+OPLABL(Bcall7),
+OPLABL(Bcall0),
+OPLABL(Bcall1),
+OPLABL(Bcall2),
+OPLABL(Bcall3),
+OPLABL(Bcall4),
+OPLABL(Bcall5),
+OPLABL(Bunbind6),
+OPLABL(Bunbind7),
+OPLABL(Bunbind0),
+OPLABL(Bunbind1),
+OPLABL(Bunbind2),
+OPLABL(Bunbind3),
+OPLABL(Bunbind4),
+OPLABL(Bunbind5),
+OPLABL(Bunbind_all),
+OPLABL(Bgoto),
+OPLABL(Bgotoifnonnil),
+OPLABL(Bgotoifnilelsepop),
+OPLABL(Bgotoifnonnilelsepop),
+OPLABL(BRgoto),
+OPLABL(BRgotoifnil),
+OPLABL(BRgotoifnonnil),
+OPLABL(BRgotoifnilelsepop),
+OPLABL(BRgotoifnonnilelsepop),
+OPLABL(Breturn),
+OPLABL(Bdiscard),
+OPLABL(Bconstant2),
+OPLABL(Bsave_excursion),
+OPLABL(Bsave_current_buffer),
+OPLABL(Bsave_current_buffer_1),
+OPLABL(Bsave_window_excursion),
+OPLABL(Bsave_restriction),
+OPLABL(Bcatch),
+OPLABL(Bunwind_protect),
+OPLABL(Bcondition_case),
+OPLABL(Btemp_output_buffer_setup),
+OPLABL(Btemp_output_buffer_show),
+OPLABL(Bnth),
+OPLABL(Bsymbolp),
+OPLABL(Bconsp),
+OPLABL(Bstringp),
+OPLABL(Blistp),
+OPLABL(Bnot),
+OPLABL(Bcons),
+OPLABL(Blist1),
+OPLABL(Blist2),
+OPLABL(Blist3),
+OPLABL(Blist4),
+OPLABL(BlistN),
+OPLABL(Blength),
+OPLABL(Baref),
+OPLABL(Baset),
+OPLABL(Bsymbol_value),
+OPLABL(Bsymbol_function),
+OPLABL(Bset),
+OPLABL(Bfset),
+OPLABL(Bget),
+OPLABL(Bsubstring),
+OPLABL(Bconcat2),
+OPLABL(Bconcat3),
+OPLABL(Bconcat4),
+OPLABL(BconcatN),
+OPLABL(Bsub1),
+OPLABL(Badd1),
+OPLABL(Beqlsign),
+OPLABL(Bgtr),
+OPLABL(Blss),
+OPLABL(Bleq),
+OPLABL(Bgeq),
+OPLABL(Bdiff),
+OPLABL(Bnegate),
+OPLABL(Bplus),
+OPLABL(Bmax),
+OPLABL(Bmin),
+OPLABL(Bmult),
+OPLABL(Bquo),
+OPLABL(Brem),
+OPLABL(Bpoint),
+OPLABL(Bgoto_char),
+OPLABL(Binsert),
+OPLABL(BinsertN),
+OPLABL(Bpoint_max),
+OPLABL(Bpoint_min),
+OPLABL(Bchar_after),
+OPLABL(Bfollowing_char),
+OPLABL(Bpreceding_char),
+OPLABL(Bcurrent_column),
+OPLABL(Bindent_to),
+OPLABL(Beolp),
+OPLABL(Beobp),
+OPLABL(Bbolp),
+OPLABL(Bbobp),
+OPLABL(Bcurrent_buffer),
+OPLABL(Bset_buffer),
+OPLABL(Binteractive_p),
+OPLABL(Bforward_char),
+OPLABL(Bforward_word),
+OPLABL(Bskip_chars_forward),
+OPLABL(Bskip_chars_backward),
+OPLABL(Bforward_line),
+OPLABL(Bchar_syntax),
+OPLABL(Bbuffer_substring),
+OPLABL(Bdelete_region),
+OPLABL(Bnarrow_to_region),
+OPLABL(Bwiden),
+OPLABL(Bend_of_line),
+OPLABL(Bset_marker),
+OPLABL(Bmatch_beginning),
+OPLABL(Bmatch_end),
+OPLABL(Bupcase),
+OPLABL(Bdowncase),
+OPLABL(Bstringeqlsign),
+OPLABL(Bstringlss),
+OPLABL(Bequal),
+OPLABL(Bnthcdr),
+OPLABL(Belt),
+OPLABL(Bmember),
+OPLABL(Bassq),
+OPLABL(Bnreverse),
+OPLABL(Bsetcar),
+OPLABL(Bsetcdr),
+OPLABL(Bcar_safe),
+OPLABL(Bcdr_safe),
+OPLABL(Bnconc),
+OPLABL(Bnumberp),
+OPLABL(Bintegerp),
+# ifdef BYTE_CODE_SAFE
+OPLABL(Bset_mark),
+OPLABL(Bscan_buffer),
+# endif
+OPLABL(0),
+OPLABL(255),
+
+# undef OPLABL
+  };
+
+  if (!op_inited) {
+    int i;
+
+    for (i = 0; i < sizeof (op_tbls)/sizeof(op_tbls[0]); ++i)
+      if (!op_tbls[i]) op_tbls[i] = &&lbl_default;
+
+    op_inited = 1;
+  }
+
+#else
+# define OPCODE(X)   case X
+# define Next()      break
+# define DEFAULT     default
+#endif  /* THREADED_CODE */
+
+
 #ifdef CHECK_FRAME_FONT
  {
    struct frame *f = SELECTED_FRAME ();
@@ -457,6 +688,7 @@
   stacke = stack.bottom - 1 + XFASTINT (maxdepth);
 #endif
 
+#ifndef THREADED_CODE
   while (1)
     {
 #ifdef BYTE_CODE_SAFE
@@ -476,22 +708,26 @@
 
       switch (op)
 	{
-	case Bvarref + 7:
+#else
+          Next();
+#endif  /* !THREADED_CODE */
+
+        OPCODE(Bvarref7):
 	  op = FETCH2;
 	  goto varref;
 
-	case Bvarref:
-	case Bvarref + 1:
-	case Bvarref + 2:
-	case Bvarref + 3:
-	case Bvarref + 4:
-	case Bvarref + 5:
-	  op = op - Bvarref;
+	OPCODE(Bvarref0):
+	OPCODE(Bvarref1):
+	OPCODE(Bvarref2):
+	OPCODE(Bvarref3):
+	OPCODE(Bvarref4):
+	OPCODE(Bvarref5):
+	  op = op - Bvarref0;
 	  goto varref;
 
 	/* This seems to be the most frequently executed byte-code
 	   among the Bvarref's, so avoid a goto here.  */
-	case Bvarref+6:
+	OPCODE(Bvarref6):
 	  op = FETCH;
 	varref:
 	  {
@@ -515,10 +751,10 @@
 		AFTER_POTENTIAL_GC ();
 	      }
 	    PUSH (v2);
-	    break;
+	    Next();
 	  }
 
-	case Bgotoifnil:
+	OPCODE(Bgotoifnil):
 	  MAYBE_GC ();
 	  op = FETCH2;
 	  if (NILP (POP))
@@ -527,9 +763,9 @@
 	      CHECK_RANGE (op);
 	      stack.pc = stack.byte_string_start + op;
 	    }
-	  break;
+	  Next();
 
-	case Bcar:
+	OPCODE(Bcar):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -543,28 +779,28 @@
 		Fcar (wrong_type_argument (Qlistp, v1));
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Beq:
+	OPCODE(Beq):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
 	    TOP = EQ (v1, TOP) ? Qt : Qnil;
-	    break;
+	    Next();
 	  }
 
-	case Bmemq:
+	OPCODE(Bmemq):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fmemq (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bcdr:
+	OPCODE(Bcdr):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -578,23 +814,23 @@
 		Fcdr (wrong_type_argument (Qlistp, v1));
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Bvarset:
-	case Bvarset+1:
-	case Bvarset+2:
-	case Bvarset+3:
-	case Bvarset+4:
-	case Bvarset+5:
-	  op -= Bvarset;
+	OPCODE(Bvarset0):
+	OPCODE(Bvarset1):
+	OPCODE(Bvarset2):
+	OPCODE(Bvarset3):
+	OPCODE(Bvarset4):
+	OPCODE(Bvarset5):
+	  op -= Bvarset0;
 	  goto varset;
 
-	case Bvarset+7:
+	OPCODE(Bvarset7):
 	  op = FETCH2;
 	  goto varset;
 
-	case Bvarset+6:
+	OPCODE(Bvarset6):
 	  op = FETCH;
 	varset:
 	  {
@@ -618,55 +854,55 @@
 	      }
 	  }
 	  (void) POP;
-	  break;
+	  Next();
 
-	case Bdup:
+	OPCODE(Bdup):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
 	/* ------------------ */
 
-	case Bvarbind+6:
+	OPCODE(Bvarbind6):
 	  op = FETCH;
 	  goto varbind;
 
-	case Bvarbind+7:
+	OPCODE(Bvarbind7):
 	  op = FETCH2;
 	  goto varbind;
 
-	case Bvarbind:
-	case Bvarbind+1:
-	case Bvarbind+2:
-	case Bvarbind+3:
-	case Bvarbind+4:
-	case Bvarbind+5:
-	  op -= Bvarbind;
+	OPCODE(Bvarbind0):
+	OPCODE(Bvarbind1):
+	OPCODE(Bvarbind2):
+	OPCODE(Bvarbind3):
+	OPCODE(Bvarbind4):
+	OPCODE(Bvarbind5):
+	  op -= Bvarbind0;
 	varbind:
 	  /* Specbind can signal and thus GC.  */
 	  BEFORE_POTENTIAL_GC ();
 	  specbind (vectorp[op], POP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bcall+6:
+	OPCODE(Bcall6):
 	  op = FETCH;
 	  goto docall;
 
-	case Bcall+7:
+	OPCODE(Bcall7):
 	  op = FETCH2;
 	  goto docall;
 
-	case Bcall:
-	case Bcall+1:
-	case Bcall+2:
-	case Bcall+3:
-	case Bcall+4:
-	case Bcall+5:
-	  op -= Bcall;
+	OPCODE(Bcall0):
+	OPCODE(Bcall1):
+	OPCODE(Bcall2):
+	OPCODE(Bcall3):
+	OPCODE(Bcall4):
+	OPCODE(Bcall5):
+	  op -= Bcall0;
 	docall:
 	  {
 	    BEFORE_POTENTIAL_GC ();
@@ -688,47 +924,47 @@
 #endif
 	    TOP = Ffuncall (op + 1, &TOP);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bunbind+6:
+	OPCODE(Bunbind6):
 	  op = FETCH;
 	  goto dounbind;
 
-	case Bunbind+7:
+	OPCODE(Bunbind7):
 	  op = FETCH2;
 	  goto dounbind;
 
-	case Bunbind:
-	case Bunbind+1:
-	case Bunbind+2:
-	case Bunbind+3:
-	case Bunbind+4:
-	case Bunbind+5:
-	  op -= Bunbind;
+	OPCODE(Bunbind0):
+	OPCODE(Bunbind1):
+	OPCODE(Bunbind2):
+	OPCODE(Bunbind3):
+	OPCODE(Bunbind4):
+	OPCODE(Bunbind5):
+	  op -= Bunbind0;
 	dounbind:
 	  BEFORE_POTENTIAL_GC ();
 	  unbind_to (SPECPDL_INDEX () - op, Qnil);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bunbind_all:
+	OPCODE(Bunbind_all):
 	  /* To unbind back to the beginning of this frame.  Not used yet,
 	     but will be needed for tail-recursion elimination.  */
 	  BEFORE_POTENTIAL_GC ();
 	  unbind_to (count, Qnil);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bgoto:
+	OPCODE(Bgoto):
 	  MAYBE_GC ();
 	  BYTE_CODE_QUIT;
 	  op = FETCH2;    /* pc = FETCH2 loses since FETCH2 contains pc++ */
 	  CHECK_RANGE (op);
 	  stack.pc = stack.byte_string_start + op;
-	  break;
+	  Next();
 
-	case Bgotoifnonnil:
+	OPCODE(Bgotoifnonnil):
 	  MAYBE_GC ();
 	  op = FETCH2;
 	  if (!NILP (POP))
@@ -737,9 +973,9 @@
 	      CHECK_RANGE (op);
 	      stack.pc = stack.byte_string_start + op;
 	    }
-	  break;
+	  Next();
 
-	case Bgotoifnilelsepop:
+	OPCODE(Bgotoifnilelsepop):
 	  MAYBE_GC ();
 	  op = FETCH2;
 	  if (NILP (TOP))
@@ -749,9 +985,9 @@
 	      stack.pc = stack.byte_string_start + op;
 	    }
 	  else DISCARD (1);
-	  break;
+	  Next();
 
-	case Bgotoifnonnilelsepop:
+	OPCODE(Bgotoifnonnilelsepop):
 	  MAYBE_GC ();
 	  op = FETCH2;
 	  if (!NILP (TOP))
@@ -761,15 +997,15 @@
 	      stack.pc = stack.byte_string_start + op;
 	    }
 	  else DISCARD (1);
-	  break;
+	  Next();
 
-	case BRgoto:
+	OPCODE(BRgoto):
 	  MAYBE_GC ();
 	  BYTE_CODE_QUIT;
 	  stack.pc += (int) *stack.pc - 127;
-	  break;
+	  Next();
 
-	case BRgotoifnil:
+	OPCODE(BRgotoifnil):
 	  MAYBE_GC ();
 	  if (NILP (POP))
 	    {
@@ -777,9 +1013,9 @@
 	      stack.pc += (int) *stack.pc - 128;
 	    }
 	  stack.pc++;
-	  break;
+	  Next();
 
-	case BRgotoifnonnil:
+	OPCODE(BRgotoifnonnil):
 	  MAYBE_GC ();
 	  if (!NILP (POP))
 	    {
@@ -787,9 +1023,9 @@
 	      stack.pc += (int) *stack.pc - 128;
 	    }
 	  stack.pc++;
-	  break;
+	  Next();
 
-	case BRgotoifnilelsepop:
+	OPCODE(BRgotoifnilelsepop):
 	  MAYBE_GC ();
 	  op = *stack.pc++;
 	  if (NILP (TOP))
@@ -798,9 +1034,9 @@
 	      stack.pc += op - 128;
 	    }
 	  else DISCARD (1);
-	  break;
+	  Next();
 
-	case BRgotoifnonnilelsepop:
+	OPCODE(BRgotoifnonnilelsepop):
 	  MAYBE_GC ();
 	  op = *stack.pc++;
 	  if (!NILP (TOP))
@@ -809,59 +1045,59 @@
 	      stack.pc += op - 128;
 	    }
 	  else DISCARD (1);
-	  break;
+	  Next();
 
-	case Breturn:
+	OPCODE(Breturn):
 	  result = POP;
 	  goto exit;
 
-	case Bdiscard:
+	OPCODE(Bdiscard):
 	  DISCARD (1);
-	  break;
+	  Next();
 
-	case Bconstant2:
+	OPCODE(Bconstant2):
 	  PUSH (vectorp[FETCH2]);
-	  break;
+	  Next();
 
-	case Bsave_excursion:
+	OPCODE(Bsave_excursion):
 	  record_unwind_protect (save_excursion_restore,
 				 save_excursion_save ());
-	  break;
+	  Next();
 
-	case Bsave_current_buffer:
-	case Bsave_current_buffer_1:
+	OPCODE(Bsave_current_buffer):
+	OPCODE(Bsave_current_buffer_1):
 	  record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
-	  break;
+	  Next();
 
-	case Bsave_window_excursion:
+	OPCODE(Bsave_window_excursion):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fsave_window_excursion (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bsave_restriction:
+	OPCODE(Bsave_restriction):
 	  record_unwind_protect (save_restriction_restore,
 				 save_restriction_save ());
-	  break;
+	  Next();
 
-	case Bcatch:
+	OPCODE(Bcatch):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = internal_catch (TOP, Feval, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bunwind_protect:
+	OPCODE(Bunwind_protect):
 	  /* The function record_unwind_protect can GC.  */
 	  BEFORE_POTENTIAL_GC ();
 	  record_unwind_protect (Fprogn, POP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bcondition_case:
+	OPCODE(Bcondition_case):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
@@ -869,18 +1105,18 @@
 	    BEFORE_POTENTIAL_GC ();
 	    TOP = Fcondition_case (Fcons (TOP, v1));
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Btemp_output_buffer_setup:
+	OPCODE(Btemp_output_buffer_setup):
 	  BEFORE_POTENTIAL_GC ();
 	  CHECK_STRING (TOP);
 	  temp_output_buffer_setup (SDATA (TOP));
 	  AFTER_POTENTIAL_GC ();
 	  TOP = Vstandard_output;
-	  break;
+	  Next();
 
-	case Btemp_output_buffer_show:
+	OPCODE(Btemp_output_buffer_show):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
@@ -890,10 +1126,10 @@
 	    /* pop binding of standard-output */
 	    unbind_to (SPECPDL_INDEX () - 1, Qnil);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bnth:
+	OPCODE(Bnth):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
@@ -928,173 +1164,173 @@
 		Fcar (wrong_type_argument (Qlistp, v1));
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Bsymbolp:
+	OPCODE(Bsymbolp):
 	  TOP = SYMBOLP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Bconsp:
+	OPCODE(Bconsp):
 	  TOP = CONSP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Bstringp:
+	OPCODE(Bstringp):
 	  TOP = STRINGP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Blistp:
+	OPCODE(Blistp):
 	  TOP = CONSP (TOP) || NILP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Bnot:
+	OPCODE(Bnot):
 	  TOP = NILP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Bcons:
+	OPCODE(Bcons):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
 	    TOP = Fcons (TOP, v1);
-	    break;
+	    Next();
 	  }
 
-	case Blist1:
+	OPCODE(Blist1):
 	  TOP = Fcons (TOP, Qnil);
-	  break;
+	  Next();
 
-	case Blist2:
+	OPCODE(Blist2):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
 	    TOP = Fcons (TOP, Fcons (v1, Qnil));
-	    break;
+	    Next();
 	  }
 
-	case Blist3:
+	OPCODE(Blist3):
 	  DISCARD (2);
 	  TOP = Flist (3, &TOP);
-	  break;
+	  Next();
 
-	case Blist4:
+	OPCODE(Blist4):
 	  DISCARD (3);
 	  TOP = Flist (4, &TOP);
-	  break;
+	  Next();
 
-	case BlistN:
+	OPCODE(BlistN):
 	  op = FETCH;
 	  DISCARD (op - 1);
 	  TOP = Flist (op, &TOP);
-	  break;
+	  Next();
 
-	case Blength:
+	OPCODE(Blength):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Flength (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Baref:
+	OPCODE(Baref):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Faref (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Baset:
+	OPCODE(Baset):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
 	    v2 = POP; v1 = POP;
 	    TOP = Faset (TOP, v1, v2);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bsymbol_value:
+	OPCODE(Bsymbol_value):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fsymbol_value (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bsymbol_function:
+	OPCODE(Bsymbol_function):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fsymbol_function (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bset:
+	OPCODE(Bset):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fset (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bfset:
+	OPCODE(Bfset):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Ffset (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bget:
+	OPCODE(Bget):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fget (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bsubstring:
+	OPCODE(Bsubstring):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
 	    v2 = POP; v1 = POP;
 	    TOP = Fsubstring (TOP, v1, v2);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bconcat2:
+	OPCODE(Bconcat2):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fconcat (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bconcat3:
+	OPCODE(Bconcat3):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (2);
 	  TOP = Fconcat (3, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bconcat4:
+	OPCODE(Bconcat4):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (3);
 	  TOP = Fconcat (4, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case BconcatN:
+	OPCODE(BconcatN):
 	  op = FETCH;
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (op - 1);
 	  TOP = Fconcat (op, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bsub1:
+	OPCODE(Bsub1):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1109,10 +1345,10 @@
 		TOP = Fsub1 (v1);
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Badd1:
+	OPCODE(Badd1):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1127,10 +1363,10 @@
 		TOP = Fadd1 (v1);
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Beqlsign:
+	OPCODE(Beqlsign):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
@@ -1148,57 +1384,57 @@
 	      }
 	    else
 	      TOP = (XINT (v1) == XINT (v2) ? Qt : Qnil);
-	    break;
+	    Next();
 	  }
 
-	case Bgtr:
+	OPCODE(Bgtr):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fgtr (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Blss:
+	OPCODE(Blss):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Flss (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bleq:
+	OPCODE(Bleq):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fleq (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bgeq:
+	OPCODE(Bgeq):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fgeq (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bdiff:
+	OPCODE(Bdiff):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fminus (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bnegate:
+	OPCODE(Bnegate):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1213,258 +1449,258 @@
 		TOP = Fminus (1, &TOP);
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Bplus:
+	OPCODE(Bplus):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fplus (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bmax:
+	OPCODE(Bmax):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fmax (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bmin:
+	OPCODE(Bmin):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fmin (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bmult:
+	OPCODE(Bmult):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Ftimes (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bquo:
+	OPCODE(Bquo):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fquo (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Brem:
+	OPCODE(Brem):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Frem (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bpoint:
+	OPCODE(Bpoint):
 	  {
 	    Lisp_Object v1;
 	    XSETFASTINT (v1, PT);
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bgoto_char:
+	OPCODE(Bgoto_char):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fgoto_char (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Binsert:
+	OPCODE(Binsert):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Finsert (1, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case BinsertN:
+	OPCODE(BinsertN):
 	  op = FETCH;
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (op - 1);
 	  TOP = Finsert (op, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bpoint_max:
+	OPCODE(Bpoint_max):
 	  {
 	    Lisp_Object v1;
 	    XSETFASTINT (v1, ZV);
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bpoint_min:
+	OPCODE(Bpoint_min):
 	  {
 	    Lisp_Object v1;
 	    XSETFASTINT (v1, BEGV);
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bchar_after:
+	OPCODE(Bchar_after):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fchar_after (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bfollowing_char:
+	OPCODE(Bfollowing_char):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = Ffollowing_char ();
 	    AFTER_POTENTIAL_GC ();
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bpreceding_char:
+	OPCODE(Bpreceding_char):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = Fprevious_char ();
 	    AFTER_POTENTIAL_GC ();
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bcurrent_column:
+	OPCODE(Bcurrent_column):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    XSETFASTINT (v1, (int) current_column ()); /* iftc */
 	    AFTER_POTENTIAL_GC ();
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bindent_to:
+	OPCODE(Bindent_to):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Findent_to (TOP, Qnil);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Beolp:
+	OPCODE(Beolp):
 	  PUSH (Feolp ());
-	  break;
+	  Next();
 
-	case Beobp:
+	OPCODE(Beobp):
 	  PUSH (Feobp ());
-	  break;
+	  Next();
 
-	case Bbolp:
+	OPCODE(Bbolp):
 	  PUSH (Fbolp ());
-	  break;
+	  Next();
 
-	case Bbobp:
+	OPCODE(Bbobp):
 	  PUSH (Fbobp ());
-	  break;
+	  Next();
 
-	case Bcurrent_buffer:
+	OPCODE(Bcurrent_buffer):
 	  PUSH (Fcurrent_buffer ());
-	  break;
+	  Next();
 
-	case Bset_buffer:
+	OPCODE(Bset_buffer):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fset_buffer (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Binteractive_p:
+	OPCODE(Binteractive_p):
 	  PUSH (Finteractive_p ());
-	  break;
+	  Next();
 
-	case Bforward_char:
+	OPCODE(Bforward_char):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fforward_char (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bforward_word:
+	OPCODE(Bforward_word):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fforward_word (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bskip_chars_forward:
+	OPCODE(Bskip_chars_forward):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fskip_chars_forward (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bskip_chars_backward:
+	OPCODE(Bskip_chars_backward):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fskip_chars_backward (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bforward_line:
+	OPCODE(Bforward_line):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fforward_line (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bchar_syntax:
+	OPCODE(Bchar_syntax):
 	  BEFORE_POTENTIAL_GC ();
 	  CHECK_NUMBER (TOP);
 	  AFTER_POTENTIAL_GC ();
 	  XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (XINT (TOP))]);
-	  break;
+	  Next();
 
-	case Bbuffer_substring:
+	OPCODE(Bbuffer_substring):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fbuffer_substring (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bdelete_region:
+	OPCODE(Bdelete_region):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fdelete_region (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bnarrow_to_region:
+	OPCODE(Bnarrow_to_region):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fnarrow_to_region (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bwiden:
+	OPCODE(Bwiden):
 	  BEFORE_POTENTIAL_GC ();
 	  PUSH (Fwiden ());
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bend_of_line:
+	OPCODE(Bend_of_line):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fend_of_line (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bset_marker:
+	OPCODE(Bset_marker):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
@@ -1472,72 +1708,72 @@
 	    v2 = POP;
 	    TOP = Fset_marker (TOP, v2, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bmatch_beginning:
+	OPCODE(Bmatch_beginning):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fmatch_beginning (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bmatch_end:
+	OPCODE(Bmatch_end):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fmatch_end (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bupcase:
+	OPCODE(Bupcase):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fupcase (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bdowncase:
+	OPCODE(Bdowncase):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fdowncase (TOP);
 	  AFTER_POTENTIAL_GC ();
-	break;
+	Next();
 
-	case Bstringeqlsign:
+	OPCODE(Bstringeqlsign):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fstring_equal (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bstringlss:
+	OPCODE(Bstringlss):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fstring_lessp (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bequal:
+	OPCODE(Bequal):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
 	    TOP = Fequal (TOP, v1);
-	    break;
+	    Next();
 	  }
 
-	case Bnthcdr:
+	OPCODE(Bnthcdr):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fnthcdr (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Belt:
+	OPCODE(Belt):
 	  {
 	    Lisp_Object v1, v2;
 	    if (CONSP (TOP))
@@ -1583,56 +1819,56 @@
 		TOP = Felt (TOP, v1);
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Bmember:
+	OPCODE(Bmember):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fmember (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bassq:
+	OPCODE(Bassq):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fassq (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bnreverse:
+	OPCODE(Bnreverse):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fnreverse (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bsetcar:
+	OPCODE(Bsetcar):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fsetcar (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bsetcdr:
+	OPCODE(Bsetcdr):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fsetcdr (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bcar_safe:
+	OPCODE(Bcar_safe):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1640,10 +1876,10 @@
 	      TOP = XCAR (v1);
 	    else
 	      TOP = Qnil;
-	    break;
+	    Next();
 	  }
 
-	case Bcdr_safe:
+	OPCODE(Bcdr_safe):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1651,42 +1887,42 @@
 	      TOP = XCDR (v1);
 	    else
 	      TOP = Qnil;
-	    break;
+	    Next();
 	  }
 
-	case Bnconc:
+	OPCODE(Bnconc):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fnconc (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bnumberp:
+	OPCODE(Bnumberp):
 	  TOP = (NUMBERP (TOP) ? Qt : Qnil);
-	  break;
+	  Next();
 
-	case Bintegerp:
+	OPCODE(Bintegerp):
 	  TOP = INTEGERP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
 #ifdef BYTE_CODE_SAFE
-	case Bset_mark:
+	OPCODE(Bset_mark):
 	  BEFORE_POTENTIAL_GC ();
 	  error ("set-mark is an obsolete bytecode");
 	  AFTER_POTENTIAL_GC ();
-	  break;
-	case Bscan_buffer:
+	  Next();
+	OPCODE(Bscan_buffer):
 	  BEFORE_POTENTIAL_GC ();
 	  error ("scan-buffer is an obsolete bytecode");
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 #endif
 
-	case 0:
+	OPCODE(0):
 	  abort ();
 
-	case 255:
-	default:
+	OPCODE(255):
+	DEFAULT:
 #ifdef BYTE_CODE_SAFE
 	  if (op < Bconstant)
 	    {
@@ -1700,8 +1936,12 @@
 #else
 	  PUSH (vectorp[op - Bconstant]);
 #endif
+        Next();
+
+#ifndef THREADED_CODE
 	}
     }
+#endif  /* !THREADED_CODE */
 
  exit:
 

[-- Attachment #3: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: threaded code in bytecode.c
  2004-05-03  1:10 threaded code in bytecode.c jay
@ 2004-05-03  1:35 ` Miles Bader
  2004-05-03  4:15   ` Jaeyoun Chung
  2004-05-03 22:20 ` Richard Stallman
  1 sibling, 1 reply; 7+ messages in thread
From: Miles Bader @ 2004-05-03  1:35 UTC (permalink / raw)
  Cc: emacs-devel

On Mon, May 03, 2004 at 10:10:11AM +0900, jay@people.kldp.org wrote:
> I've just added gcc's computed goto based bytecode interpretation in
> bytecode.c without affecting any other parts. 

Does using this gcc extension make any noticeable speed difference?

BTW, your patch contains a lot of unnecessary reformatting &c of the
byte-code #defines (white space changes, replacing `foo + N' with `fooN'),
which makes the patch harder to read and will likely cause merge conflicts.

Thanks,

-Miles
-- 
[|nurgle|]  ddt- demonic? so quake will have an evil kinda setting? one that
            will  make every christian in the world foamm at the mouth?
[iddt]      nurg, that's the goal

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: threaded code in bytecode.c
  2004-05-03  1:35 ` Miles Bader
@ 2004-05-03  4:15   ` Jaeyoun Chung
  0 siblings, 0 replies; 7+ messages in thread
From: Jaeyoun Chung @ 2004-05-03  4:15 UTC (permalink / raw)


* Miles Bader <miles@gnu.org> at 2004-05-02 21:35-0400
| On Mon, May 03, 2004 at 10:10:11AM +0900, jay@people.kldp.org wrote:
>> I've just added gcc's computed goto based bytecode interpretation in
>> bytecode.c without affecting any other parts. 
>
| Does using this gcc extension make any noticeable speed difference?

Well, I didn't checked it out but I'm sure it will. at least the dispatching
overhead has been half-ed. After all, reducing the bytecode interpretation
overhead worth trying.

I really wanted to specify some register dedication for 'op' and `top' and a
few other fields but didn't apply them yet since I don't know how to make it
portable except for sparc and x86 machines.

| BTW, your patch contains a lot of unnecessary reformatting &c of the
| byte-code #defines (white space changes, replacing `foo + N' with `fooN'),
| which makes the patch harder to read and will likely cause merge conflicts.

well, i think realigning the number would be better for the readability.
I'll not change the spaces so that spurious diffs does not bother developers.

And converting 'foo + N' to fooN is a necessity to give it a label in case
THREADED_CODE is defined. And also, I think it is more explicit than using the
implicit '+ N' rule for those operator.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: threaded code in bytecode.c
  2004-05-03  1:10 threaded code in bytecode.c jay
  2004-05-03  1:35 ` Miles Bader
@ 2004-05-03 22:20 ` Richard Stallman
  2004-05-04  1:06   ` Jaeyoun Chung
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2004-05-03 22:20 UTC (permalink / raw)
  Cc: emacs-devel

the main possible benefit of this change is a speedup.  How much
speedup do you observe from it?  It would be good to compare various
GCC optimization levels as well as the two versions of the code.

A large part of your change seems to be in the indentation of the
#define's for bytecode operations.  Please do not combine such a large
cosmetic change with any substantive change.

I think it is better to leave that indentation the way it is, but if
we do change it, we should install that change separately.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: threaded code in bytecode.c
  2004-05-03 22:20 ` Richard Stallman
@ 2004-05-04  1:06   ` Jaeyoun Chung
  2004-05-04 20:08     ` Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Jaeyoun Chung @ 2004-05-04  1:06 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 637 bytes --]

* Richard Stallman <rms@gnu.org> at 2004-05-03 18:20-0400
| the main possible benefit of this change is a speedup.  How much
| speedup do you observe from it?  It would be good to compare various
| GCC optimization levels as well as the two versions of the code.

well, the fact is i don't know how to measure this speedup? Could you suggest
some agreeable method?

| A large part of your change seems to be in the indentation of the
| #define's for bytecode operations.  Please do not combine such a large
| cosmetic change with any substantive change.

yup, sorry for that. I undoed those noisy re-indentation.
here's the patch again.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: threaded code patch in bytecode.c --]
[-- Type: text/x-patch, Size: 30644 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.3655
diff -u -r1.3655 ChangeLog
--- ChangeLog	2 May 2004 18:47:57 -0000	1.3655
+++ ChangeLog	4 May 2004 01:04:13 -0000
@@ -1,3 +1,8 @@
+2004-05-03  Jaeyoun Chung  <jay@kldp.org>
+
+	* bytecode.c (Fbyte_code): theaded bytecode interpretation code added.
+	Define THREADED_CODE to enable computed goto based interpretation.
+
 2004-05-02  Eli Zaretskii  <eliz@gnu.org>
 
 	* syntax.h (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY_INT): Avoid
Index: bytecode.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/bytecode.c,v
retrieving revision 1.79
diff -u -r1.79 bytecode.c
--- bytecode.c	11 Sep 2003 21:58:32 -0000	1.79
+++ bytecode.c	4 May 2004 01:04:14 -0000
@@ -55,6 +55,10 @@
 /* #define BYTE_CODE_SAFE */
 /* #define BYTE_CODE_METER */
 
+/* define THREADED_CODE to enable the gcc's computed goto based jump instead
+ * of while(1) switch bytecod dispatch */
+/* #define THREADED_CODE */
+
 \f
 #ifdef BYTE_CODE_METER
 
@@ -91,10 +95,50 @@
 /*  Byte codes: */
 
 #define Bvarref 010
+#define Bvarref0  010
+#define Bvarref1  011
+#define Bvarref2  012
+#define Bvarref3  013
+#define Bvarref4  014
+#define Bvarref5  015
+#define Bvarref6  016
+#define Bvarref7  017
 #define Bvarset 020
+#define Bvarset0  020
+#define Bvarset1  021
+#define Bvarset2  022
+#define Bvarset3  023
+#define Bvarset4  024
+#define Bvarset5  025
+#define Bvarset6  026
+#define Bvarset7  027
 #define Bvarbind 030
+#define Bvarbind0 030
+#define Bvarbind1 031
+#define Bvarbind2 032
+#define Bvarbind3 033
+#define Bvarbind4 034
+#define Bvarbind5 035
+#define Bvarbind6 036
+#define Bvarbind7 037
 #define Bcall 040
+#define Bcall0    040
+#define Bcall1    041
+#define Bcall2    042
+#define Bcall3    043
+#define Bcall4    044
+#define Bcall5    045
+#define Bcall6    046
+#define Bcall7    047
 #define Bunbind 050
+#define Bunbind0  050
+#define Bunbind1  051
+#define Bunbind2  052
+#define Bunbind3  053
+#define Bunbind4  054
+#define Bunbind5  055
+#define Bunbind6  056
+#define Bunbind7  057
 
 #define Bnth 070
 #define Bsymbolp 071
@@ -390,7 +434,6 @@
       }							\
   } while (0)
 
-
 DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0,
        doc: /* Function used internally in byte-compiled code.
 The first argument, BYTESTR, is a string of byte code;
@@ -417,6 +460,198 @@
   Lisp_Object *top;
   Lisp_Object result;
 
+#ifdef THREADED_CODE
+# define OPCODE(X)   lbl_ ##X
+# define Next() goto *op_tbls[op = FETCH]
+# define DEFAULT     lbl_default
+
+  static int op_inited = 0;
+  static void **op_tbls[256] = {
+# define OPLABL(X)   [X] = &&lbl_ ##X
+OPLABL(Bvarref7),
+OPLABL(Bvarref0),
+OPLABL(Bvarref1),
+OPLABL(Bvarref2),
+OPLABL(Bvarref3),
+OPLABL(Bvarref4),
+OPLABL(Bvarref5),
+OPLABL(Bvarref6),
+OPLABL(Bgotoifnil),
+OPLABL(Bcar),
+OPLABL(Beq),
+OPLABL(Bmemq),
+OPLABL(Bcdr),
+OPLABL(Bvarset0),
+OPLABL(Bvarset1),
+OPLABL(Bvarset2),
+OPLABL(Bvarset3),
+OPLABL(Bvarset4),
+OPLABL(Bvarset5),
+OPLABL(Bvarset7),
+OPLABL(Bvarset6),
+OPLABL(Bdup),
+OPLABL(Bvarbind6),
+OPLABL(Bvarbind7),
+OPLABL(Bvarbind0),
+OPLABL(Bvarbind1),
+OPLABL(Bvarbind2),
+OPLABL(Bvarbind3),
+OPLABL(Bvarbind4),
+OPLABL(Bvarbind5),
+OPLABL(Bcall6),
+OPLABL(Bcall7),
+OPLABL(Bcall0),
+OPLABL(Bcall1),
+OPLABL(Bcall2),
+OPLABL(Bcall3),
+OPLABL(Bcall4),
+OPLABL(Bcall5),
+OPLABL(Bunbind6),
+OPLABL(Bunbind7),
+OPLABL(Bunbind0),
+OPLABL(Bunbind1),
+OPLABL(Bunbind2),
+OPLABL(Bunbind3),
+OPLABL(Bunbind4),
+OPLABL(Bunbind5),
+OPLABL(Bunbind_all),
+OPLABL(Bgoto),
+OPLABL(Bgotoifnonnil),
+OPLABL(Bgotoifnilelsepop),
+OPLABL(Bgotoifnonnilelsepop),
+OPLABL(BRgoto),
+OPLABL(BRgotoifnil),
+OPLABL(BRgotoifnonnil),
+OPLABL(BRgotoifnilelsepop),
+OPLABL(BRgotoifnonnilelsepop),
+OPLABL(Breturn),
+OPLABL(Bdiscard),
+OPLABL(Bconstant2),
+OPLABL(Bsave_excursion),
+OPLABL(Bsave_current_buffer),
+OPLABL(Bsave_current_buffer_1),
+OPLABL(Bsave_window_excursion),
+OPLABL(Bsave_restriction),
+OPLABL(Bcatch),
+OPLABL(Bunwind_protect),
+OPLABL(Bcondition_case),
+OPLABL(Btemp_output_buffer_setup),
+OPLABL(Btemp_output_buffer_show),
+OPLABL(Bnth),
+OPLABL(Bsymbolp),
+OPLABL(Bconsp),
+OPLABL(Bstringp),
+OPLABL(Blistp),
+OPLABL(Bnot),
+OPLABL(Bcons),
+OPLABL(Blist1),
+OPLABL(Blist2),
+OPLABL(Blist3),
+OPLABL(Blist4),
+OPLABL(BlistN),
+OPLABL(Blength),
+OPLABL(Baref),
+OPLABL(Baset),
+OPLABL(Bsymbol_value),
+OPLABL(Bsymbol_function),
+OPLABL(Bset),
+OPLABL(Bfset),
+OPLABL(Bget),
+OPLABL(Bsubstring),
+OPLABL(Bconcat2),
+OPLABL(Bconcat3),
+OPLABL(Bconcat4),
+OPLABL(BconcatN),
+OPLABL(Bsub1),
+OPLABL(Badd1),
+OPLABL(Beqlsign),
+OPLABL(Bgtr),
+OPLABL(Blss),
+OPLABL(Bleq),
+OPLABL(Bgeq),
+OPLABL(Bdiff),
+OPLABL(Bnegate),
+OPLABL(Bplus),
+OPLABL(Bmax),
+OPLABL(Bmin),
+OPLABL(Bmult),
+OPLABL(Bquo),
+OPLABL(Brem),
+OPLABL(Bpoint),
+OPLABL(Bgoto_char),
+OPLABL(Binsert),
+OPLABL(BinsertN),
+OPLABL(Bpoint_max),
+OPLABL(Bpoint_min),
+OPLABL(Bchar_after),
+OPLABL(Bfollowing_char),
+OPLABL(Bpreceding_char),
+OPLABL(Bcurrent_column),
+OPLABL(Bindent_to),
+OPLABL(Beolp),
+OPLABL(Beobp),
+OPLABL(Bbolp),
+OPLABL(Bbobp),
+OPLABL(Bcurrent_buffer),
+OPLABL(Bset_buffer),
+OPLABL(Binteractive_p),
+OPLABL(Bforward_char),
+OPLABL(Bforward_word),
+OPLABL(Bskip_chars_forward),
+OPLABL(Bskip_chars_backward),
+OPLABL(Bforward_line),
+OPLABL(Bchar_syntax),
+OPLABL(Bbuffer_substring),
+OPLABL(Bdelete_region),
+OPLABL(Bnarrow_to_region),
+OPLABL(Bwiden),
+OPLABL(Bend_of_line),
+OPLABL(Bset_marker),
+OPLABL(Bmatch_beginning),
+OPLABL(Bmatch_end),
+OPLABL(Bupcase),
+OPLABL(Bdowncase),
+OPLABL(Bstringeqlsign),
+OPLABL(Bstringlss),
+OPLABL(Bequal),
+OPLABL(Bnthcdr),
+OPLABL(Belt),
+OPLABL(Bmember),
+OPLABL(Bassq),
+OPLABL(Bnreverse),
+OPLABL(Bsetcar),
+OPLABL(Bsetcdr),
+OPLABL(Bcar_safe),
+OPLABL(Bcdr_safe),
+OPLABL(Bnconc),
+OPLABL(Bnumberp),
+OPLABL(Bintegerp),
+# ifdef BYTE_CODE_SAFE
+OPLABL(Bset_mark),
+OPLABL(Bscan_buffer),
+# endif
+OPLABL(0),
+OPLABL(255),
+
+# undef OPLABL
+  };
+
+  if (!op_inited) {
+    int i;
+
+    for (i = 0; i < sizeof (op_tbls)/sizeof(op_tbls[0]); ++i)
+      if (!op_tbls[i]) op_tbls[i] = &&lbl_default;
+
+    op_inited = 1;
+  }
+
+#else
+# define OPCODE(X)   case X
+# define Next()      break
+# define DEFAULT     default
+#endif  /* THREADED_CODE */
+
+
 #ifdef CHECK_FRAME_FONT
  {
    struct frame *f = SELECTED_FRAME ();
@@ -457,6 +692,7 @@
   stacke = stack.bottom - 1 + XFASTINT (maxdepth);
 #endif
 
+#ifndef THREADED_CODE
   while (1)
     {
 #ifdef BYTE_CODE_SAFE
@@ -476,22 +712,26 @@
 
       switch (op)
 	{
-	case Bvarref + 7:
+#else
+          Next();
+#endif  /* !THREADED_CODE */
+
+        OPCODE(Bvarref7):
 	  op = FETCH2;
 	  goto varref;
 
-	case Bvarref:
-	case Bvarref + 1:
-	case Bvarref + 2:
-	case Bvarref + 3:
-	case Bvarref + 4:
-	case Bvarref + 5:
-	  op = op - Bvarref;
+	OPCODE(Bvarref0):
+	OPCODE(Bvarref1):
+	OPCODE(Bvarref2):
+	OPCODE(Bvarref3):
+	OPCODE(Bvarref4):
+	OPCODE(Bvarref5):
+	  op = op - Bvarref0;
 	  goto varref;
 
 	/* This seems to be the most frequently executed byte-code
 	   among the Bvarref's, so avoid a goto here.  */
-	case Bvarref+6:
+	OPCODE(Bvarref6):
 	  op = FETCH;
 	varref:
 	  {
@@ -515,10 +755,10 @@
 		AFTER_POTENTIAL_GC ();
 	      }
 	    PUSH (v2);
-	    break;
+	    Next();
 	  }
 
-	case Bgotoifnil:
+	OPCODE(Bgotoifnil):
 	  MAYBE_GC ();
 	  op = FETCH2;
 	  if (NILP (POP))
@@ -527,9 +767,9 @@
 	      CHECK_RANGE (op);
 	      stack.pc = stack.byte_string_start + op;
 	    }
-	  break;
+	  Next();
 
-	case Bcar:
+	OPCODE(Bcar):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -543,28 +783,28 @@
 		Fcar (wrong_type_argument (Qlistp, v1));
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Beq:
+	OPCODE(Beq):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
 	    TOP = EQ (v1, TOP) ? Qt : Qnil;
-	    break;
+	    Next();
 	  }
 
-	case Bmemq:
+	OPCODE(Bmemq):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fmemq (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bcdr:
+	OPCODE(Bcdr):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -578,23 +818,23 @@
 		Fcdr (wrong_type_argument (Qlistp, v1));
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Bvarset:
-	case Bvarset+1:
-	case Bvarset+2:
-	case Bvarset+3:
-	case Bvarset+4:
-	case Bvarset+5:
-	  op -= Bvarset;
+	OPCODE(Bvarset0):
+	OPCODE(Bvarset1):
+	OPCODE(Bvarset2):
+	OPCODE(Bvarset3):
+	OPCODE(Bvarset4):
+	OPCODE(Bvarset5):
+	  op -= Bvarset0;
 	  goto varset;
 
-	case Bvarset+7:
+	OPCODE(Bvarset7):
 	  op = FETCH2;
 	  goto varset;
 
-	case Bvarset+6:
+	OPCODE(Bvarset6):
 	  op = FETCH;
 	varset:
 	  {
@@ -618,55 +858,55 @@
 	      }
 	  }
 	  (void) POP;
-	  break;
+	  Next();
 
-	case Bdup:
+	OPCODE(Bdup):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
 	/* ------------------ */
 
-	case Bvarbind+6:
+	OPCODE(Bvarbind6):
 	  op = FETCH;
 	  goto varbind;
 
-	case Bvarbind+7:
+	OPCODE(Bvarbind7):
 	  op = FETCH2;
 	  goto varbind;
 
-	case Bvarbind:
-	case Bvarbind+1:
-	case Bvarbind+2:
-	case Bvarbind+3:
-	case Bvarbind+4:
-	case Bvarbind+5:
-	  op -= Bvarbind;
+	OPCODE(Bvarbind0):
+	OPCODE(Bvarbind1):
+	OPCODE(Bvarbind2):
+	OPCODE(Bvarbind3):
+	OPCODE(Bvarbind4):
+	OPCODE(Bvarbind5):
+	  op -= Bvarbind0;
 	varbind:
 	  /* Specbind can signal and thus GC.  */
 	  BEFORE_POTENTIAL_GC ();
 	  specbind (vectorp[op], POP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bcall+6:
+	OPCODE(Bcall6):
 	  op = FETCH;
 	  goto docall;
 
-	case Bcall+7:
+	OPCODE(Bcall7):
 	  op = FETCH2;
 	  goto docall;
 
-	case Bcall:
-	case Bcall+1:
-	case Bcall+2:
-	case Bcall+3:
-	case Bcall+4:
-	case Bcall+5:
-	  op -= Bcall;
+	OPCODE(Bcall0):
+	OPCODE(Bcall1):
+	OPCODE(Bcall2):
+	OPCODE(Bcall3):
+	OPCODE(Bcall4):
+	OPCODE(Bcall5):
+	  op -= Bcall0;
 	docall:
 	  {
 	    BEFORE_POTENTIAL_GC ();
@@ -688,47 +928,47 @@
 #endif
 	    TOP = Ffuncall (op + 1, &TOP);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bunbind+6:
+	OPCODE(Bunbind6):
 	  op = FETCH;
 	  goto dounbind;
 
-	case Bunbind+7:
+	OPCODE(Bunbind7):
 	  op = FETCH2;
 	  goto dounbind;
 
-	case Bunbind:
-	case Bunbind+1:
-	case Bunbind+2:
-	case Bunbind+3:
-	case Bunbind+4:
-	case Bunbind+5:
-	  op -= Bunbind;
+	OPCODE(Bunbind0):
+	OPCODE(Bunbind1):
+	OPCODE(Bunbind2):
+	OPCODE(Bunbind3):
+	OPCODE(Bunbind4):
+	OPCODE(Bunbind5):
+	  op -= Bunbind0;
 	dounbind:
 	  BEFORE_POTENTIAL_GC ();
 	  unbind_to (SPECPDL_INDEX () - op, Qnil);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bunbind_all:
+	OPCODE(Bunbind_all):
 	  /* To unbind back to the beginning of this frame.  Not used yet,
 	     but will be needed for tail-recursion elimination.  */
 	  BEFORE_POTENTIAL_GC ();
 	  unbind_to (count, Qnil);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bgoto:
+	OPCODE(Bgoto):
 	  MAYBE_GC ();
 	  BYTE_CODE_QUIT;
 	  op = FETCH2;    /* pc = FETCH2 loses since FETCH2 contains pc++ */
 	  CHECK_RANGE (op);
 	  stack.pc = stack.byte_string_start + op;
-	  break;
+	  Next();
 
-	case Bgotoifnonnil:
+	OPCODE(Bgotoifnonnil):
 	  MAYBE_GC ();
 	  op = FETCH2;
 	  if (!NILP (POP))
@@ -737,9 +977,9 @@
 	      CHECK_RANGE (op);
 	      stack.pc = stack.byte_string_start + op;
 	    }
-	  break;
+	  Next();
 
-	case Bgotoifnilelsepop:
+	OPCODE(Bgotoifnilelsepop):
 	  MAYBE_GC ();
 	  op = FETCH2;
 	  if (NILP (TOP))
@@ -749,9 +989,9 @@
 	      stack.pc = stack.byte_string_start + op;
 	    }
 	  else DISCARD (1);
-	  break;
+	  Next();
 
-	case Bgotoifnonnilelsepop:
+	OPCODE(Bgotoifnonnilelsepop):
 	  MAYBE_GC ();
 	  op = FETCH2;
 	  if (!NILP (TOP))
@@ -761,15 +1001,15 @@
 	      stack.pc = stack.byte_string_start + op;
 	    }
 	  else DISCARD (1);
-	  break;
+	  Next();
 
-	case BRgoto:
+	OPCODE(BRgoto):
 	  MAYBE_GC ();
 	  BYTE_CODE_QUIT;
 	  stack.pc += (int) *stack.pc - 127;
-	  break;
+	  Next();
 
-	case BRgotoifnil:
+	OPCODE(BRgotoifnil):
 	  MAYBE_GC ();
 	  if (NILP (POP))
 	    {
@@ -777,9 +1017,9 @@
 	      stack.pc += (int) *stack.pc - 128;
 	    }
 	  stack.pc++;
-	  break;
+	  Next();
 
-	case BRgotoifnonnil:
+	OPCODE(BRgotoifnonnil):
 	  MAYBE_GC ();
 	  if (!NILP (POP))
 	    {
@@ -787,9 +1027,9 @@
 	      stack.pc += (int) *stack.pc - 128;
 	    }
 	  stack.pc++;
-	  break;
+	  Next();
 
-	case BRgotoifnilelsepop:
+	OPCODE(BRgotoifnilelsepop):
 	  MAYBE_GC ();
 	  op = *stack.pc++;
 	  if (NILP (TOP))
@@ -798,9 +1038,9 @@
 	      stack.pc += op - 128;
 	    }
 	  else DISCARD (1);
-	  break;
+	  Next();
 
-	case BRgotoifnonnilelsepop:
+	OPCODE(BRgotoifnonnilelsepop):
 	  MAYBE_GC ();
 	  op = *stack.pc++;
 	  if (!NILP (TOP))
@@ -809,59 +1049,59 @@
 	      stack.pc += op - 128;
 	    }
 	  else DISCARD (1);
-	  break;
+	  Next();
 
-	case Breturn:
+	OPCODE(Breturn):
 	  result = POP;
 	  goto exit;
 
-	case Bdiscard:
+	OPCODE(Bdiscard):
 	  DISCARD (1);
-	  break;
+	  Next();
 
-	case Bconstant2:
+	OPCODE(Bconstant2):
 	  PUSH (vectorp[FETCH2]);
-	  break;
+	  Next();
 
-	case Bsave_excursion:
+	OPCODE(Bsave_excursion):
 	  record_unwind_protect (save_excursion_restore,
 				 save_excursion_save ());
-	  break;
+	  Next();
 
-	case Bsave_current_buffer:
-	case Bsave_current_buffer_1:
+	OPCODE(Bsave_current_buffer):
+	OPCODE(Bsave_current_buffer_1):
 	  record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
-	  break;
+	  Next();
 
-	case Bsave_window_excursion:
+	OPCODE(Bsave_window_excursion):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fsave_window_excursion (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bsave_restriction:
+	OPCODE(Bsave_restriction):
 	  record_unwind_protect (save_restriction_restore,
 				 save_restriction_save ());
-	  break;
+	  Next();
 
-	case Bcatch:
+	OPCODE(Bcatch):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = internal_catch (TOP, Feval, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bunwind_protect:
+	OPCODE(Bunwind_protect):
 	  /* The function record_unwind_protect can GC.  */
 	  BEFORE_POTENTIAL_GC ();
 	  record_unwind_protect (Fprogn, POP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bcondition_case:
+	OPCODE(Bcondition_case):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
@@ -869,18 +1109,18 @@
 	    BEFORE_POTENTIAL_GC ();
 	    TOP = Fcondition_case (Fcons (TOP, v1));
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Btemp_output_buffer_setup:
+	OPCODE(Btemp_output_buffer_setup):
 	  BEFORE_POTENTIAL_GC ();
 	  CHECK_STRING (TOP);
 	  temp_output_buffer_setup (SDATA (TOP));
 	  AFTER_POTENTIAL_GC ();
 	  TOP = Vstandard_output;
-	  break;
+	  Next();
 
-	case Btemp_output_buffer_show:
+	OPCODE(Btemp_output_buffer_show):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
@@ -890,10 +1130,10 @@
 	    /* pop binding of standard-output */
 	    unbind_to (SPECPDL_INDEX () - 1, Qnil);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bnth:
+	OPCODE(Bnth):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
@@ -928,173 +1168,173 @@
 		Fcar (wrong_type_argument (Qlistp, v1));
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Bsymbolp:
+	OPCODE(Bsymbolp):
 	  TOP = SYMBOLP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Bconsp:
+	OPCODE(Bconsp):
 	  TOP = CONSP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Bstringp:
+	OPCODE(Bstringp):
 	  TOP = STRINGP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Blistp:
+	OPCODE(Blistp):
 	  TOP = CONSP (TOP) || NILP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Bnot:
+	OPCODE(Bnot):
 	  TOP = NILP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
-	case Bcons:
+	OPCODE(Bcons):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
 	    TOP = Fcons (TOP, v1);
-	    break;
+	    Next();
 	  }
 
-	case Blist1:
+	OPCODE(Blist1):
 	  TOP = Fcons (TOP, Qnil);
-	  break;
+	  Next();
 
-	case Blist2:
+	OPCODE(Blist2):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
 	    TOP = Fcons (TOP, Fcons (v1, Qnil));
-	    break;
+	    Next();
 	  }
 
-	case Blist3:
+	OPCODE(Blist3):
 	  DISCARD (2);
 	  TOP = Flist (3, &TOP);
-	  break;
+	  Next();
 
-	case Blist4:
+	OPCODE(Blist4):
 	  DISCARD (3);
 	  TOP = Flist (4, &TOP);
-	  break;
+	  Next();
 
-	case BlistN:
+	OPCODE(BlistN):
 	  op = FETCH;
 	  DISCARD (op - 1);
 	  TOP = Flist (op, &TOP);
-	  break;
+	  Next();
 
-	case Blength:
+	OPCODE(Blength):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Flength (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Baref:
+	OPCODE(Baref):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Faref (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Baset:
+	OPCODE(Baset):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
 	    v2 = POP; v1 = POP;
 	    TOP = Faset (TOP, v1, v2);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bsymbol_value:
+	OPCODE(Bsymbol_value):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fsymbol_value (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bsymbol_function:
+	OPCODE(Bsymbol_function):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fsymbol_function (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bset:
+	OPCODE(Bset):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fset (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bfset:
+	OPCODE(Bfset):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Ffset (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bget:
+	OPCODE(Bget):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fget (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bsubstring:
+	OPCODE(Bsubstring):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
 	    v2 = POP; v1 = POP;
 	    TOP = Fsubstring (TOP, v1, v2);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bconcat2:
+	OPCODE(Bconcat2):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fconcat (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bconcat3:
+	OPCODE(Bconcat3):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (2);
 	  TOP = Fconcat (3, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bconcat4:
+	OPCODE(Bconcat4):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (3);
 	  TOP = Fconcat (4, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case BconcatN:
+	OPCODE(BconcatN):
 	  op = FETCH;
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (op - 1);
 	  TOP = Fconcat (op, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bsub1:
+	OPCODE(Bsub1):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1109,10 +1349,10 @@
 		TOP = Fsub1 (v1);
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Badd1:
+	OPCODE(Badd1):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1127,10 +1367,10 @@
 		TOP = Fadd1 (v1);
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Beqlsign:
+	OPCODE(Beqlsign):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
@@ -1148,57 +1388,57 @@
 	      }
 	    else
 	      TOP = (XINT (v1) == XINT (v2) ? Qt : Qnil);
-	    break;
+	    Next();
 	  }
 
-	case Bgtr:
+	OPCODE(Bgtr):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fgtr (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Blss:
+	OPCODE(Blss):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Flss (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bleq:
+	OPCODE(Bleq):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fleq (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bgeq:
+	OPCODE(Bgeq):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fgeq (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bdiff:
+	OPCODE(Bdiff):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fminus (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bnegate:
+	OPCODE(Bnegate):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1213,258 +1453,258 @@
 		TOP = Fminus (1, &TOP);
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Bplus:
+	OPCODE(Bplus):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fplus (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bmax:
+	OPCODE(Bmax):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fmax (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bmin:
+	OPCODE(Bmin):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fmin (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bmult:
+	OPCODE(Bmult):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Ftimes (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bquo:
+	OPCODE(Bquo):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fquo (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Brem:
+	OPCODE(Brem):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Frem (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bpoint:
+	OPCODE(Bpoint):
 	  {
 	    Lisp_Object v1;
 	    XSETFASTINT (v1, PT);
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bgoto_char:
+	OPCODE(Bgoto_char):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fgoto_char (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Binsert:
+	OPCODE(Binsert):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Finsert (1, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case BinsertN:
+	OPCODE(BinsertN):
 	  op = FETCH;
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (op - 1);
 	  TOP = Finsert (op, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bpoint_max:
+	OPCODE(Bpoint_max):
 	  {
 	    Lisp_Object v1;
 	    XSETFASTINT (v1, ZV);
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bpoint_min:
+	OPCODE(Bpoint_min):
 	  {
 	    Lisp_Object v1;
 	    XSETFASTINT (v1, BEGV);
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bchar_after:
+	OPCODE(Bchar_after):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fchar_after (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bfollowing_char:
+	OPCODE(Bfollowing_char):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = Ffollowing_char ();
 	    AFTER_POTENTIAL_GC ();
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bpreceding_char:
+	OPCODE(Bpreceding_char):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = Fprevious_char ();
 	    AFTER_POTENTIAL_GC ();
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bcurrent_column:
+	OPCODE(Bcurrent_column):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    XSETFASTINT (v1, (int) current_column ()); /* iftc */
 	    AFTER_POTENTIAL_GC ();
 	    PUSH (v1);
-	    break;
+	    Next();
 	  }
 
-	case Bindent_to:
+	OPCODE(Bindent_to):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Findent_to (TOP, Qnil);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Beolp:
+	OPCODE(Beolp):
 	  PUSH (Feolp ());
-	  break;
+	  Next();
 
-	case Beobp:
+	OPCODE(Beobp):
 	  PUSH (Feobp ());
-	  break;
+	  Next();
 
-	case Bbolp:
+	OPCODE(Bbolp):
 	  PUSH (Fbolp ());
-	  break;
+	  Next();
 
-	case Bbobp:
+	OPCODE(Bbobp):
 	  PUSH (Fbobp ());
-	  break;
+	  Next();
 
-	case Bcurrent_buffer:
+	OPCODE(Bcurrent_buffer):
 	  PUSH (Fcurrent_buffer ());
-	  break;
+	  Next();
 
-	case Bset_buffer:
+	OPCODE(Bset_buffer):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fset_buffer (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Binteractive_p:
+	OPCODE(Binteractive_p):
 	  PUSH (Finteractive_p ());
-	  break;
+	  Next();
 
-	case Bforward_char:
+	OPCODE(Bforward_char):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fforward_char (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bforward_word:
+	OPCODE(Bforward_word):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fforward_word (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bskip_chars_forward:
+	OPCODE(Bskip_chars_forward):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fskip_chars_forward (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bskip_chars_backward:
+	OPCODE(Bskip_chars_backward):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fskip_chars_backward (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bforward_line:
+	OPCODE(Bforward_line):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fforward_line (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bchar_syntax:
+	OPCODE(Bchar_syntax):
 	  BEFORE_POTENTIAL_GC ();
 	  CHECK_NUMBER (TOP);
 	  AFTER_POTENTIAL_GC ();
 	  XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (XINT (TOP))]);
-	  break;
+	  Next();
 
-	case Bbuffer_substring:
+	OPCODE(Bbuffer_substring):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fbuffer_substring (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bdelete_region:
+	OPCODE(Bdelete_region):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fdelete_region (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bnarrow_to_region:
+	OPCODE(Bnarrow_to_region):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fnarrow_to_region (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bwiden:
+	OPCODE(Bwiden):
 	  BEFORE_POTENTIAL_GC ();
 	  PUSH (Fwiden ());
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bend_of_line:
+	OPCODE(Bend_of_line):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fend_of_line (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bset_marker:
+	OPCODE(Bset_marker):
 	  {
 	    Lisp_Object v1, v2;
 	    BEFORE_POTENTIAL_GC ();
@@ -1472,72 +1712,72 @@
 	    v2 = POP;
 	    TOP = Fset_marker (TOP, v2, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bmatch_beginning:
+	OPCODE(Bmatch_beginning):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fmatch_beginning (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bmatch_end:
+	OPCODE(Bmatch_end):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fmatch_end (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bupcase:
+	OPCODE(Bupcase):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fupcase (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bdowncase:
+	OPCODE(Bdowncase):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fdowncase (TOP);
 	  AFTER_POTENTIAL_GC ();
-	break;
+	Next();
 
-	case Bstringeqlsign:
+	OPCODE(Bstringeqlsign):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fstring_equal (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bstringlss:
+	OPCODE(Bstringlss):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fstring_lessp (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bequal:
+	OPCODE(Bequal):
 	  {
 	    Lisp_Object v1;
 	    v1 = POP;
 	    TOP = Fequal (TOP, v1);
-	    break;
+	    Next();
 	  }
 
-	case Bnthcdr:
+	OPCODE(Bnthcdr):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fnthcdr (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Belt:
+	OPCODE(Belt):
 	  {
 	    Lisp_Object v1, v2;
 	    if (CONSP (TOP))
@@ -1583,56 +1823,56 @@
 		TOP = Felt (TOP, v1);
 		AFTER_POTENTIAL_GC ();
 	      }
-	    break;
+	    Next();
 	  }
 
-	case Bmember:
+	OPCODE(Bmember):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fmember (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bassq:
+	OPCODE(Bassq):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fassq (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bnreverse:
+	OPCODE(Bnreverse):
 	  BEFORE_POTENTIAL_GC ();
 	  TOP = Fnreverse (TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bsetcar:
+	OPCODE(Bsetcar):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fsetcar (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bsetcdr:
+	OPCODE(Bsetcdr):
 	  {
 	    Lisp_Object v1;
 	    BEFORE_POTENTIAL_GC ();
 	    v1 = POP;
 	    TOP = Fsetcdr (TOP, v1);
 	    AFTER_POTENTIAL_GC ();
-	    break;
+	    Next();
 	  }
 
-	case Bcar_safe:
+	OPCODE(Bcar_safe):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1640,10 +1880,10 @@
 	      TOP = XCAR (v1);
 	    else
 	      TOP = Qnil;
-	    break;
+	    Next();
 	  }
 
-	case Bcdr_safe:
+	OPCODE(Bcdr_safe):
 	  {
 	    Lisp_Object v1;
 	    v1 = TOP;
@@ -1651,42 +1891,42 @@
 	      TOP = XCDR (v1);
 	    else
 	      TOP = Qnil;
-	    break;
+	    Next();
 	  }
 
-	case Bnconc:
+	OPCODE(Bnconc):
 	  BEFORE_POTENTIAL_GC ();
 	  DISCARD (1);
 	  TOP = Fnconc (2, &TOP);
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 
-	case Bnumberp:
+	OPCODE(Bnumberp):
 	  TOP = (NUMBERP (TOP) ? Qt : Qnil);
-	  break;
+	  Next();
 
-	case Bintegerp:
+	OPCODE(Bintegerp):
 	  TOP = INTEGERP (TOP) ? Qt : Qnil;
-	  break;
+	  Next();
 
 #ifdef BYTE_CODE_SAFE
-	case Bset_mark:
+	OPCODE(Bset_mark):
 	  BEFORE_POTENTIAL_GC ();
 	  error ("set-mark is an obsolete bytecode");
 	  AFTER_POTENTIAL_GC ();
-	  break;
-	case Bscan_buffer:
+	  Next();
+	OPCODE(Bscan_buffer):
 	  BEFORE_POTENTIAL_GC ();
 	  error ("scan-buffer is an obsolete bytecode");
 	  AFTER_POTENTIAL_GC ();
-	  break;
+	  Next();
 #endif
 
-	case 0:
+	OPCODE(0):
 	  abort ();
 
-	case 255:
-	default:
+	OPCODE(255):
+	DEFAULT:
 #ifdef BYTE_CODE_SAFE
 	  if (op < Bconstant)
 	    {
@@ -1700,8 +1940,12 @@
 #else
 	  PUSH (vectorp[op - Bconstant]);
 #endif
+        Next();
+
+#ifndef THREADED_CODE
 	}
     }
+#endif  /* !THREADED_CODE */
 
  exit:
 

[-- Attachment #3: Type: text/plain, Size: 141 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: threaded code in bytecode.c
  2004-05-04  1:06   ` Jaeyoun Chung
@ 2004-05-04 20:08     ` Richard Stallman
  2004-05-05  5:40       ` Lars Brinkhoff
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2004-05-04 20:08 UTC (permalink / raw)
  Cc: emacs-devel

    * Richard Stallman <rms@gnu.org> at 2004-05-03 18:20-0400
    | the main possible benefit of this change is a speedup.  How much
    | speedup do you observe from it?  It would be good to compare various
    | GCC optimization levels as well as the two versions of the code.

    well, the fact is i don't know how to measure this speedup? Could you suggest
    some agreeable method?

You can run some computation-bound Lisp program in both versions of
Emacs and see how long it takes.  Just call (current-time) before and
after.  If the run time is too short to measure accurately, run the
program 100 times.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: threaded code in bytecode.c
  2004-05-04 20:08     ` Richard Stallman
@ 2004-05-05  5:40       ` Lars Brinkhoff
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Brinkhoff @ 2004-05-05  5:40 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:
>     * Richard Stallman <rms@gnu.org> at 2004-05-03 18:20-0400
>     | the main possible benefit of this change is a speedup.  How
>     | much speedup do you observe from it?  It would be good to
>     | compare various GCC optimization levels as well as the two
>     | versions of the code.
>     well, the fact is i don't know how to measure this speedup?
>     Could you suggest some agreeable method?
> You can run some computation-bound Lisp program in both versions of
> Emacs and see how long it takes.  Just call (current-time) before and
> after.  If the run time is too short to measure accurately, run the
> program 100 times.

The "Gabriel benchmarks" is a set of Lisp programs commonly used for
this purpose.  I don't think it would be too hard to port some of them
to Emacs Lisp.

ftp://ftp.cs.umass.edu/pub/eksl/gabriel/

-- 
Lars Brinkhoff,         Services for Unix, Linux, GCC, HTTP
Brinkhoff Consulting    http://www.brinkhoff.se/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-05-05  5:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-03  1:10 threaded code in bytecode.c jay
2004-05-03  1:35 ` Miles Bader
2004-05-03  4:15   ` Jaeyoun Chung
2004-05-03 22:20 ` Richard Stallman
2004-05-04  1:06   ` Jaeyoun Chung
2004-05-04 20:08     ` Richard Stallman
2004-05-05  5:40       ` Lars Brinkhoff

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).