annotate src/bytecode.c @ 34711:583cd327d7b5

(toplevel) [CHECK_FRAME_FONT]: Include frame.h and xterm.h. (Fbyte_code) [CHECK_FRAME_FONT]: Check the selected frame's font.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 19 Dec 2000 12:14:08 +0000
parents 35fae77e31dc
children f17e8743925c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 /* Execution of byte code produced by bytecomp.el.
29436
d0b424336374 Copyright up-date.
Dave Love <fx@gnu.org>
parents: 28999
diff changeset
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 2000 Free Software Foundation, Inc.
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 This file is part of GNU Emacs.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 any later version.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 GNU General Public License for more details.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 14061
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 14061
diff changeset
19 Boston, MA 02111-1307, USA.
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
21 hacked on by jwz@lucid.com 17-jun-91
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 o added a compile-time switch to turn on simple sanity checking;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 o put back the obsolete byte-codes for error-detection;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24 o added a new instruction, unbind_all, which I will use for
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 tail-recursion elimination;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
26 o made temp_output_buffer_show be called with the right number
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 of args;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 o made the new bytecodes be called with args in the right order;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 o added metering support.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 by Hallvard:
435
43e88c4db330 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 396
diff changeset
32 o added relative jump instructions;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 o all conditionals now only do QUIT if they jump.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35
4696
1fc792473491 Include <config.h> instead of "config.h".
Roland McGrath <roland@gnu.org>
parents: 2961
diff changeset
36 #include <config.h>
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 #include "lisp.h"
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 #include "buffer.h"
23715
c69d612b0819 Include charset.h.
Kenichi Handa <handa@m17n.org>
parents: 22013
diff changeset
39 #include "charset.h"
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 #include "syntax.h"
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41
34711
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
42 #ifdef CHECK_FRAME_FONT
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
43 #include "frame.h"
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
44 #include "xterm.h"
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
45 #endif
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
46
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
47 /*
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
48 * define BYTE_CODE_SAFE to enable some minor sanity checking (useful for
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
49 * debugging the byte compiler...)
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
50 *
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
51 * define BYTE_CODE_METER to enable generation of a byte-op usage histogram.
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 */
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
53 /* #define BYTE_CODE_SAFE */
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
54 /* #define BYTE_CODE_METER */
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 #ifdef BYTE_CODE_METER
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
59 Lisp_Object Vbyte_code_meter, Qbyte_code_meter;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 int byte_metering_on;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
62 #define METER_2(code1, code2) \
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 XFASTINT (XVECTOR (XVECTOR (Vbyte_code_meter)->contents[(code1)]) \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 ->contents[(code2)])
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
66 #define METER_1(code) METER_2 (0, (code))
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
68 #define METER_CODE(last_code, this_code) \
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
69 { \
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
70 if (byte_metering_on) \
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
71 { \
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
72 if (METER_1 (this_code) != ((1<<VALBITS)-1)) \
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
73 METER_1 (this_code)++; \
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
74 if (last_code \
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
75 && METER_2 (last_code, this_code) != ((1<<VALBITS)-1))\
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
76 METER_2 (last_code, this_code)++; \
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
77 } \
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
78 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
80 #else /* no BYTE_CODE_METER */
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
82 #define METER_CODE(last_code, this_code)
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
84 #endif /* no BYTE_CODE_METER */
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 Lisp_Object Qbytecode;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 /* Byte codes: */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 #define Bvarref 010
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 #define Bvarset 020
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 #define Bvarbind 030
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 #define Bcall 040
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 #define Bunbind 050
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 #define Bnth 070
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 #define Bsymbolp 071
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 #define Bconsp 072
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 #define Bstringp 073
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 #define Blistp 074
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 #define Beq 075
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 #define Bmemq 076
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 #define Bnot 077
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 #define Bcar 0100
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 #define Bcdr 0101
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 #define Bcons 0102
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 #define Blist1 0103
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 #define Blist2 0104
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110 #define Blist3 0105
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 #define Blist4 0106
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 #define Blength 0107
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 #define Baref 0110
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 #define Baset 0111
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 #define Bsymbol_value 0112
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
116 #define Bsymbol_function 0113
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 #define Bset 0114
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
118 #define Bfset 0115
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 #define Bget 0116
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 #define Bsubstring 0117
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 #define Bconcat2 0120
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 #define Bconcat3 0121
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 #define Bconcat4 0122
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 #define Bsub1 0123
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 #define Badd1 0124
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 #define Beqlsign 0125
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 #define Bgtr 0126
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 #define Blss 0127
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 #define Bleq 0130
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 #define Bgeq 0131
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 #define Bdiff 0132
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 #define Bnegate 0133
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 #define Bplus 0134
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 #define Bmax 0135
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 #define Bmin 0136
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 #define Bmult 0137
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 #define Bpoint 0140
16292
86408ea93da6 (Bsave_current_buffer): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16039
diff changeset
139 /* Was Bmark in v17. */
86408ea93da6 (Bsave_current_buffer): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16039
diff changeset
140 #define Bsave_current_buffer 0141
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 #define Bgoto_char 0142
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 #define Binsert 0143
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 #define Bpoint_max 0144
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 #define Bpoint_min 0145
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 #define Bchar_after 0146
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 #define Bfollowing_char 0147
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 #define Bpreceding_char 0150
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 #define Bcurrent_column 0151
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149 #define Bindent_to 0152
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 #define Bscan_buffer 0153 /* No longer generated as of v18 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 #define Beolp 0154
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 #define Beobp 0155
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153 #define Bbolp 0156
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 #define Bbobp 0157
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 #define Bcurrent_buffer 0160
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 #define Bset_buffer 0161
18245
045ae402e927 (Bread_char): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 16815
diff changeset
157 #define Bsave_current_buffer_1 0162 /* Replacing Bsave_current_buffer. */
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
158 #define Bread_char 0162 /* No longer generated as of v19 */
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159 #define Bset_mark 0163 /* this loser is no longer generated as of v18 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 #define Binteractive_p 0164 /* Needed since interactive-p takes unevalled args */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 #define Bforward_char 0165
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 #define Bforward_word 0166
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 #define Bskip_chars_forward 0167
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 #define Bskip_chars_backward 0170
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166 #define Bforward_line 0171
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 #define Bchar_syntax 0172
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 #define Bbuffer_substring 0173
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169 #define Bdelete_region 0174
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 #define Bnarrow_to_region 0175
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171 #define Bwiden 0176
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
172 #define Bend_of_line 0177
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174 #define Bconstant2 0201
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 #define Bgoto 0202
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 #define Bgotoifnil 0203
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177 #define Bgotoifnonnil 0204
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178 #define Bgotoifnilelsepop 0205
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
179 #define Bgotoifnonnilelsepop 0206
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 #define Breturn 0207
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181 #define Bdiscard 0210
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
182 #define Bdup 0211
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
183
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184 #define Bsave_excursion 0212
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
185 #define Bsave_window_excursion 0213
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
186 #define Bsave_restriction 0214
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
187 #define Bcatch 0215
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 #define Bunwind_protect 0216
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190 #define Bcondition_case 0217
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191 #define Btemp_output_buffer_setup 0220
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 #define Btemp_output_buffer_show 0221
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 #define Bunbind_all 0222
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
196 #define Bset_marker 0223
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
197 #define Bmatch_beginning 0224
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
198 #define Bmatch_end 0225
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
199 #define Bupcase 0226
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
200 #define Bdowncase 0227
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
201
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 #define Bstringeqlsign 0230
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 #define Bstringlss 0231
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 #define Bequal 0232
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205 #define Bnthcdr 0233
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
206 #define Belt 0234
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
207 #define Bmember 0235
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 #define Bassq 0236
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 #define Bnreverse 0237
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
210 #define Bsetcar 0240
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211 #define Bsetcdr 0241
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 #define Bcar_safe 0242
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 #define Bcdr_safe 0243
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214 #define Bnconc 0244
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215 #define Bquo 0245
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
216 #define Brem 0246
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
217 #define Bnumberp 0247
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
218 #define Bintegerp 0250
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
220 #define BRgoto 0252
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
221 #define BRgotoifnil 0253
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
222 #define BRgotoifnonnil 0254
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
223 #define BRgotoifnilelsepop 0255
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
224 #define BRgotoifnonnilelsepop 0256
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
225
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
226 #define BlistN 0257
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
227 #define BconcatN 0260
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
228 #define BinsertN 0261
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
229
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230 #define Bconstant 0300
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231 #define CONSTANTLIM 0100
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
232
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
233
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
234 /* Structure describing a value stack used during byte-code execution
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
235 in Fbyte_code. */
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
236
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
237 struct byte_stack
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
238 {
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
239 /* Program counter. This points into the byte_string below
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
240 and is relocated when that string is relocated. */
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
241 unsigned char *pc;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
242
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
243 /* Top and bottom of stack. The bottom points to an area of memory
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
244 allocated with alloca in Fbyte_code. */
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
245 Lisp_Object *top, *bottom;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
246
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
247 /* The string containing the byte-code, and its current address.
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
248 Storing this here protects it from GC because mark_byte_stack
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
249 marks it. */
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
250 Lisp_Object byte_string;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
251 unsigned char *byte_string_start;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
252
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
253 /* The vector of constants used during byte-code execution. Storing
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
254 this here protects it from GC because mark_byte_stack marks it. */
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
255 Lisp_Object constants;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
256
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
257 /* Next entry in byte_stack_list. */
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
258 struct byte_stack *next;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
259 };
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
260
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
261 /* A list of currently active byte-code execution value stacks.
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
262 Fbyte_code adds an entry to the head of this list before it starts
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
263 processing byte-code, and it removed the entry again when it is
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
264 done. Signalling an error truncates the list analoguous to
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
265 gcprolist. */
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
266
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
267 struct byte_stack *byte_stack_list;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
268
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
269
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
270 /* Mark objects on byte_stack_list. Called during GC. */
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
271
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
272 void
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
273 mark_byte_stack ()
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
274 {
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
275 struct byte_stack *stack;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
276 Lisp_Object *obj;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
277
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
278 for (stack = byte_stack_list; stack; stack = stack->next)
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
279 {
31152
fb30bcf39f12 (mark_byte_stack): Add a comment.
Gerd Moellmann <gerd@gnu.org>
parents: 29436
diff changeset
280 /* If STACK->top is null here, this means there's an opcode in
fb30bcf39f12 (mark_byte_stack): Add a comment.
Gerd Moellmann <gerd@gnu.org>
parents: 29436
diff changeset
281 Fbyte_code that wasn't expected to GC, but did. To find out
fb30bcf39f12 (mark_byte_stack): Add a comment.
Gerd Moellmann <gerd@gnu.org>
parents: 29436
diff changeset
282 which opcode this is, record the value of `stack', and walk
fb30bcf39f12 (mark_byte_stack): Add a comment.
Gerd Moellmann <gerd@gnu.org>
parents: 29436
diff changeset
283 up the stack in a debugger, stopping in frames of Fbyte_code.
fb30bcf39f12 (mark_byte_stack): Add a comment.
Gerd Moellmann <gerd@gnu.org>
parents: 29436
diff changeset
284 The culprit is found in the frame of Fbyte_code where the
fb30bcf39f12 (mark_byte_stack): Add a comment.
Gerd Moellmann <gerd@gnu.org>
parents: 29436
diff changeset
285 address of its local variable `stack' is equal to the
fb30bcf39f12 (mark_byte_stack): Add a comment.
Gerd Moellmann <gerd@gnu.org>
parents: 29436
diff changeset
286 recorded value of `stack' here. */
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
287 if (!stack->top)
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
288 abort ();
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
289
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
290 for (obj = stack->bottom; obj <= stack->top; ++obj)
26376
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
291 if (!XMARKBIT (*obj))
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
292 {
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
293 mark_object (obj);
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
294 XMARK (*obj);
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
295 }
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
296
26376
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
297 if (!XMARKBIT (stack->byte_string))
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
298 {
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
299 mark_object (&stack->byte_string);
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
300 XMARK (stack->byte_string);
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
301 }
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
302
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
303 if (!XMARKBIT (stack->constants))
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
304 {
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
305 mark_object (&stack->constants);
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
306 XMARK (stack->constants);
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
307 }
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
308 }
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
309 }
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
310
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
311
26376
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
312 /* Unmark objects in the stacks on byte_stack_list. Relocate program
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
313 counters. Called when GC has completed. */
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
314
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
315 void
26376
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
316 unmark_byte_stack ()
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
317 {
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
318 struct byte_stack *stack;
26376
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
319 Lisp_Object *obj;
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
320
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
321 for (stack = byte_stack_list; stack; stack = stack->next)
26376
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
322 {
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
323 for (obj = stack->bottom; obj <= stack->top; ++obj)
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
324 XUNMARK (*obj);
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
325
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
326 XUNMARK (stack->byte_string);
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
327 XUNMARK (stack->constants);
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
328
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
329 if (stack->byte_string_start != XSTRING (stack->byte_string)->data)
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
330 {
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
331 int offset = stack->pc - stack->byte_string_start;
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
332 stack->byte_string_start = XSTRING (stack->byte_string)->data;
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
333 stack->pc = stack->byte_string_start + offset;
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
334 }
6706cd0ece4d (mark_byte_stack): Use XMARKBIT and XMARK.
Gerd Moellmann <gerd@gnu.org>
parents: 26370
diff changeset
335 }
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
336 }
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
337
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
338
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
339 /* Fetch the next byte from the bytecode stream */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
341 #define FETCH *stack.pc++
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
342
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
343 /* Fetch two bytes from the bytecode stream and make a 16-bit number
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
344 out of them */
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
345
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
346 #define FETCH2 (op = FETCH, op + (FETCH << 8))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
347
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
348 /* Push x onto the execution stack. This used to be #define PUSH(x)
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
349 (*++stackp = (x)) This oddity is necessary because Alliant can't be
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
350 bothered to compile the preincrement operator properly, as of 4/91.
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
351 -JimB */
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
352
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
353 #define PUSH(x) (top++, *top = (x))
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
355 /* Pop a value off the execution stack. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
356
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
357 #define POP (*top--)
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359 /* Discard n values from the execution stack. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
360
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
361 #define DISCARD(n) (top -= (n))
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
362
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
363 /* Get the value which is at the top of the execution stack, but don't
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
364 pop it. */
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
365
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
366 #define TOP (*top)
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
367
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
368 /* Actions that must be performed before and after calling a function
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
369 that might GC. */
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
370
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
371 #define BEFORE_POTENTIAL_GC() stack.top = top
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
372 #define AFTER_POTENTIAL_GC() stack.top = NULL
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
373
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
374 /* Garbage collect if we have consed enough since the last time.
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
375 We do this at every branch, to avoid loops that never GC. */
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
376
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
377 #define MAYBE_GC() \
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
378 if (consing_since_gc > gc_cons_threshold) \
16815
9e0f59154164 (HANDLE_RELOCATION): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16784
diff changeset
379 { \
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
380 BEFORE_POTENTIAL_GC (); \
16815
9e0f59154164 (HANDLE_RELOCATION): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16784
diff changeset
381 Fgarbage_collect (); \
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
382 AFTER_POTENTIAL_GC (); \
16815
9e0f59154164 (HANDLE_RELOCATION): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16784
diff changeset
383 } \
9e0f59154164 (HANDLE_RELOCATION): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16784
diff changeset
384 else
9e0f59154164 (HANDLE_RELOCATION): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16784
diff changeset
385
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
386 /* Check for jumping out of range. */
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
387
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
388 #ifdef BYTE_CODE_SAFE
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
389
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
390 #define CHECK_RANGE(ARG) \
16784
79ea730b7e20 (Fbyte_code): Add error check for jumping out of range.
Richard M. Stallman <rms@gnu.org>
parents: 16628
diff changeset
391 if (ARG >= bytestr_length) abort ()
79ea730b7e20 (Fbyte_code): Add error check for jumping out of range.
Richard M. Stallman <rms@gnu.org>
parents: 16628
diff changeset
392
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
393 #else /* not BYTE_CODE_SAFE */
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
394
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
395 #define CHECK_RANGE(ARG)
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
396
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
397 #endif /* not BYTE_CODE_SAFE */
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
398
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
399
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
400 DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0,
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
401 "Function used internally in byte-compiled code.\n\
14061
bf43ef5a139c (Fbyte_code): Harmonize arguments with documentation.
Erik Naggum <erik@naggum.no>
parents: 12575
diff changeset
402 The first argument, BYTESTR, is a string of byte code;\n\
bf43ef5a139c (Fbyte_code): Harmonize arguments with documentation.
Erik Naggum <erik@naggum.no>
parents: 12575
diff changeset
403 the second, VECTOR, a vector of constants;\n\
bf43ef5a139c (Fbyte_code): Harmonize arguments with documentation.
Erik Naggum <erik@naggum.no>
parents: 12575
diff changeset
404 the third, MAXDEPTH, the maximum stack depth used in this function.\n\
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
405 If the third argument is incorrect, Emacs may crash.")
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
406 (bytestr, vector, maxdepth)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
407 Lisp_Object bytestr, vector, maxdepth;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
408 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
409 int count = specpdl_ptr - specpdl;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
410 #ifdef BYTE_CODE_METER
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
411 int this_op = 0;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
412 int prev_op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
413 #endif
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
414 int op;
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
415 /* Lisp_Object v1, v2; */
28999
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
416 Lisp_Object *vectorp;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
417 #ifdef BYTE_CODE_SAFE
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
418 int const_length = XVECTOR (vector)->size;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
419 Lisp_Object *stacke;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
420 #endif
28999
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
421 int bytestr_length;
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
422 struct byte_stack stack;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
423 Lisp_Object *top;
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
424 Lisp_Object result;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
425
34711
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
426 #ifdef CHECK_FRAME_FONT
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
427 {
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
428 struct frame *f = SELECTED_FRAME ();
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
429 if (FRAME_X_P (f)
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
430 && FRAME_FONT (f)->direction != 0
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
431 && FRAME_FONT (f)->direction != 1)
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
432 abort ();
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
433 }
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
434 #endif
583cd327d7b5 (toplevel) [CHECK_FRAME_FONT]: Include frame.h and
Gerd Moellmann <gerd@gnu.org>
parents: 33688
diff changeset
435
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
436 CHECK_STRING (bytestr, 0);
9139
127823d9444d (Fbyte_code): Use type test macros.
Karl Heuer <kwzh@gnu.org>
parents: 4696
diff changeset
437 if (!VECTORP (vector))
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
438 vector = wrong_type_argument (Qvectorp, vector);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
439 CHECK_NUMBER (maxdepth, 2);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
440
28999
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
441 if (STRING_MULTIBYTE (bytestr))
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
442 /* BYTESTR must have been produced by Emacs 20.2 or the earlier
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
443 because they produced a raw 8-bit string for byte-code and now
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
444 such a byte-code string is loaded as multibyte while raw 8-bit
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
445 characters converted to multibyte form. Thus, now we must
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
446 convert them back to the original unibyte form. */
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
447 bytestr = Fstring_as_unibyte (bytestr);
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
448
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
449 bytestr_length = STRING_BYTES (XSTRING (bytestr));
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
450 vectorp = XVECTOR (vector)->contents;
4c808e415352 (Fbyte_code): If arg BYTESTR is multibyte, convert it
Kenichi Handa <handa@m17n.org>
parents: 28497
diff changeset
451
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
452 stack.byte_string = bytestr;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
453 stack.pc = stack.byte_string_start = XSTRING (bytestr)->data;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
454 stack.constants = vector;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
455 stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth)
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
456 * sizeof (Lisp_Object));
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
457 top = stack.bottom - 1;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
458 stack.top = NULL;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
459 stack.next = byte_stack_list;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
460 byte_stack_list = &stack;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
461
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
462 #ifdef BYTE_CODE_SAFE
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
463 stacke = stack.bottom - 1 + XFASTINT (maxdepth);
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
464 #endif
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
465
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
466 while (1)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
467 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
468 #ifdef BYTE_CODE_SAFE
27438
5218aa03936e (Fbyte_code) [BYTE_CODE_SAFE]: Fix typo.
Gerd Moellmann <gerd@gnu.org>
parents: 27293
diff changeset
469 if (top > stacke)
27727
9400865ec7cf Remove `LISP_FLOAT_TYPE' and `standalone'.
Gerd Moellmann <gerd@gnu.org>
parents: 27442
diff changeset
470 abort ();
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
471 else if (top < stack.bottom - 1)
27727
9400865ec7cf Remove `LISP_FLOAT_TYPE' and `standalone'.
Gerd Moellmann <gerd@gnu.org>
parents: 27442
diff changeset
472 abort ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
473 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
474
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
475 #ifdef BYTE_CODE_METER
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
476 prev_op = this_op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
477 this_op = op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
478 METER_CODE (prev_op, op);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
479 #else
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
480 op = FETCH;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
481 #endif
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
482
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
483 switch (op)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
484 {
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
485 case Bvarref + 7:
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
486 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
487 goto varref;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
488
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
489 case Bvarref:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
490 case Bvarref + 1:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
491 case Bvarref + 2:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
492 case Bvarref + 3:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
493 case Bvarref + 4:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
494 case Bvarref + 5:
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
495 op = op - Bvarref;
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
496 goto varref;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
497
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
498 /* This seems to be the most frequently executed byte-code
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
499 among the Bvarref's, so avoid a goto here. */
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
500 case Bvarref+6:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
501 op = FETCH;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
502 varref:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
503 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
504 Lisp_Object v1, v2;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
505
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
506 v1 = vectorp[op];
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
507 if (SYMBOLP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
508 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
509 v2 = XSYMBOL (v1)->value;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
510 if (MISCP (v2) || EQ (v2, Qunbound))
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
511 {
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
512 BEFORE_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
513 v2 = Fsymbol_value (v1);
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
514 AFTER_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
515 }
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
516 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
517 else
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
518 {
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
519 BEFORE_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
520 v2 = Fsymbol_value (v1);
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
521 AFTER_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
522 }
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
523 PUSH (v2);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
524 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
525 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
526
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
527 case Bgotoifnil:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
528 MAYBE_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
529 op = FETCH2;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
530 if (NILP (POP))
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
531 {
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
532 QUIT;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
533 CHECK_RANGE (op);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
534 stack.pc = stack.byte_string_start + op;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
535 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
536 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
537
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
538 case Bcar:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
539 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
540 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
541 v1 = TOP;
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
542 if (CONSP (v1))
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
543 TOP = XCAR (v1);
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
544 else if (NILP (v1))
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
545 TOP = Qnil;
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
546 else
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
547 {
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
548 BEFORE_POTENTIAL_GC ();
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
549 Fcar (wrong_type_argument (Qlistp, v1));
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
550 AFTER_POTENTIAL_GC ();
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
551 }
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
552 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
553 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
554
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
555 case Beq:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
556 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
557 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
558 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
559 TOP = EQ (v1, TOP) ? Qt : Qnil;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
560 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
561 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
562
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
563 case Bmemq:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
564 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
565 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
566 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
567 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
568 TOP = Fmemq (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
569 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
570 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
571 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
572
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
573 case Bcdr:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
574 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
575 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
576 v1 = TOP;
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
577 if (CONSP (v1))
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
578 TOP = XCDR (v1);
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
579 else if (NILP (v1))
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
580 TOP = Qnil;
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
581 else
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
582 {
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
583 BEFORE_POTENTIAL_GC ();
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
584 Fcdr (wrong_type_argument (Qlistp, v1));
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
585 AFTER_POTENTIAL_GC ();
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
586 }
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
587 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
588 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
589
27782
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
590 case Bvarset:
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
591 case Bvarset+1:
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
592 case Bvarset+2:
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
593 case Bvarset+3:
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
594 case Bvarset+4:
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
595 case Bvarset+5:
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
596 op -= Bvarset;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
597 goto varset;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
598
27782
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
599 case Bvarset+7:
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
600 op = FETCH2;
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
601 goto varset;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
602
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
603 case Bvarset+6:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
604 op = FETCH;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
605 varset:
27782
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
606 {
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
607 Lisp_Object sym, val;
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
608
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
609 sym = vectorp[op];
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
610 val = TOP;
27782
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
611
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
612 /* Inline the most common case. */
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
613 if (SYMBOLP (sym)
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
614 && !EQ (val, Qunbound)
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
615 && !MISCP (XSYMBOL (sym)->value)
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
616 /* I think this should either be checked in the byte
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
617 compiler, or there should be a flag indicating that
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
618 a symbol might be constant in Lisp_Symbol, instead
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
619 of checking this here over and over again. --gerd. */
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
620 && !EQ (sym, Qnil)
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
621 && !EQ (sym, Qt)
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
622 && !(XSYMBOL (sym)->name->data[0] == ':'
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
623 && EQ (XSYMBOL (sym)->obarray, initial_obarray)
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
624 && !EQ (val, sym)))
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
625 XSYMBOL (sym)->value = val;
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
626 else
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
627 {
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
628 BEFORE_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
629 set_internal (sym, val, current_buffer, 0);
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
630 AFTER_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
631 }
27782
f53ecb062478 (Fbyte_code) <Bvarset>: Inline most common case.
Gerd Moellmann <gerd@gnu.org>
parents: 27727
diff changeset
632 }
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
633 POP;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
634 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
635
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
636 case Bdup:
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
637 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
638 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
639 v1 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
640 PUSH (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
641 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
642 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
643
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
644 /* ------------------ */
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
645
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
646 case Bvarbind+6:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
647 op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
648 goto varbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
649
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
650 case Bvarbind+7:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
651 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
652 goto varbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
653
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
654 case Bvarbind:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
655 case Bvarbind+1:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
656 case Bvarbind+2:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
657 case Bvarbind+3:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
658 case Bvarbind+4:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
659 case Bvarbind+5:
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
660 op -= Bvarbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
661 varbind:
33688
35fae77e31dc (Fbyte_code) <Bvarbind, Bunwind_protect>: Add
Gerd Moellmann <gerd@gnu.org>
parents: 31152
diff changeset
662 /* Specbind can signal and thus GC. */
35fae77e31dc (Fbyte_code) <Bvarbind, Bunwind_protect>: Add
Gerd Moellmann <gerd@gnu.org>
parents: 31152
diff changeset
663 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
664 specbind (vectorp[op], POP);
33688
35fae77e31dc (Fbyte_code) <Bvarbind, Bunwind_protect>: Add
Gerd Moellmann <gerd@gnu.org>
parents: 31152
diff changeset
665 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
666 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
667
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
668 case Bcall+6:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
669 op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
670 goto docall;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
671
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
672 case Bcall+7:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
673 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
674 goto docall;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
675
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
676 case Bcall:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
677 case Bcall+1:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
678 case Bcall+2:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
679 case Bcall+3:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
680 case Bcall+4:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
681 case Bcall+5:
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
682 op -= Bcall;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
683 docall:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
684 {
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
685 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
686 DISCARD (op);
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
687 #ifdef BYTE_CODE_METER
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
688 if (byte_metering_on && SYMBOLP (TOP))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
689 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
690 Lisp_Object v1, v2;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
691
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
692 v1 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
693 v2 = Fget (v1, Qbyte_code_meter);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
694 if (INTEGERP (v2)
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
695 && XINT (v2) != ((1<<VALBITS)-1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
696 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
697 XSETINT (v2, XINT (v2) + 1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
698 Fput (v1, Qbyte_code_meter, v2);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
699 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
700 }
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
701 #endif
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
702 TOP = Ffuncall (op + 1, &TOP);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
703 AFTER_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
704 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
705 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
706
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
707 case Bunbind+6:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
708 op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
709 goto dounbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
710
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
711 case Bunbind+7:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
712 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
713 goto dounbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
714
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
715 case Bunbind:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
716 case Bunbind+1:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
717 case Bunbind+2:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
718 case Bunbind+3:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
719 case Bunbind+4:
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
720 case Bunbind+5:
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
721 op -= Bunbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
722 dounbind:
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
723 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
724 unbind_to (specpdl_ptr - specpdl - op, Qnil);
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
725 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
726 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
727
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
728 case Bunbind_all:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
729 /* To unbind back to the beginning of this frame. Not used yet,
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
730 but will be needed for tail-recursion elimination. */
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
731 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
732 unbind_to (count, Qnil);
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
733 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
734 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
735
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
736 case Bgoto:
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
737 MAYBE_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
738 QUIT;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
739 op = FETCH2; /* pc = FETCH2 loses since FETCH2 contains pc++ */
16784
79ea730b7e20 (Fbyte_code): Add error check for jumping out of range.
Richard M. Stallman <rms@gnu.org>
parents: 16628
diff changeset
740 CHECK_RANGE (op);
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
741 stack.pc = stack.byte_string_start + op;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
742 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
743
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
744 case Bgotoifnonnil:
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
745 MAYBE_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
746 op = FETCH2;
944
6bebb86e63c2 Replaced NULL with N
Joseph Arceneaux <jla@gnu.org>
parents: 934
diff changeset
747 if (!NILP (POP))
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
748 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
749 QUIT;
16784
79ea730b7e20 (Fbyte_code): Add error check for jumping out of range.
Richard M. Stallman <rms@gnu.org>
parents: 16628
diff changeset
750 CHECK_RANGE (op);
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
751 stack.pc = stack.byte_string_start + op;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
752 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
753 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
754
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
755 case Bgotoifnilelsepop:
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
756 MAYBE_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
757 op = FETCH2;
944
6bebb86e63c2 Replaced NULL with N
Joseph Arceneaux <jla@gnu.org>
parents: 934
diff changeset
758 if (NILP (TOP))
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
759 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
760 QUIT;
16784
79ea730b7e20 (Fbyte_code): Add error check for jumping out of range.
Richard M. Stallman <rms@gnu.org>
parents: 16628
diff changeset
761 CHECK_RANGE (op);
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
762 stack.pc = stack.byte_string_start + op;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
763 }
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
764 else DISCARD (1);
396
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 310
diff changeset
765 break;
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 310
diff changeset
766
934
1e2e41fd188b entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 621
diff changeset
767 case Bgotoifnonnilelsepop:
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
768 MAYBE_GC ();
934
1e2e41fd188b entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 621
diff changeset
769 op = FETCH2;
944
6bebb86e63c2 Replaced NULL with N
Joseph Arceneaux <jla@gnu.org>
parents: 934
diff changeset
770 if (!NILP (TOP))
396
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 310
diff changeset
771 {
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 310
diff changeset
772 QUIT;
16784
79ea730b7e20 (Fbyte_code): Add error check for jumping out of range.
Richard M. Stallman <rms@gnu.org>
parents: 16628
diff changeset
773 CHECK_RANGE (op);
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
774 stack.pc = stack.byte_string_start + op;
396
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 310
diff changeset
775 }
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
776 else DISCARD (1);
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
777 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
778
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
779 case BRgoto:
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
780 MAYBE_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
781 QUIT;
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
782 stack.pc += (int) *stack.pc - 127;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
783 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
784
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
785 case BRgotoifnil:
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
786 MAYBE_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
787 if (NILP (POP))
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
788 {
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
789 QUIT;
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
790 stack.pc += (int) *stack.pc - 128;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
791 }
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
792 stack.pc++;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
793 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
794
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
795 case BRgotoifnonnil:
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
796 MAYBE_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
797 if (!NILP (POP))
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
798 {
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
799 QUIT;
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
800 stack.pc += (int) *stack.pc - 128;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
801 }
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
802 stack.pc++;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
803 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
804
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
805 case BRgotoifnilelsepop:
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
806 MAYBE_GC ();
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
807 op = *stack.pc++;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
808 if (NILP (TOP))
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
809 {
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
810 QUIT;
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
811 stack.pc += op - 128;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
812 }
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
813 else DISCARD (1);
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
814 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
815
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
816 case BRgotoifnonnilelsepop:
16628
25e8123eb6c5 (MAYBE_GC): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16292
diff changeset
817 MAYBE_GC ();
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
818 op = *stack.pc++;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
819 if (!NILP (TOP))
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
820 {
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
821 QUIT;
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
822 stack.pc += op - 128;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
823 }
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
824 else DISCARD (1);
396
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 310
diff changeset
825 break;
d0eb77a4d8f7 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 310
diff changeset
826
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
827 case Breturn:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
828 result = POP;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
829 goto exit;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
830
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
831 case Bdiscard:
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
832 DISCARD (1);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
833 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
834
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
835 case Bconstant2:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
836 PUSH (vectorp[FETCH2]);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
837 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
838
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
839 case Bsave_excursion:
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
840 record_unwind_protect (save_excursion_restore,
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
841 save_excursion_save ());
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
842 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
843
16292
86408ea93da6 (Bsave_current_buffer): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16039
diff changeset
844 case Bsave_current_buffer:
18245
045ae402e927 (Bread_char): Deleted.
Richard M. Stallman <rms@gnu.org>
parents: 16815
diff changeset
845 case Bsave_current_buffer_1:
20697
6c8ba5a6147b (Fbyte_code) <Bsave_current_buffer_1>: Use set_buffer_if_live.
Richard M. Stallman <rms@gnu.org>
parents: 20592
diff changeset
846 record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ());
16292
86408ea93da6 (Bsave_current_buffer): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16039
diff changeset
847 break;
86408ea93da6 (Bsave_current_buffer): New macro.
Richard M. Stallman <rms@gnu.org>
parents: 16039
diff changeset
848
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
849 case Bsave_window_excursion:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
850 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
851 TOP = Fsave_window_excursion (TOP);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
852 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
853 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
854
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
855 case Bsave_restriction:
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
856 record_unwind_protect (save_restriction_restore,
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
857 save_restriction_save ());
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
858 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
859
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
860 case Bcatch:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
861 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
862 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
863 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
864 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
865 TOP = internal_catch (TOP, Feval, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
866 AFTER_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
867 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
868 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
869
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
870 case Bunwind_protect:
33688
35fae77e31dc (Fbyte_code) <Bvarbind, Bunwind_protect>: Add
Gerd Moellmann <gerd@gnu.org>
parents: 31152
diff changeset
871 /* The function record_unwind_protect can GC. */
35fae77e31dc (Fbyte_code) <Bvarbind, Bunwind_protect>: Add
Gerd Moellmann <gerd@gnu.org>
parents: 31152
diff changeset
872 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
873 record_unwind_protect (0, POP);
33688
35fae77e31dc (Fbyte_code) <Bvarbind, Bunwind_protect>: Add
Gerd Moellmann <gerd@gnu.org>
parents: 31152
diff changeset
874 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
875 (specpdl_ptr - 1)->symbol = Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
876 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
877
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
878 case Bcondition_case:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
879 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
880 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
881 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
882 v1 = Fcons (POP, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
883 BEFORE_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
884 TOP = Fcondition_case (Fcons (TOP, v1));
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
885 AFTER_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
886 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
887 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
888
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
889 case Btemp_output_buffer_setup:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
890 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
891 temp_output_buffer_setup (XSTRING (TOP)->data);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
892 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
893 TOP = Vstandard_output;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
894 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
895
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
896 case Btemp_output_buffer_show:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
897 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
898 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
899 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
900 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
901 temp_output_buffer_show (TOP);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
902 TOP = v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
903 /* pop binding of standard-output */
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
904 unbind_to (specpdl_ptr - specpdl - 1, Qnil);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
905 AFTER_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
906 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
907 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
908
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
909 case Bnth:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
910 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
911 Lisp_Object v1, v2;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
912 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
913 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
914 v2 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
915 CHECK_NUMBER (v2, 0);
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
916 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
917 op = XINT (v2);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
918 immediate_quit = 1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
919 while (--op >= 0)
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
920 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
921 if (CONSP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
922 v1 = XCDR (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
923 else if (!NILP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
924 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
925 immediate_quit = 0;
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
926 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
927 v1 = wrong_type_argument (Qlistp, v1);
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
928 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
929 immediate_quit = 1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
930 op++;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
931 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
932 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
933 immediate_quit = 0;
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
934 if (CONSP (v1))
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
935 TOP = XCAR (v1);
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
936 else if (NILP (v1))
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
937 TOP = Qnil;
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
938 else
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
939 {
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
940 BEFORE_POTENTIAL_GC ();
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
941 Fcar (wrong_type_argument (Qlistp, v1));
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
942 AFTER_POTENTIAL_GC ();
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
943 }
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
944 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
945 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
946
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
947 case Bsymbolp:
9139
127823d9444d (Fbyte_code): Use type test macros.
Karl Heuer <kwzh@gnu.org>
parents: 4696
diff changeset
948 TOP = SYMBOLP (TOP) ? Qt : Qnil;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
949 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
950
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
951 case Bconsp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
952 TOP = CONSP (TOP) ? Qt : Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
953 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
954
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
955 case Bstringp:
9139
127823d9444d (Fbyte_code): Use type test macros.
Karl Heuer <kwzh@gnu.org>
parents: 4696
diff changeset
956 TOP = STRINGP (TOP) ? Qt : Qnil;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
957 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
958
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
959 case Blistp:
944
6bebb86e63c2 Replaced NULL with N
Joseph Arceneaux <jla@gnu.org>
parents: 934
diff changeset
960 TOP = CONSP (TOP) || NILP (TOP) ? Qt : Qnil;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
961 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
962
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
963 case Bnot:
944
6bebb86e63c2 Replaced NULL with N
Joseph Arceneaux <jla@gnu.org>
parents: 934
diff changeset
964 TOP = NILP (TOP) ? Qt : Qnil;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
965 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
966
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
967 case Bcons:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
968 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
969 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
970 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
971 TOP = Fcons (TOP, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
972 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
973 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
974
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
975 case Blist1:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
976 TOP = Fcons (TOP, Qnil);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
977 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
978
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
979 case Blist2:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
980 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
981 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
982 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
983 TOP = Fcons (TOP, Fcons (v1, Qnil));
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
984 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
985 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
986
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
987 case Blist3:
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
988 DISCARD (2);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
989 TOP = Flist (3, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
990 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
991
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
992 case Blist4:
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
993 DISCARD (3);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
994 TOP = Flist (4, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
995 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
996
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
997 case BlistN:
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
998 op = FETCH;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
999 DISCARD (op - 1);
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1000 TOP = Flist (op, &TOP);
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1001 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1002
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1003 case Blength:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1004 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1005 TOP = Flength (TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1006 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1007 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1008
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1009 case Baref:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1010 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1011 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1012 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1013 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1014 TOP = Faref (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1015 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1016 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1017 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1018
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1019 case Baset:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1020 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1021 Lisp_Object v1, v2;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1022 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1023 v2 = POP; v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1024 TOP = Faset (TOP, v1, v2);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1025 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1026 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1027 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1028
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1029 case Bsymbol_value:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1030 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1031 TOP = Fsymbol_value (TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1032 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1033 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1034
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1035 case Bsymbol_function:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1036 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1037 TOP = Fsymbol_function (TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1038 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1039 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1040
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1041 case Bset:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1042 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1043 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1044 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1045 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1046 TOP = Fset (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1047 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1048 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1049 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1050
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1051 case Bfset:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1052 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1053 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1054 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1055 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1056 TOP = Ffset (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1057 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1058 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1059 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1060
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1061 case Bget:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1062 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1063 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1064 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1065 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1066 TOP = Fget (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1067 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1068 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1069 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1070
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1071 case Bsubstring:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1072 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1073 Lisp_Object v1, v2;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1074 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1075 v2 = POP; v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1076 TOP = Fsubstring (TOP, v1, v2);
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
1077 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1078 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1079 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1080
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1081 case Bconcat2:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1082 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1083 DISCARD (1);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1084 TOP = Fconcat (2, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1085 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1086 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1087
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1088 case Bconcat3:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1089 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1090 DISCARD (2);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1091 TOP = Fconcat (3, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1092 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1093 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1094
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1095 case Bconcat4:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1096 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1097 DISCARD (3);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1098 TOP = Fconcat (4, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1099 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1100 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1101
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1102 case BconcatN:
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1103 op = FETCH;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1104 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1105 DISCARD (op - 1);
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1106 TOP = Fconcat (op, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1107 AFTER_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1108 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1109
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1110 case Bsub1:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1111 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1112 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1113 v1 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1114 if (INTEGERP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1115 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1116 XSETINT (v1, XINT (v1) - 1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1117 TOP = v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1118 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1119 else
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1120 TOP = Fsub1 (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1121 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1122 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1123
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1124 case Badd1:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1125 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1126 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1127 v1 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1128 if (INTEGERP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1129 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1130 XSETINT (v1, XINT (v1) + 1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1131 TOP = v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1132 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1133 else
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1134 {
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1135 BEFORE_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1136 TOP = Fadd1 (v1);
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1137 AFTER_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1138 }
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1139 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1140 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1141
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1142 case Beqlsign:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1143 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1144 Lisp_Object v1, v2;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1145 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1146 v2 = POP; v1 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1147 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v1, 0);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1148 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v2, 0);
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1149 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1150 if (FLOATP (v1) || FLOATP (v2))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1151 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1152 double f1, f2;
12527
ebaf016075f1 (Fbyte_code): For Beqlsign, if both args are ints,
Karl Heuer <kwzh@gnu.org>
parents: 10134
diff changeset
1153
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1154 f1 = (FLOATP (v1) ? XFLOAT_DATA (v1) : XINT (v1));
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1155 f2 = (FLOATP (v2) ? XFLOAT_DATA (v2) : XINT (v2));
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1156 TOP = (f1 == f2 ? Qt : Qnil);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1157 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1158 else
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1159 TOP = (XINT (v1) == XINT (v2) ? Qt : Qnil);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1160 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1161 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1162
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1163 case Bgtr:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1164 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1165 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1166 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1167 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1168 TOP = Fgtr (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1169 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1170 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1171 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1172
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1173 case Blss:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1174 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1175 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1176 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1177 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1178 TOP = Flss (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1179 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1180 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1181 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1182
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1183 case Bleq:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1184 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1185 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1186 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1187 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1188 TOP = Fleq (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1189 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1190 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1191 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1192
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1193 case Bgeq:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1194 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1195 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1196 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1197 TOP = Fgeq (TOP, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1198 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1199 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1200
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1201 case Bdiff:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1202 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1203 DISCARD (1);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1204 TOP = Fminus (2, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1205 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1206 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1207
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1208 case Bnegate:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1209 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1210 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1211 v1 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1212 if (INTEGERP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1213 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1214 XSETINT (v1, - XINT (v1));
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1215 TOP = v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1216 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1217 else
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1218 {
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1219 BEFORE_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1220 TOP = Fminus (1, &TOP);
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1221 AFTER_POTENTIAL_GC ();
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1222 }
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1223 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1224 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1225
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1226 case Bplus:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1227 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1228 DISCARD (1);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1229 TOP = Fplus (2, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1230 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1231 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1232
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1233 case Bmax:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1234 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1235 DISCARD (1);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1236 TOP = Fmax (2, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1237 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1238 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1239
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1240 case Bmin:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1241 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1242 DISCARD (1);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1243 TOP = Fmin (2, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1244 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1245 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1246
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1247 case Bmult:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1248 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1249 DISCARD (1);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1250 TOP = Ftimes (2, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1251 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1252 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1253
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1254 case Bquo:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1255 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1256 DISCARD (1);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1257 TOP = Fquo (2, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1258 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1259 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1260
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1261 case Brem:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1262 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1263 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1264 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1265 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1266 TOP = Frem (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1267 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1268 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1269 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1270
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1271 case Bpoint:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1272 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1273 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1274 XSETFASTINT (v1, PT);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1275 PUSH (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1276 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1277 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1278
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1279 case Bgoto_char:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1280 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1281 TOP = Fgoto_char (TOP);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1282 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1283 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1284
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1285 case Binsert:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1286 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1287 TOP = Finsert (1, &TOP);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1288 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1289 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1290
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1291 case BinsertN:
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1292 op = FETCH;
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
1293 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1294 DISCARD (op - 1);
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1295 TOP = Finsert (op, &TOP);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1296 AFTER_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1297 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1298
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1299 case Bpoint_max:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1300 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1301 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1302 XSETFASTINT (v1, ZV);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1303 PUSH (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1304 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1305 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1306
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1307 case Bpoint_min:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1308 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1309 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1310 XSETFASTINT (v1, BEGV);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1311 PUSH (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1312 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1313 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1314
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1315 case Bchar_after:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1316 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1317 TOP = Fchar_after (TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1318 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1319 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1320
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1321 case Bfollowing_char:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1322 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1323 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1324 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1325 v1 = Ffollowing_char ();
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1326 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1327 PUSH (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1328 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1329 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1330
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1331 case Bpreceding_char:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1332 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1333 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1334 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1335 v1 = Fprevious_char ();
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1336 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1337 PUSH (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1338 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1339 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1340
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1341 case Bcurrent_column:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1342 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1343 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1344 XSETFASTINT (v1, current_column ());
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1345 PUSH (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1346 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1347 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1348
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1349 case Bindent_to:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1350 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1351 TOP = Findent_to (TOP, Qnil);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1352 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1353 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1354
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1355 case Beolp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1356 PUSH (Feolp ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1357 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1358
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1359 case Beobp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1360 PUSH (Feobp ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1361 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1362
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1363 case Bbolp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1364 PUSH (Fbolp ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1365 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1366
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1367 case Bbobp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1368 PUSH (Fbobp ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1369 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1370
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1371 case Bcurrent_buffer:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1372 PUSH (Fcurrent_buffer ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1373 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1374
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1375 case Bset_buffer:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1376 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1377 TOP = Fset_buffer (TOP);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1378 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1379 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1380
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1381 case Binteractive_p:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1382 PUSH (Finteractive_p ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1383 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1384
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1385 case Bforward_char:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1386 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1387 TOP = Fforward_char (TOP);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1388 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1389 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1390
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1391 case Bforward_word:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1392 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1393 TOP = Fforward_word (TOP);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1394 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1395 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1396
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1397 case Bskip_chars_forward:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1398 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1399 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1400 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1401 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1402 TOP = Fskip_chars_forward (TOP, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1403 AFTER_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1404 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1405 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1406
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1407 case Bskip_chars_backward:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1408 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1409 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1410 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1411 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1412 TOP = Fskip_chars_backward (TOP, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1413 AFTER_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1414 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1415 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1416
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1417 case Bforward_line:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1418 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1419 TOP = Fforward_line (TOP);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1420 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1421 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1422
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1423 case Bchar_syntax:
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1424 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1425 CHECK_NUMBER (TOP, 0);
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1426 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1427 XSETFASTINT (TOP, syntax_code_spec[(int) SYNTAX (XINT (TOP))]);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1428 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1429
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1430 case Bbuffer_substring:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1431 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1432 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1433 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1434 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1435 TOP = Fbuffer_substring (TOP, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1436 AFTER_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1437 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1438 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1439
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1440 case Bdelete_region:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1441 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1442 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1443 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1444 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1445 TOP = Fdelete_region (TOP, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1446 AFTER_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1447 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1448 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1449
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1450 case Bnarrow_to_region:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1451 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1452 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1453 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1454 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1455 TOP = Fnarrow_to_region (TOP, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1456 AFTER_POTENTIAL_GC ();
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1457 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1458 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1459
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1460 case Bwiden:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1461 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1462 PUSH (Fwiden ());
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1463 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1464 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1465
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1466 case Bend_of_line:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1467 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1468 TOP = Fend_of_line (TOP);
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1469 AFTER_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1470 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1471
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1472 case Bset_marker:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1473 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1474 Lisp_Object v1, v2;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1475 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1476 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1477 v2 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1478 TOP = Fset_marker (TOP, v2, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1479 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1480 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1481 }
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1482
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1483 case Bmatch_beginning:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1484 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1485 TOP = Fmatch_beginning (TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1486 AFTER_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1487 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1488
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1489 case Bmatch_end:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1490 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1491 TOP = Fmatch_end (TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1492 AFTER_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1493 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1494
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1495 case Bupcase:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1496 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1497 TOP = Fupcase (TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1498 AFTER_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1499 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1500
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1501 case Bdowncase:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1502 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1503 TOP = Fdowncase (TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1504 AFTER_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1505 break;
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1506
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1507 case Bstringeqlsign:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1508 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1509 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1510 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1511 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1512 TOP = Fstring_equal (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1513 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1514 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1515 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1516
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1517 case Bstringlss:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1518 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1519 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1520 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1521 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1522 TOP = Fstring_lessp (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1523 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1524 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1525 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1526
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1527 case Bequal:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1528 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1529 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1530 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1531 TOP = Fequal (TOP, v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1532 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1533 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1534
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1535 case Bnthcdr:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1536 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1537 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1538 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1539 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1540 TOP = Fnthcdr (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1541 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1542 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1543 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1544
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1545 case Belt:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1546 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1547 Lisp_Object v1, v2;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1548 if (CONSP (TOP))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1549 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1550 /* Exchange args and then do nth. */
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1551 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1552 v2 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1553 v1 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1554 CHECK_NUMBER (v2, 0);
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1555 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1556 op = XINT (v2);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1557 immediate_quit = 1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1558 while (--op >= 0)
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1559 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1560 if (CONSP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1561 v1 = XCDR (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1562 else if (!NILP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1563 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1564 immediate_quit = 0;
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1565 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1566 v1 = wrong_type_argument (Qlistp, v1);
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1567 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1568 immediate_quit = 1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1569 op++;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1570 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1571 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1572 immediate_quit = 0;
26380
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
1573 if (CONSP (v1))
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
1574 TOP = XCAR (v1);
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
1575 else if (NILP (v1))
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
1576 TOP = Qnil;
97289ec4d7d0 * bytecode.c (Fbyte_code) <BinsertN, Bcall>: Do the
Gerd Moellmann <gerd@gnu.org>
parents: 26376
diff changeset
1577 else
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1578 {
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1579 BEFORE_POTENTIAL_GC ();
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1580 Fcar (wrong_type_argument (Qlistp, v1));
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1581 AFTER_POTENTIAL_GC ();
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1582 }
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1583 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1584 else
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1585 {
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1586 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1587 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1588 TOP = Felt (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1589 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1590 }
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1591 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1592 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1593
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1594 case Bmember:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1595 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1596 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1597 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1598 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1599 TOP = Fmember (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1600 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1601 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1602 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1603
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1604 case Bassq:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1605 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1606 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1607 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1608 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1609 TOP = Fassq (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1610 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1611 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1612 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1613
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1614 case Bnreverse:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1615 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1616 TOP = Fnreverse (TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1617 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1618 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1619
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1620 case Bsetcar:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1621 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1622 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1623 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1624 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1625 TOP = Fsetcar (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1626 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1627 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1628 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1629
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1630 case Bsetcdr:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1631 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1632 Lisp_Object v1;
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1633 BEFORE_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1634 v1 = POP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1635 TOP = Fsetcdr (TOP, v1);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1636 AFTER_POTENTIAL_GC ();
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1637 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1638 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1639
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1640 case Bcar_safe:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1641 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1642 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1643 v1 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1644 if (CONSP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1645 TOP = XCAR (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1646 else
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1647 TOP = Qnil;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1648 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1649 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1650
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1651 case Bcdr_safe:
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1652 {
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1653 Lisp_Object v1;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1654 v1 = TOP;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1655 if (CONSP (v1))
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1656 TOP = XCDR (v1);
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1657 else
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1658 TOP = Qnil;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1659 break;
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1660 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1661
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1662 case Bnconc:
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1663 BEFORE_POTENTIAL_GC ();
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1664 DISCARD (1);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1665 TOP = Fnconc (2, &TOP);
28497
334ebb7a551c (Fbyte_code): Add a bunch of BEFORE_POTENTIAL_GC/
Gerd Moellmann <gerd@gnu.org>
parents: 27817
diff changeset
1666 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1667 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1668
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1669 case Bnumberp:
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1670 TOP = (NUMBERP (TOP) ? Qt : Qnil);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1671 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1672
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1673 case Bintegerp:
9139
127823d9444d (Fbyte_code): Use type test macros.
Karl Heuer <kwzh@gnu.org>
parents: 4696
diff changeset
1674 TOP = INTEGERP (TOP) ? Qt : Qnil;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1675 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1676
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1677 #ifdef BYTE_CODE_SAFE
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1678 case Bset_mark:
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1679 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1680 error ("set-mark is an obsolete bytecode");
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1681 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1682 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1683 case Bscan_buffer:
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1684 BEFORE_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1685 error ("scan-buffer is an obsolete bytecode");
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1686 AFTER_POTENTIAL_GC ();
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1687 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1688 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1689
27293
d94d421ca521 (Fbyte_code): Pass new arg to set_internal.
Richard M. Stallman <rms@gnu.org>
parents: 26380
diff changeset
1690 case 0:
d94d421ca521 (Fbyte_code): Pass new arg to set_internal.
Richard M. Stallman <rms@gnu.org>
parents: 26380
diff changeset
1691 abort ();
d94d421ca521 (Fbyte_code): Pass new arg to set_internal.
Richard M. Stallman <rms@gnu.org>
parents: 26380
diff changeset
1692
d94d421ca521 (Fbyte_code): Pass new arg to set_internal.
Richard M. Stallman <rms@gnu.org>
parents: 26380
diff changeset
1693 case 255:
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1694 default:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1695 #ifdef BYTE_CODE_SAFE
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1696 if (op < Bconstant)
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1697 {
27727
9400865ec7cf Remove `LISP_FLOAT_TYPE' and `standalone'.
Gerd Moellmann <gerd@gnu.org>
parents: 27442
diff changeset
1698 abort ();
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1699 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1700 if ((op -= Bconstant) >= const_length)
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1701 {
27727
9400865ec7cf Remove `LISP_FLOAT_TYPE' and `standalone'.
Gerd Moellmann <gerd@gnu.org>
parents: 27442
diff changeset
1702 abort ();
27442
ad65b21bc4cd (Fbyte_code): Use {BEFORE,AFTER}_POTENTIAL_GC where
Gerd Moellmann <gerd@gnu.org>
parents: 27438
diff changeset
1703 }
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1704 PUSH (vectorp[op]);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1705 #else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1706 PUSH (vectorp[op - Bconstant]);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1707 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1708 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1709 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1710
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1711 exit:
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
1712
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
1713 byte_stack_list = byte_stack_list->next;
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
1714
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1715 /* Binds and unbinds are supposed to be compiled balanced. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1716 if (specpdl_ptr - specpdl != count)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1717 #ifdef BYTE_CODE_SAFE
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1718 error ("binding stack not balanced (serious byte compiler bug)");
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1719 #else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1720 abort ();
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1721 #endif
26363
efb608f1cb10 (struct byte_stack): New.
Gerd Moellmann <gerd@gnu.org>
parents: 25645
diff changeset
1722
26370
5f52cc1417ab Use block statements in cases and declare v1 and v2
Gerd Moellmann <gerd@gnu.org>
parents: 26368
diff changeset
1723 return result;
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1724 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1725
21514
fa9ff387d260 Fix -Wimplicit warnings.
Andreas Schwab <schwab@suse.de>
parents: 21244
diff changeset
1726 void
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1727 syms_of_bytecode ()
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1728 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1729 Qbytecode = intern ("byte-code");
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1730 staticpro (&Qbytecode);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1731
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1732 defsubr (&Sbyte_code);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1733
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1734 #ifdef BYTE_CODE_METER
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1735
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1736 DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter,
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1737 "A vector of vectors which holds a histogram of byte-code usage.\n\
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1738 (aref (aref byte-code-meter 0) CODE) indicates how many times the byte\n\
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1739 opcode CODE has been executed.\n\
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1740 (aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0,\n\
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1741 indicates how many times the byte opcodes CODE1 and CODE2 have been\n\
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1742 executed in succession.");
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1743 DEFVAR_BOOL ("byte-metering-on", &byte_metering_on,
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1744 "If non-nil, keep profiling information on byte code usage.\n\
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1745 The variable byte-code-meter indicates how often each byte opcode is used.\n\
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1746 If a symbol has a property named `byte-code-meter' whose value is an\n\
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1747 integer, it is incremented each time that symbol's function is called.");
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1748
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1749 byte_metering_on = 0;
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1750 Vbyte_code_meter = Fmake_vector (make_number (256), make_number (0));
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1751 Qbyte_code_meter = intern ("byte-code-meter");
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1752 staticpro (&Qbyte_code_meter);
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1753 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1754 int i = 256;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1755 while (i--)
959
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1756 XVECTOR (Vbyte_code_meter)->contents[i] =
c1fc76b79275 * bytecode.c (Fbyte_code): When metering the Bcall opcodes, make
Jim Blandy <jimb@redhat.com>
parents: 944
diff changeset
1757 Fmake_vector (make_number (256), make_number (0));
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1758 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1759 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1760 }