annotate src/bytecode.c @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 0293115a14e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Execution of byte code produced by bytecomp.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1992, 1993 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: Mule 2.0, FSF 19.30. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Authorship:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 FSF: long ago.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 hacked on by jwz@lucid.com 17-jun-91
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 o added a compile-time switch to turn on simple sanity checking;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 o put back the obsolete byte-codes for error-detection;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 o added a new instruction, unbind_all, which I will use for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 tail-recursion elimination;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 o made temp_output_buffer_show be called with the right number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 of args;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 o made the new bytecodes be called with args in the right order;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 o added metering support.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 by Hallvard:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 o added relative jump instructions;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 o all conditionals now only do QUIT if they jump.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #include "lisp.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 #include "buffer.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 #include "syntax.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 * define BYTE_CODE_SAFE to enable some minor sanity checking (useful for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 * debugging the byte compiler...) Somewhat surprisingly, defining this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 * makes Fbyte_code about 8% slower.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 * define BYTE_CODE_METER to enable generation of a byte-op usage histogram.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 /* #define BYTE_CODE_SAFE */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 /* #define BYTE_CODE_METER */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 #ifdef BYTE_CODE_METER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 Lisp_Object Vbyte_code_meter, Qbyte_code_meter;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 int byte_metering_on;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 #define METER_2(code1, code2) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 XINT (XVECTOR (vector_data (XVECTOR (Vbyte_code_meter))[(code1)]) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ->contents[(code2)])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 #define METER_1(code) METER_2 (0, (code))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 #define METER_CODE(last_code, this_code) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 if (byte_metering_on) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 { \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 if (METER_1 (this_code) != ((1<<VALBITS)-1)) \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 METER_1 (this_code)++; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 if (last_code \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 && METER_2 (last_code, this_code) != ((1<<VALBITS)-1))\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 METER_2 (last_code, this_code)++; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 } \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 #endif /* no BYTE_CODE_METER */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 Lisp_Object Qbyte_code;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 /* Byte codes: */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 #define Bvarref 010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 #define Bvarset 020
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 #define Bvarbind 030
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 #define Bcall 040
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 #define Bunbind 050
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 #define Bnth 070
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 #define Bsymbolp 071
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 #define Bconsp 072
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 #define Bstringp 073
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 #define Blistp 074
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 #define Beq 075
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 #define Bmemq 076
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 #define Bnot 077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 #define Bcar 0100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 #define Bcdr 0101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 #define Bcons 0102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 #define Blist1 0103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 #define Blist2 0104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 #define Blist3 0105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 #define Blist4 0106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 #define Blength 0107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 #define Baref 0110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 #define Baset 0111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 #define Bsymbol_value 0112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #define Bsymbol_function 0113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 #define Bset 0114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 #define Bfset 0115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 #define Bget 0116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 #define Bsubstring 0117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 #define Bconcat2 0120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 #define Bconcat3 0121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 #define Bconcat4 0122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 #define Bsub1 0123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 #define Badd1 0124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 #define Beqlsign 0125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 #define Bgtr 0126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 #define Blss 0127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 #define Bleq 0130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 #define Bgeq 0131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 #define Bdiff 0132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 #define Bnegate 0133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 #define Bplus 0134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 #define Bmax 0135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 #define Bmin 0136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 #define Bmult 0137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 #define Bpoint 0140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 #define Bmark 0141 /* no longer generated as of v18 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 #define Bgoto_char 0142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 #define Binsert 0143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 #define Bpoint_max 0144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 #define Bpoint_min 0145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 #define Bchar_after 0146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 #define Bfollowing_char 0147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 #define Bpreceding_char 0150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 #define Bcurrent_column 0151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 #define Bindent_to 0152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 #define Bscan_buffer 0153 /* No longer generated as of v18 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 #define Beolp 0154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 #define Beobp 0155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 #define Bbolp 0156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 #define Bbobp 0157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 #define Bcurrent_buffer 0160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 #define Bset_buffer 0161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 #define Bread_char 0162 /* No longer generated as of v19 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 #define Bset_mark 0163 /* this loser is no longer generated as of v18 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 #define Binteractive_p 0164 /* Needed since interactive-p takes unevalled args */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 #define Bforward_char 0165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 #define Bforward_word 0166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 #define Bskip_chars_forward 0167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 #define Bskip_chars_backward 0170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 #define Bforward_line 0171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 #define Bchar_syntax 0172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 #define Bbuffer_substring 0173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 #define Bdelete_region 0174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 #define Bnarrow_to_region 0175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 #define Bwiden 0176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 #define Bend_of_line 0177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 #define Bconstant2 0201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 #define Bgoto 0202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 #define Bgotoifnil 0203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 #define Bgotoifnonnil 0204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 #define Bgotoifnilelsepop 0205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 #define Bgotoifnonnilelsepop 0206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 #define Breturn 0207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 #define Bdiscard 0210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 #define Bdup 0211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 #define Bsave_excursion 0212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 #define Bsave_window_excursion 0213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 #define Bsave_restriction 0214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 #define Bcatch 0215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 #define Bunwind_protect 0216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 #define Bcondition_case 0217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 #define Btemp_output_buffer_setup 0220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 #define Btemp_output_buffer_show 0221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 #define Bunbind_all 0222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 #define Bset_marker 0223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 #define Bmatch_beginning 0224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 #define Bmatch_end 0225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 #define Bupcase 0226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 #define Bdowncase 0227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 #define Bstringeqlsign 0230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 #define Bstringlss 0231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 #define Bequal 0232
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 #define Bnthcdr 0233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 #define Belt 0234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 #define Bmember 0235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 #define Bassq 0236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 #define Bnreverse 0237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 #define Bsetcar 0240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 #define Bsetcdr 0241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 #define Bcar_safe 0242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 #define Bcdr_safe 0243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 #define Bnconc 0244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 #define Bquo 0245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 #define Brem 0246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 #define Bnumberp 0247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 #define Bintegerp 0250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 #define BRgoto 0252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 #define BRgotoifnil 0253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 #define BRgotoifnonnil 0254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 #define BRgotoifnilelsepop 0255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 #define BRgotoifnonnilelsepop 0256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 #define BlistN 0257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 #define BconcatN 0260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 #define BinsertN 0261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 #define Bconstant 0300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 #define CONSTANTLIM 0100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 /* Fetch the next byte from the bytecode stream */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 #define FETCH (massaged_code[pc++])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 #define FETCH *pc++
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 /* Fetch two bytes from the bytecode stream
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 and make a 16-bit number out of them */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 #define FETCH2 (op = FETCH, op + (FETCH << 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 /* Push x onto the execution stack. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 /* This used to be #define PUSH(x) (*++stackp = (x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 This oddity is necessary because Alliant can't be bothered to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 compile the preincrement operator properly, as of 4/91. -JimB */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 #define PUSH(x) (stackp++, *stackp = (x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 /* Pop a value off the execution stack. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 #define POP (*stackp--)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 /* Discard n values from the execution stack. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 #define DISCARD(n) (stackp -= (n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 /* Get the value which is at the top of the execution stack,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 but don't pop it. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 #define TOP (*stackp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 Function used internally in byte-compiled code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 The first argument is a string of byte code; the second, a vector of constants;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 the third, the maximum stack depth used in this function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 If the third argument is incorrect, Emacs may crash.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 */ )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (bytestr, vector, maxdepth)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 Lisp_Object bytestr, vector, maxdepth;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 /* This function can GC */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 struct gcpro gcpro1, gcpro2, gcpro3;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 int speccount = specpdl_depth ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 #ifdef BYTE_CODE_METER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 int this_op = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 int prev_op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 REGISTER int op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 int pc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 REGISTER Bufbyte *pc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 Lisp_Object *stack;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 REGISTER Lisp_Object *stackp;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 Lisp_Object *stacke;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 REGISTER Lisp_Object v1, v2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 REGISTER Lisp_Object *vectorp = vector_data (XVECTOR (vector));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 #ifdef BYTE_CODE_SAFE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 REGISTER int const_length = vector_length (XVECTOR (vector));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 REGISTER Emchar *massaged_code;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 int massaged_code_len;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 /* Cached address of beginning of string, valid if BYTESTR data not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 relocated. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 REGISTER Bufbyte *strbeg;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 REGISTER struct Lisp_String *detagged_string;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 CHECK_STRING (bytestr);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 if (!VECTORP (vector))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 vector = wrong_type_argument (Qvectorp, vector);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 CHECK_NATNUM (maxdepth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 stackp = (Lisp_Object *) alloca (XINT (maxdepth) * sizeof (Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 memset (stackp, 0, XINT (maxdepth) * sizeof (Lisp_Object));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 GCPRO3 (bytestr, vector, *stackp);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 gcpro3.nvars = XINT (maxdepth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 --stackp;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 stack = stackp;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 stacke = stackp + XINT (maxdepth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 /* Initialize the pc-register and convert the string into a fixed-width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 format for easier processing. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 massaged_code =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (Emchar *) alloca (sizeof (Emchar) *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (1 + string_char_length (XSTRING (bytestr))));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 massaged_code_len =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 convert_bufbyte_string_into_emchar_string (string_data (XSTRING (bytestr)),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 string_length (XSTRING (bytestr)),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 massaged_code);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 massaged_code[massaged_code_len] = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 pc = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 /* Initialize the pc-pointer by fetching from the string. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 detagged_string = XSTRING (bytestr);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 pc = string_data (detagged_string);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 strbeg = pc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 while (1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 #ifdef BYTE_CODE_SAFE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 if (stackp > stacke)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 error ("Byte code stack overflow (byte compiler bug), pc %d, depth %d",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 pc, stacke - stackp);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 pc - string_data (detagged_string), stacke - stackp);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 if (stackp < stack)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 error ("Byte code stack underflow (byte compiler bug), pc %d",
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 pc);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 pc - string_data (detagged_string));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 #ifndef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 if (strbeg != string_data (detagged_string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 pc = pc - strbeg + string_data (detagged_string);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 strbeg = string_data (detagged_string);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 #ifdef BYTE_CODE_METER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 prev_op = this_op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 this_op = op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 METER_CODE (prev_op, op);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 switch (op)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 switch (op = FETCH)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 case Bvarref+6:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 goto varref;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 case Bvarref+7:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 op = FETCH2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 goto varref;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 case Bvarref: case Bvarref+1: case Bvarref+2: case Bvarref+3:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 case Bvarref+4: case Bvarref+5:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 op = op - Bvarref;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 varref:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 v1 = vectorp[op];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 if (!SYMBOLP (v1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 v2 = Fsymbol_value (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 v2 = XSYMBOL (v1)->value;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 if (SYMBOL_VALUE_MAGIC_P (v2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 v2 = Fsymbol_value (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 PUSH (v2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 case Bvarset+6:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 goto varset;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 case Bvarset+7:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 op = FETCH2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 goto varset;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 case Bvarset: case Bvarset+1: case Bvarset+2: case Bvarset+3:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 case Bvarset+4: case Bvarset+5:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 op -= Bvarset;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 varset:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 Fset (vectorp[op], POP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 case Bvarbind+6:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 goto varbind;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 case Bvarbind+7:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 op = FETCH2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 goto varbind;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 case Bvarbind: case Bvarbind+1: case Bvarbind+2: case Bvarbind+3:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 case Bvarbind+4: case Bvarbind+5:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 op -= Bvarbind;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 varbind:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 specbind (vectorp[op], POP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 case Bcall+6:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 goto docall;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 case Bcall+7:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 op = FETCH2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 goto docall;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 case Bcall: case Bcall+1: case Bcall+2: case Bcall+3:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 case Bcall+4: case Bcall+5:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 op -= Bcall;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 docall:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 DISCARD (op);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 #ifdef BYTE_CODE_METER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 if (byte_metering_on && SYMBOLP (TOP))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 v2 = Fget (v1, Qbyte_code_meter, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 if (INTP (v2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 && XINT (v2) != ((1<<VALBITS)-1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 XSETINT (v2, XINT (v2) + 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 Fput (v1, Qbyte_code_meter, v2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 TOP = Ffuncall (op + 1, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 case Bunbind+6:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 goto dounbind;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 case Bunbind+7:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 op = FETCH2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 goto dounbind;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 case Bunbind: case Bunbind+1: case Bunbind+2: case Bunbind+3:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 case Bunbind+4: case Bunbind+5:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 op -= Bunbind;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 dounbind:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 unbind_to (specpdl_depth () - op, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 case Bunbind_all:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 /* To unbind back to the beginning of this frame. Not used yet,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 but will be needed for tail-recursion elimination. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 unbind_to (speccount, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 case Bgoto:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 op = FETCH2; /* pc = FETCH2 loses since FETCH2 contains pc++ */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 pc = op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 pc = string_data (detagged_string) + op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 case Bgotoifnil:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 op = FETCH2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 if (NILP (POP))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 pc = op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 pc = string_data (detagged_string) + op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 case Bgotoifnonnil:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 op = FETCH2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 if (!NILP (POP))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 pc = op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 pc = string_data (detagged_string) + op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 case Bgotoifnilelsepop:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 op = FETCH2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 if (NILP (TOP))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 pc = op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 pc = string_data (detagged_string) + op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 else DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 case Bgotoifnonnilelsepop:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 op = FETCH2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 if (!NILP (TOP))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 pc = op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 pc = string_data (detagged_string) + op;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 else DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 case BRgoto:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 pc += massaged_code[pc] - 127;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 /* pc += *pc - 127; */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 pc = (unsigned char *) ((unsigned long) pc + *pc - 127);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 case BRgotoifnil:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 if (NILP (POP))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 pc += massaged_code[pc] - 128;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 /* pc += *pc - 128; */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 pc = (unsigned char *) ((unsigned long) pc + *pc - 128);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 pc++;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 case BRgotoifnonnil:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 if (!NILP (POP))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 pc += massaged_code[pc] - 128;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 /* pc += *pc - 128; */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 pc = (unsigned char *) ((unsigned long) pc + *pc - 128);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 pc++;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 case BRgotoifnilelsepop:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 if (NILP (TOP))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 pc += op - 128;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 /* pc += op - 128; */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 pc = (unsigned char *) ((unsigned long) pc + op - 128);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 else DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 case BRgotoifnonnilelsepop:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 if (!NILP (TOP))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 #ifdef V20_SLOW_WAY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 pc += op - 128;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 #else /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 /* pc += op - 128; */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 pc = (unsigned char *) ((unsigned long) pc + op - 128);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 #endif /* !V20_SLOW_WAY */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 else DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 case Breturn:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 goto exit;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 case Bdiscard:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 case Bdup:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 PUSH (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 case Bconstant2:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 PUSH (vectorp[FETCH2]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 case Bsave_excursion:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 record_unwind_protect (save_excursion_restore,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 save_excursion_save ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 case Bsave_window_excursion:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 int count = specpdl_depth ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 record_unwind_protect (save_window_excursion_unwind,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 Fcurrent_window_configuration (Qnil));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 TOP = Fprogn (TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 unbind_to (count, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 case Bsave_restriction:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 record_unwind_protect (save_restriction_restore,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 save_restriction_save ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 case Bcatch:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 TOP = internal_catch (TOP, Feval, v1, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 case Bunwind_protect:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 record_unwind_protect (Fprogn, POP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 case Bcondition_case:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 v1 = POP; /* handlers */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 v2 = POP; /* bodyform */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 TOP = Fcondition_case_3 (v2, TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 case Btemp_output_buffer_setup:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 temp_output_buffer_setup ((char *) string_data (XSTRING (TOP)));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 TOP = Vstandard_output;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 case Btemp_output_buffer_show:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 temp_output_buffer_show (TOP, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 TOP = v1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 /* GAG ME!! */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 /* pop binding of standard-output */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 unbind_to (specpdl_depth() - 1, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 case Bnth:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 v2 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 /* nth_entry: */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 CHECK_INT (v2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 op = XINT (v2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 while (--op >= 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 if (CONSP (v1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 v1 = XCDR (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 else if (!NILP (v1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 v1 = wrong_type_argument (Qlistp, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 op++;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 goto docar;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 case Bsymbolp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 TOP = ((SYMBOLP (TOP)) ? Qt : Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 case Bconsp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 TOP = ((CONSP (TOP)) ? Qt : Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 case Bstringp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 TOP = ((STRINGP (TOP)) ? Qt : Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 case Blistp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 TOP = CONSP (TOP) || NILP (TOP) ? Qt : Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 case Beq:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 TOP = ((HACKEQ_UNSAFE (v1, TOP)) ? Qt : Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 case Bmemq:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 TOP = Fmemq (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 case Bnot:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 TOP = NILP (TOP) ? Qt : Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 case Bcar:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 docar:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 if (CONSP (v1)) TOP = XCAR (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 else if (NILP (v1)) TOP = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 else Fcar (wrong_type_argument (Qlistp, v1));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 case Bcdr:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 if (CONSP (v1)) TOP = XCDR (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 else if (NILP (v1)) TOP = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 else Fcdr (wrong_type_argument (Qlistp, v1));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 case Bcons:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 TOP = Fcons (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 case Blist1:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 TOP = Fcons (TOP, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 case Blist2:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 TOP = Fcons (TOP, Fcons (v1, Qnil));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 case Blist3:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 DISCARD (2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 TOP = Flist (3, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 case Blist4:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 DISCARD (3);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 TOP = Flist (4, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 case BlistN:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 DISCARD (op - 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 TOP = Flist (op, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 case Blength:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 TOP = Flength (TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 case Baref:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 TOP = Faref (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 case Baset:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 v2 = POP; v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 TOP = Faset (TOP, v1, v2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 case Bsymbol_value:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 TOP = Fsymbol_value (TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 case Bsymbol_function:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 TOP = Fsymbol_function (TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 case Bset:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 TOP = Fset (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 case Bfset:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 TOP = Ffset (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 case Bget:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 TOP = Fget (TOP, v1, Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 case Bsubstring:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 v2 = POP; v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 TOP = Fsubstring (TOP, v1, v2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 case Bconcat2:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 TOP = Fconcat (2, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 case Bconcat3:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 DISCARD (2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 TOP = Fconcat (3, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 case Bconcat4:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 DISCARD (3);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 TOP = Fconcat (4, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 case BconcatN:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 DISCARD (op - 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 TOP = Fconcat (op, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 case Bsub1:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 if (INTP (v1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 XSETINT (v1, XINT (v1) - 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 TOP = v1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 TOP = Fsub1 (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 case Badd1:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 if (INTP (v1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 XSETINT (v1, XINT (v1) + 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 TOP = v1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 TOP = Fadd1 (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 case Beqlsign:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 v2 = POP; v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 CHECK_INT_OR_FLOAT_COERCE_CHAR_OR_MARKER (v2);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 #ifdef LISP_FLOAT_TYPE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 if (FLOATP (v1) || FLOATP (v2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 double f1, f2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 f1 = (FLOATP (v1) ? float_data (XFLOAT (v1)) : XINT (v1));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 f2 = (FLOATP (v2) ? float_data (XFLOAT (v2)) : XINT (v2));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 TOP = (f1 == f2 ? Qt : Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 TOP = (XINT (v1) == XINT (v2) ? Qt : Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 case Bgtr:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 TOP = Fgtr (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 case Blss:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 TOP = Flss (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 case Bleq:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 TOP = Fleq (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 case Bgeq:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 TOP = Fgeq (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 case Bdiff:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 TOP = Fminus (2, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 case Bnegate:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 if (INTP (v1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 XSETINT (v1, - XINT (v1));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 TOP = v1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 TOP = Fminus (1, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 case Bplus:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 TOP = Fplus (2, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 case Bmax:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 TOP = Fmax (2, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 case Bmin:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 TOP = Fmin (2, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 case Bmult:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 TOP = Ftimes (2, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 case Bquo:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 TOP = Fquo (2, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 case Brem:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 TOP = Frem (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 case Bpoint:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 v1 = make_int (BUF_PT (current_buffer));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 PUSH (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 case Bgoto_char:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 TOP = Fgoto_char (TOP, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 case Binsert:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 TOP = Finsert (1, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 case BinsertN:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 op = FETCH;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 DISCARD (op - 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 TOP = Finsert (op, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 case Bpoint_max:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 v1 = make_int (BUF_ZV (current_buffer));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 PUSH (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 case Bpoint_min:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 v1 = make_int (BUF_BEGV (current_buffer));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 PUSH (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 case Bchar_after:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 TOP = Fchar_after (TOP, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 case Bfollowing_char:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 v1 = Ffollowing_char (Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 PUSH (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 case Bpreceding_char:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 v1 = Fpreceding_char (Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 PUSH (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 case Bcurrent_column:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 v1 = make_int (current_column (current_buffer));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 PUSH (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 case Bindent_to:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 TOP = Findent_to (TOP, Qnil, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 case Beolp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 PUSH (Feolp (Fcurrent_buffer ()));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 case Beobp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 PUSH (Feobp (Fcurrent_buffer ()));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 case Bbolp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 PUSH (Fbolp (Fcurrent_buffer ()));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 case Bbobp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 PUSH (Fbobp (Fcurrent_buffer ()));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 case Bcurrent_buffer:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 PUSH (Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 case Bset_buffer:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 TOP = Fset_buffer (TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 case Bread_char:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 PUSH (call0 (Qread_char));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 QUIT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 case Binteractive_p:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 PUSH (Finteractive_p ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 case Bforward_char:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 TOP = Fforward_char (TOP, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 case Bforward_word:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 TOP = Fforward_word (TOP, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 case Bskip_chars_forward:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 TOP = Fskip_chars_forward (TOP, v1, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 case Bskip_chars_backward:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 TOP = Fskip_chars_backward (TOP, v1, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 case Bforward_line:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 TOP = Fforward_line (TOP, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 case Bchar_syntax:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 CHECK_CHAR_COERCE_INT (TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 TOP = make_char (syntax_code_spec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 [(int) SYNTAX (current_buffer->syntax_table,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 XCHAR (TOP))]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 case Bbuffer_substring:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 TOP = Fbuffer_substring (TOP, v1, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 case Bdelete_region:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 TOP = Fdelete_region (TOP, v1, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 case Bnarrow_to_region:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 TOP = Fnarrow_to_region (TOP, v1, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 case Bwiden:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 PUSH (Fwiden (Fcurrent_buffer ()));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 case Bend_of_line:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 TOP = Fend_of_line (TOP, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 case Bset_marker:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 v2 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 TOP = Fset_marker (TOP, v2, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 case Bmatch_beginning:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 TOP = Fmatch_beginning (TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 case Bmatch_end:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 TOP = Fmatch_end (TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 case Bupcase:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 TOP = Fupcase (TOP, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 case Bdowncase:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 TOP = Fdowncase (TOP, Fcurrent_buffer ());
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 case Bstringeqlsign:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 TOP = Fstring_equal (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 case Bstringlss:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 TOP = Fstring_lessp (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 case Bequal:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 TOP = Fequal (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 case Bnthcdr:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 TOP = Fnthcdr (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 case Belt:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 #if 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 /* probably this code is OK, but nth_entry is commented
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 out above --ben */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 if (XTYPE (TOP) == Lisp_Cons)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 /* Exchange args and then do nth. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 v2 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 goto nth_entry;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 TOP = Felt (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 case Bmember:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 TOP = Fmember (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 case Bassq:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 TOP = Fassq (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 case Bnreverse:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 TOP = Fnreverse (TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 case Bsetcar:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 TOP = Fsetcar (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 case Bsetcdr:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 v1 = POP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 TOP = Fsetcdr (TOP, v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 case Bcar_safe:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 if (CONSP (v1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 TOP = XCAR (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 TOP = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 case Bcdr_safe:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 v1 = TOP;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 if (CONSP (v1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 TOP = XCDR (v1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 TOP = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 case Bnconc:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 DISCARD (1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 TOP = Fnconc (2, &TOP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 case Bnumberp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 TOP = ((INT_OR_FLOATP (TOP)) ? Qt : Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 case Bintegerp:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 TOP = ((INTP (TOP)) ? Qt : Qnil);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 #ifdef BYTE_CODE_SAFE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 case Bset_mark:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 error ("set-mark is an obsolete bytecode");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 case Bscan_buffer:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 error ("scan-buffer is an obsolete bytecode");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 case Bmark:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 error ("mark is an obsolete bytecode");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 default:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 #ifdef BYTE_CODE_SAFE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 if (op < Bconstant)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 error ("unknown bytecode %d (byte compiler bug)", op);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 if ((op -= Bconstant) >= const_length)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 error ("no constant number %d (byte compiler bug)", op);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 PUSH (vectorp[op]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 PUSH (vectorp[op - Bconstant]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 exit:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 UNGCPRO;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 /* Binds and unbinds are supposed to be compiled balanced. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 if (specpdl_depth() != speccount)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 /* FSF: abort() if BYTE_CODE_SAFE not defined */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 error ("binding stack not balanced (serious byte compiler bug)");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 return v1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 syms_of_bytecode (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 defsymbol (&Qbyte_code, "byte-code");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 defsubr (&Sbyte_code);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 #ifdef BYTE_CODE_METER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 defsymbol (&Qbyte_code_meter, "byte-code-meter");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 vars_of_bytecode (void)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 #ifdef BYTE_CODE_METER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 A vector of vectors which holds a histogram of byte-code usage.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 (aref (aref byte-code-meter 0) CODE) indicates how many times the byte
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 opcode CODE has been executed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 (aref (aref byte-code-meter CODE1) CODE2), where CODE1 is not 0,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 indicates how many times the byte opcodes CODE1 and CODE2 have been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 executed in succession.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 */ );
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 DEFVAR_BOOL ("byte-metering-on", &byte_metering_on /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 If non-nil, keep profiling information on byte code usage.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 The variable byte-code-meter indicates how often each byte opcode is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 If a symbol has a property named `byte-code-meter' whose value is an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 integer, it is incremented each time that symbol's function is called.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 */ );
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 byte_metering_on = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 Vbyte_code_meter = make_vector (256, Qzero);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 int i = 256;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 while (i--)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 vector_data (XVECTOR (Vbyte_code_meter))[i] =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 make_vector (256, Qzero);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 }