aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorStefan Monnier2011-04-01 11:16:50 -0400
committerStefan Monnier2011-04-01 11:16:50 -0400
commit7200d79c65c65686495dd95e9f6dd436cf6db55e (patch)
tree5ad8e8f4ad0bb2dadfdc1d670cb3cd47db28a3f8 /src/bytecode.c
parent40d83b412f584cc02e68d4eac8fd5e6eb769e2fe (diff)
downloademacs-old-branches/lexbind-new.tar.gz
emacs-old-branches/lexbind-new.zip
Miscellanous cleanups in preparation for the merge.old-branches/lexbind-new
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Remove debug statement. * lisp/emacs-lisp/bytecomp.el (byte-compile-single-version) (byte-compile-version-cond, byte-compile-delay-out) (byte-compile-delayed-out): Remove, unused. * src/bytecode.c (Fbyte_code): Revert to old calling convention. * src/lisp.h (COMPILED_PUSH_ARGS): Remove, unused.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c41
1 files changed, 16 insertions, 25 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 01ae8055ebf..5d94cb0fb39 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -51,7 +51,7 @@ by Hallvard:
51 * 51 *
52 * define BYTE_CODE_METER to enable generation of a byte-op usage histogram. 52 * define BYTE_CODE_METER to enable generation of a byte-op usage histogram.
53 */ 53 */
54#define BYTE_CODE_SAFE 1 54/* #define BYTE_CODE_SAFE */
55/* #define BYTE_CODE_METER */ 55/* #define BYTE_CODE_METER */
56 56
57 57
@@ -160,7 +160,7 @@ extern Lisp_Object Qand_optional, Qand_rest;
160#ifdef BYTE_CODE_SAFE 160#ifdef BYTE_CODE_SAFE
161#define Bset_mark 0163 /* this loser is no longer generated as of v18 */ 161#define Bset_mark 0163 /* this loser is no longer generated as of v18 */
162#endif 162#endif
163#define Binteractive_p 0164 /* Obsolete. */ 163#define Binteractive_p 0164 /* Obsolete since Emacs-24.1. */
164 164
165#define Bforward_char 0165 165#define Bforward_char 0165
166#define Bforward_word 0166 166#define Bforward_word 0166
@@ -185,16 +185,16 @@ extern Lisp_Object Qand_optional, Qand_rest;
185#define Bdup 0211 185#define Bdup 0211
186 186
187#define Bsave_excursion 0212 187#define Bsave_excursion 0212
188#define Bsave_window_excursion 0213 /* Obsolete. */ 188#define Bsave_window_excursion 0213 /* Obsolete since Emacs-24.1. */
189#define Bsave_restriction 0214 189#define Bsave_restriction 0214
190#define Bcatch 0215 190#define Bcatch 0215
191 191
192#define Bunwind_protect 0216 192#define Bunwind_protect 0216
193#define Bcondition_case 0217 193#define Bcondition_case 0217
194#define Btemp_output_buffer_setup 0220 /* Obsolete. */ 194#define Btemp_output_buffer_setup 0220 /* Obsolete since Emacs-24.1. */
195#define Btemp_output_buffer_show 0221 /* Obsolete. */ 195#define Btemp_output_buffer_show 0221 /* Obsolete since Emacs-24.1. */
196 196
197#define Bunbind_all 0222 /* Obsolete. */ 197#define Bunbind_all 0222 /* Obsolete. Never used. */
198 198
199#define Bset_marker 0223 199#define Bset_marker 0223
200#define Bmatch_beginning 0224 200#define Bmatch_beginning 0224
@@ -413,24 +413,15 @@ unmark_byte_stack (void)
413 } while (0) 413 } while (0)
414 414
415 415
416DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, MANY, 0, 416DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0,
417 doc: /* Function used internally in byte-compiled code. 417 doc: /* Function used internally in byte-compiled code.
418The first argument, BYTESTR, is a string of byte code; 418The first argument, BYTESTR, is a string of byte code;
419the second, VECTOR, a vector of constants; 419the second, VECTOR, a vector of constants;
420the third, MAXDEPTH, the maximum stack depth used in this function. 420the third, MAXDEPTH, the maximum stack depth used in this function.
421If the third argument is incorrect, Emacs may crash. 421If the third argument is incorrect, Emacs may crash. */)
422 422 (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth)
423If ARGS-TEMPLATE is specified, it is an argument list specification,
424according to which any remaining arguments are pushed on the stack
425before executing BYTESTR.
426
427usage: (byte-code BYTESTR VECTOR MAXDEP &optional ARGS-TEMPLATE &rest ARGS) */)
428 (size_t nargs, Lisp_Object *args)
429{ 423{
430 Lisp_Object args_tmpl = nargs >= 4 ? args[3] : Qnil; 424 return exec_byte_code (bytestr, vector, maxdepth, Qnil, 0, NULL);
431 int pnargs = nargs >= 4 ? nargs - 4 : 0;
432 Lisp_Object *pargs = nargs >= 4 ? args + 4 : 0;
433 return exec_byte_code (args[0], args[1], args[2], args_tmpl, pnargs, pargs);
434} 425}
435 426
436/* Execute the byte-code in BYTESTR. VECTOR is the constant vector, and 427/* Execute the byte-code in BYTESTR. VECTOR is the constant vector, and
@@ -810,7 +801,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
810 AFTER_POTENTIAL_GC (); 801 AFTER_POTENTIAL_GC ();
811 break; 802 break;
812 803
813 case Bunbind_all: /* Obsolete. */ 804 case Bunbind_all: /* Obsolete. Never used. */
814 /* To unbind back to the beginning of this frame. Not used yet, 805 /* To unbind back to the beginning of this frame. Not used yet,
815 but will be needed for tail-recursion elimination. */ 806 but will be needed for tail-recursion elimination. */
816 BEFORE_POTENTIAL_GC (); 807 BEFORE_POTENTIAL_GC ();
@@ -938,12 +929,12 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
938 save_excursion_save ()); 929 save_excursion_save ());
939 break; 930 break;
940 931
941 case Bsave_current_buffer: /* Obsolete. */ 932 case Bsave_current_buffer: /* Obsolete since ??. */
942 case Bsave_current_buffer_1: 933 case Bsave_current_buffer_1:
943 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); 934 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
944 break; 935 break;
945 936
946 case Bsave_window_excursion: /* Obsolete. */ 937 case Bsave_window_excursion: /* Obsolete since 24.1. */
947 { 938 {
948 register int count = SPECPDL_INDEX (); 939 register int count = SPECPDL_INDEX ();
949 record_unwind_protect (Fset_window_configuration, 940 record_unwind_protect (Fset_window_configuration,
@@ -985,7 +976,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
985 break; 976 break;
986 } 977 }
987 978
988 case Btemp_output_buffer_setup: /* Obsolete. */ 979 case Btemp_output_buffer_setup: /* Obsolete since 24.1. */
989 BEFORE_POTENTIAL_GC (); 980 BEFORE_POTENTIAL_GC ();
990 CHECK_STRING (TOP); 981 CHECK_STRING (TOP);
991 temp_output_buffer_setup (SSDATA (TOP)); 982 temp_output_buffer_setup (SSDATA (TOP));
@@ -993,7 +984,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
993 TOP = Vstandard_output; 984 TOP = Vstandard_output;
994 break; 985 break;
995 986
996 case Btemp_output_buffer_show: /* Obsolete. */ 987 case Btemp_output_buffer_show: /* Obsolete since 24.1. */
997 { 988 {
998 Lisp_Object v1; 989 Lisp_Object v1;
999 BEFORE_POTENTIAL_GC (); 990 BEFORE_POTENTIAL_GC ();
@@ -1465,7 +1456,7 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1465 AFTER_POTENTIAL_GC (); 1456 AFTER_POTENTIAL_GC ();
1466 break; 1457 break;
1467 1458
1468 case Binteractive_p: /* Obsolete. */ 1459 case Binteractive_p: /* Obsolete since 24.1. */
1469 PUSH (Finteractive_p ()); 1460 PUSH (Finteractive_p ());
1470 break; 1461 break;
1471 1462