aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c
index fcee7d4df7e..cc9ee110aec 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4438,6 +4438,40 @@ init_obarray_once (void)
4438} 4438}
4439 4439
4440 4440
4441static union Aligned_Lisp_Subr *subr_ptr = NULL;
4442static bool using_BC_subrs = false;
4443
4444DEFUN ("switch-to-BC-subrs", Fswitch_to_BC_subrs, Sswitch_to_BC_subrs, 0, 0, 0,
4445 doc: /* Switch all subrs to using the byte compiler versions. */)
4446 (void)
4447{
4448 union Aligned_Lisp_Subr *ptr = subr_ptr;
4449 if (!using_BC_subrs)
4450 while (ptr)
4451 {
4452 ptr->s.function = ptr->s.BC_function;
4453 ptr = ptr->s.next;
4454 }
4455 using_BC_subrs = true;
4456 return Qnil;
4457}
4458
4459DEFUN ("switch-to-normal-subrs", Fswitch_to_normal_subrs,
4460 Sswitch_to_normal_subrs, 0, 0, 0,
4461 doc: /* Switch all subrs to using the normal versions. */)
4462 (void)
4463{
4464 union Aligned_Lisp_Subr *ptr = subr_ptr;
4465 if (using_BC_subrs)
4466 while (ptr)
4467 {
4468 ptr->s.function = ptr->s.normal_function;
4469 ptr = ptr->s.next;
4470 }
4471 using_BC_subrs = false;
4472 return Qnil;
4473}
4474
4441void 4475void
4442defsubr (union Aligned_Lisp_Subr *aname) 4476defsubr (union Aligned_Lisp_Subr *aname)
4443{ 4477{
@@ -4447,6 +4481,8 @@ defsubr (union Aligned_Lisp_Subr *aname)
4447 XSETPVECTYPE (sname, PVEC_SUBR); 4481 XSETPVECTYPE (sname, PVEC_SUBR);
4448 XSETSUBR (tem, sname); 4482 XSETSUBR (tem, sname);
4449 set_symbol_function (sym, tem); 4483 set_symbol_function (sym, tem);
4484 sname->next = subr_ptr;
4485 subr_ptr = aname;
4450} 4486}
4451 4487
4452#ifdef NOTDEF /* Use fset in subr.el now! */ 4488#ifdef NOTDEF /* Use fset in subr.el now! */
@@ -4702,6 +4738,8 @@ init_lread (void)
4702 if (NILP (Vpurify_flag) && !NILP (Ffboundp (Qfile_truename))) 4738 if (NILP (Vpurify_flag) && !NILP (Ffboundp (Qfile_truename)))
4703 Vsource_directory = call1 (Qfile_truename, Vsource_directory); 4739 Vsource_directory = call1 (Qfile_truename, Vsource_directory);
4704 4740
4741 subr_ptr = NULL;
4742
4705 /* First, set Vload_path. */ 4743 /* First, set Vload_path. */
4706 4744
4707 /* Ignore EMACSLOADPATH when dumping. */ 4745 /* Ignore EMACSLOADPATH when dumping. */
@@ -4816,6 +4854,8 @@ syms_of_lread (void)
4816 defsubr (&Sintern); 4854 defsubr (&Sintern);
4817 defsubr (&Sintern_soft); 4855 defsubr (&Sintern_soft);
4818 defsubr (&Sunintern); 4856 defsubr (&Sunintern);
4857 defsubr (&Sswitch_to_BC_subrs);
4858 defsubr (&Sswitch_to_normal_subrs);
4819 defsubr (&Sget_load_suffixes); 4859 defsubr (&Sget_load_suffixes);
4820 defsubr (&Sload); 4860 defsubr (&Sload);
4821 defsubr (&Seval_buffer); 4861 defsubr (&Seval_buffer);