aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorGerd Moellmann2001-03-28 10:01:51 +0000
committerGerd Moellmann2001-03-28 10:01:51 +0000
commite12ea64e79d561b6c8238c76c988767a0f573a7a (patch)
tree08c07840db9f9ce952de004fa1075c40d7fa42c2 /src/bytecode.c
parent719349f6d0e464d4f71963b87f6bfa08ac630aa7 (diff)
downloademacs-e12ea64e79d561b6c8238c76c988767a0f573a7a.tar.gz
emacs-e12ea64e79d561b6c8238c76c988767a0f573a7a.zip
(BYTE_CODE_QUIT): New macro.
(Fbyte_code): Use BYTE_CODE_QUIT instead of QUIT.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index 363dcdfaa82..b142e3e667e 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1,5 +1,6 @@
1/* Execution of byte code produced by bytecomp.el. 1/* Execution of byte code produced by bytecomp.el.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 2000 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 2000, 2001
3 Free Software Foundation, Inc.
3 4
4This file is part of GNU Emacs. 5This file is part of GNU Emacs.
5 6
@@ -396,6 +397,19 @@ unmark_byte_stack ()
396 397
397#endif /* not BYTE_CODE_SAFE */ 398#endif /* not BYTE_CODE_SAFE */
398 399
400/* A version of the QUIT macro which makes sure that the stack top is
401 set before signaling `quit'. */
402
403#define BYTE_CODE_QUIT \
404 do { \
405 if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
406 { \
407 Vquit_flag = Qnil; \
408 BEFORE_POTENTIAL_GC (); \
409 Fsignal (Qquit, Qnil); \
410 } \
411 } while (0)
412
399 413
400DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0, 414DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0,
401 "Function used internally in byte-compiled code.\n\ 415 "Function used internally in byte-compiled code.\n\
@@ -529,7 +543,7 @@ If the third argument is incorrect, Emacs may crash.")
529 op = FETCH2; 543 op = FETCH2;
530 if (NILP (POP)) 544 if (NILP (POP))
531 { 545 {
532 QUIT; 546 BYTE_CODE_QUIT;
533 CHECK_RANGE (op); 547 CHECK_RANGE (op);
534 stack.pc = stack.byte_string_start + op; 548 stack.pc = stack.byte_string_start + op;
535 } 549 }
@@ -735,7 +749,7 @@ If the third argument is incorrect, Emacs may crash.")
735 749
736 case Bgoto: 750 case Bgoto:
737 MAYBE_GC (); 751 MAYBE_GC ();
738 QUIT; 752 BYTE_CODE_QUIT;
739 op = FETCH2; /* pc = FETCH2 loses since FETCH2 contains pc++ */ 753 op = FETCH2; /* pc = FETCH2 loses since FETCH2 contains pc++ */
740 CHECK_RANGE (op); 754 CHECK_RANGE (op);
741 stack.pc = stack.byte_string_start + op; 755 stack.pc = stack.byte_string_start + op;
@@ -746,7 +760,7 @@ If the third argument is incorrect, Emacs may crash.")
746 op = FETCH2; 760 op = FETCH2;
747 if (!NILP (POP)) 761 if (!NILP (POP))
748 { 762 {
749 QUIT; 763 BYTE_CODE_QUIT;
750 CHECK_RANGE (op); 764 CHECK_RANGE (op);
751 stack.pc = stack.byte_string_start + op; 765 stack.pc = stack.byte_string_start + op;
752 } 766 }
@@ -757,7 +771,7 @@ If the third argument is incorrect, Emacs may crash.")
757 op = FETCH2; 771 op = FETCH2;
758 if (NILP (TOP)) 772 if (NILP (TOP))
759 { 773 {
760 QUIT; 774 BYTE_CODE_QUIT;
761 CHECK_RANGE (op); 775 CHECK_RANGE (op);
762 stack.pc = stack.byte_string_start + op; 776 stack.pc = stack.byte_string_start + op;
763 } 777 }
@@ -769,7 +783,7 @@ If the third argument is incorrect, Emacs may crash.")
769 op = FETCH2; 783 op = FETCH2;
770 if (!NILP (TOP)) 784 if (!NILP (TOP))
771 { 785 {
772 QUIT; 786 BYTE_CODE_QUIT;
773 CHECK_RANGE (op); 787 CHECK_RANGE (op);
774 stack.pc = stack.byte_string_start + op; 788 stack.pc = stack.byte_string_start + op;
775 } 789 }
@@ -778,7 +792,7 @@ If the third argument is incorrect, Emacs may crash.")
778 792
779 case BRgoto: 793 case BRgoto:
780 MAYBE_GC (); 794 MAYBE_GC ();
781 QUIT; 795 BYTE_CODE_QUIT;
782 stack.pc += (int) *stack.pc - 127; 796 stack.pc += (int) *stack.pc - 127;
783 break; 797 break;
784 798
@@ -786,7 +800,7 @@ If the third argument is incorrect, Emacs may crash.")
786 MAYBE_GC (); 800 MAYBE_GC ();
787 if (NILP (POP)) 801 if (NILP (POP))
788 { 802 {
789 QUIT; 803 BYTE_CODE_QUIT;
790 stack.pc += (int) *stack.pc - 128; 804 stack.pc += (int) *stack.pc - 128;
791 } 805 }
792 stack.pc++; 806 stack.pc++;
@@ -796,7 +810,7 @@ If the third argument is incorrect, Emacs may crash.")
796 MAYBE_GC (); 810 MAYBE_GC ();
797 if (!NILP (POP)) 811 if (!NILP (POP))
798 { 812 {
799 QUIT; 813 BYTE_CODE_QUIT;
800 stack.pc += (int) *stack.pc - 128; 814 stack.pc += (int) *stack.pc - 128;
801 } 815 }
802 stack.pc++; 816 stack.pc++;
@@ -807,7 +821,7 @@ If the third argument is incorrect, Emacs may crash.")
807 op = *stack.pc++; 821 op = *stack.pc++;
808 if (NILP (TOP)) 822 if (NILP (TOP))
809 { 823 {
810 QUIT; 824 BYTE_CODE_QUIT;
811 stack.pc += op - 128; 825 stack.pc += op - 128;
812 } 826 }
813 else DISCARD (1); 827 else DISCARD (1);
@@ -818,7 +832,7 @@ If the third argument is incorrect, Emacs may crash.")
818 op = *stack.pc++; 832 op = *stack.pc++;
819 if (!NILP (TOP)) 833 if (!NILP (TOP))
820 { 834 {
821 QUIT; 835 BYTE_CODE_QUIT;
822 stack.pc += op - 128; 836 stack.pc += op - 128;
823 } 837 }
824 else DISCARD (1); 838 else DISCARD (1);