annotate src/bytecode.c @ 350:80a890dbbeb5

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Wed, 24 Jul 1991 23:47:06 +0000
parents 88bee8093f43
children d0eb77a4d8f7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
310
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 /* Execution of byte code produced by bytecomp.el.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 This file is part of GNU Emacs.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 the Free Software Foundation; either version 1, or (at your option)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 any later version.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 GNU General Public License for more details.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 hacked on by jwz 17-jun-91
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 o added a compile-time switch to turn on simple sanity checking;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 o put back the obsolete byte-codes for error-detection;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 o put back fset, symbol-function, and read-char because I don't
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24 see any reason for them to have been removed;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 o added a new instruction, unbind_all, which I will use for
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 tail-recursion elimination;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 o made temp_output_buffer_show() be called with the right number
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 of args;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 o made the new bytecodes be called with args in the right order;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 o added metering support.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 by Hallvard:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 o added relative jump instructions;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 o all conditionals now only do QUIT if they jump.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 #include "config.h"
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 #include "lisp.h"
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 #include "buffer.h"
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 #include "syntax.h"
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 /* Define this to enable some minor sanity checking
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 (useful for debugging the byte compiler...)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 #define BYTE_CODE_SAFE
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 /* Define this to enable generation of a histogram of byte-op usage.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 #define BYTE_CODE_METER
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 #ifdef BYTE_CODE_METER
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 Lisp_Object Vbyte_code_meter;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 int byte_metering_on;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 # define METER_2(code1,code2) \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 XFASTINT (XVECTOR (XVECTOR (Vbyte_code_meter)->contents[(code1)]) \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 ->contents[(code2)])
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 # define METER_1(code) METER_2 (0,(code))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 # define METER_CODE(last_code, this_code) { \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 if (byte_metering_on) { \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 if (METER_1 (this_code) != ((1<<VALBITS)-1)) \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 METER_1 (this_code) ++; \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 if (last_code && \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 METER_2 (last_code,this_code) != ((1<<VALBITS)-1)) \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 METER_2 (last_code,this_code) ++; \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 } \
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 #else /* ! BYTE_CODE_METER */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 # define meter_code(last_code, this_code)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 Lisp_Object Qbytecode;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 /* Byte codes: */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 #define Bvarref 010
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 #define Bvarset 020
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 #define Bvarbind 030
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 #define Bcall 040
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 #define Bunbind 050
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 #define Bnth 070
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 #define Bsymbolp 071
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 #define Bconsp 072
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 #define Bstringp 073
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 #define Blistp 074
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 #define Beq 075
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 #define Bmemq 076
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 #define Bnot 077
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 #define Bcar 0100
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 #define Bcdr 0101
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 #define Bcons 0102
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 #define Blist1 0103
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 #define Blist2 0104
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 #define Blist3 0105
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 #define Blist4 0106
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 #define Blength 0107
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 #define Baref 0110
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 #define Baset 0111
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 #define Bsymbol_value 0112
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110 #define Bsymbol_function 0113 /* no longer generated as of v19 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 #define Bset 0114
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 #define Bfset 0115 /* no longer generated as of v19 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113 #define Bget 0116
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 #define Bsubstring 0117
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 #define Bconcat2 0120
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 #define Bconcat3 0121
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 #define Bconcat4 0122
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 #define Bsub1 0123
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 #define Badd1 0124
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 #define Beqlsign 0125
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 #define Bgtr 0126
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 #define Blss 0127
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 #define Bleq 0130
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 #define Bgeq 0131
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 #define Bdiff 0132
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 #define Bnegate 0133
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 #define Bplus 0134
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 #define Bmax 0135
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 #define Bmin 0136
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 #define Bmult 0137
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 #define Bpoint 0140
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 #define Bmark 0141 /* no longer generated as of v18 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 #define Bgoto_char 0142
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 #define Binsert 0143
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 #define Bpoint_max 0144
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 #define Bpoint_min 0145
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 #define Bchar_after 0146
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 #define Bfollowing_char 0147
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 #define Bpreceding_char 0150
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 #define Bcurrent_column 0151
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 #define Bindent_to 0152
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 #define Bscan_buffer 0153 /* No longer generated as of v18 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 #define Beolp 0154
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 #define Beobp 0155
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 #define Bbolp 0156
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 #define Bbobp 0157
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 #define Bcurrent_buffer 0160
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149 #define Bset_buffer 0161
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 #define Bread_char 0162
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 #define Bset_mark 0163 /* this loser is no longer generated as of v18 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 #define Binteractive_p 0164 /* Needed since interactive-p takes unevalled args */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 #define Bforward_char 0165
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 #define Bforward_word 0166
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 #define Bskip_chars_forward 0167
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 #define Bskip_chars_backward 0170
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 #define Bforward_line 0171
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159 #define Bchar_syntax 0172
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 #define Bbuffer_substring 0173
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 #define Bdelete_region 0174
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 #define Bnarrow_to_region 0175
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 #define Bwiden 0176
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 #define Bconstant2 0201
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166 #define Bgoto 0202
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 #define Bgotoifnil 0203
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 #define Bgotoifnonnil 0204
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169 #define Bgotoifnilelsepop 0205
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 #define Bgotoifnonnilelsepop 0206
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171 #define Breturn 0207
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
172 #define Bdiscard 0210
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173 #define Bdup 0211
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 #define Bsave_excursion 0212
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 #define Bsave_window_excursion 0213
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177 #define Bsave_restriction 0214
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178 #define Bcatch 0215
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
179
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 #define Bunwind_protect 0216
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181 #define Bcondition_case 0217
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
182 #define Btemp_output_buffer_setup 0220
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
183 #define Btemp_output_buffer_show 0221
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
185 #define Bunbind_all 0222
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
186
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
187 #define Bstringeqlsign 0230
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 #define Bstringlss 0231
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 #define Bequal 0232
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190 #define Bnthcdr 0233
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191 #define Belt 0234
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 #define Bmember 0235
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193 #define Bassq 0236
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194 #define Bnreverse 0237
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195 #define Bsetcar 0240
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
196 #define Bsetcdr 0241
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
197 #define Bcar_safe 0242
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
198 #define Bcdr_safe 0243
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
199 #define Bnconc 0244
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
200 #define Bquo 0245
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201 #define Brem 0246
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 #define Bnumberp 0247
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 #define Bintegerp 0250
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205 #define Bconstant 0300
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
206 #define CONSTANTLIM 0100
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
207
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 /* Fetch the next byte from the bytecode stream */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
210 #define FETCH *pc++
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 /* Fetch two bytes from the bytecode stream
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 and make a 16-bit number out of them */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215 #define FETCH2 (op = FETCH, op + (FETCH << 8))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
216
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
217 /* Push x onto the execution stack. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
218
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219 /* This used to be #define PUSH(x) (*++stackp = (x))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
220 This oddity is necessary because Alliant can't be bothered to
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
221 compile the preincrement operator properly, as of 4/91. -JimB */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222 #define PUSH(x) (stackp++, *stackp = (x))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
223
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
224 /* Pop a value off the execution stack. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
225
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226 #define POP (*stackp--)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 /* Discard n values from the execution stack. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
229
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230 #define DISCARD(n) (stackp -= (n))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
232 /* Get the value which is at the top of the execution stack, but don't pop it. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
233
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
234 #define TOP (*stackp)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236 DEFUN ("byte-code", Fbyte_code, Sbyte_code, 3, 3, 0,
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237 "Function used internally in byte-compiled code.\n\
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 The first argument is a string of byte code; the second, a vector of constants;\n\
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
239 the third, the maximum stack depth used in this function.\n\
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
240 If the third argument is incorrect, Emacs may crash.")
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
241 (bytestr, vector, maxdepth)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
242 Lisp_Object bytestr, vector, maxdepth;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
243 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
244 struct gcpro gcpro1, gcpro2, gcpro3;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
245 int count = specpdl_ptr - specpdl;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
246 #ifdef BYTE_CODE_METER
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247 int this_op = 0;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
248 int prev_op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
250 register int op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
251 unsigned char *pc;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
252 Lisp_Object *stack;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
253 register Lisp_Object *stackp;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
254 Lisp_Object *stacke;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
255 register Lisp_Object v1, v2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
256 register Lisp_Object *vectorp = XVECTOR (vector)->contents;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
257 #ifdef BYTE_CODE_SAFE
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 register int const_length = XVECTOR (vector)->size;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
259 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
260 /* Copy of BYTESTR, saved so we can tell if BYTESTR was relocated. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261 Lisp_Object string_saved;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 /* Cached address of beginning of string,
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263 valid if BYTESTR equals STRING_SAVED. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
264 register unsigned char *strbeg;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266 CHECK_STRING (bytestr, 0);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 if (XTYPE (vector) != Lisp_Vector)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
268 vector = wrong_type_argument (Qvectorp, vector);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
269 CHECK_NUMBER (maxdepth, 2);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271 stackp = (Lisp_Object *) alloca (XFASTINT (maxdepth) * sizeof (Lisp_Object));
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272 bzero (stackp, XFASTINT (maxdepth) * sizeof (Lisp_Object));
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
273 GCPRO3 (bytestr, vector, *stackp);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
274 gcpro3.nvars = XFASTINT (maxdepth);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
275
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276 --stackp;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
277 stack = stackp;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
278 stacke = stackp + XFASTINT (maxdepth);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
279
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
280 /* Initialize the saved pc-pointer for fetching from the string. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
281 string_saved = bytestr;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282 pc = XSTRING (string_saved)->data;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
284 while (1)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
285 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
286 #ifdef BYTE_CODE_SAFE
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
287 if (stackp > stacke)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
288 error (
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289 "Stack overflow in byte code (byte compiler bug), pc = %d, depth = %d",
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
290 pc - XSTRING (string_saved)->data, stacke - stackp);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
291 if (stackp < stack)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
292 error ("Stack underflow in byte code (byte compiler bug), pc = %d",
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
293 pc - XSTRING (string_saved)->data);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
294 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
295
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
296 if (string_saved != bytestr)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
297 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
298 pc = pc - XSTRING (string_saved)->data + XSTRING (bytestr)->data;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
299 string_saved = bytestr;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
300 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
301
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
302 #ifdef BYTE_CODE_METER
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
303 prev_op = this_op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
304 this_op = op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
305 METER_CODE (prev_op, op);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
306 switch (op)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 #else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308 switch (op = FETCH)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
310 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
311 case Bvarref+6:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
312 op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 goto varref;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
314
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
315 case Bvarref+7:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 goto varref;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
318
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
319 case Bvarref: case Bvarref+1: case Bvarref+2: case Bvarref+3:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
320 case Bvarref+4: case Bvarref+5:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
321 op = op - Bvarref;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
322 varref:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
323 v1 = vectorp[op];
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
324 if (XTYPE (v1) != Lisp_Symbol)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
325 v2 = Fsymbol_value (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
326 else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
327 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
328 v2 = XSYMBOL (v1)->value;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
329 #ifdef SWITCH_ENUM_BUG
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
330 switch ((int) XTYPE (v2))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
331 #else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
332 switch (XTYPE (v2))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
333 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
334 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335 case Lisp_Symbol:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
336 if (!EQ (v2, Qunbound))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
337 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
338 case Lisp_Intfwd:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
339 case Lisp_Boolfwd:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340 case Lisp_Objfwd:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
341 case Lisp_Buffer_Local_Value:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
342 case Lisp_Some_Buffer_Local_Value:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
343 case Lisp_Buffer_Objfwd:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
344 case Lisp_Void:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
345 v2 = Fsymbol_value (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
346 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
347 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348 PUSH (v2);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
349 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
350
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
351 case Bvarset+6:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
352 op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
353 goto varset;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
355 case Bvarset+7:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
356 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
357 goto varset;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359 case Bvarset: case Bvarset+1: case Bvarset+2: case Bvarset+3:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
360 case Bvarset+4: case Bvarset+5:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
361 op -= Bvarset;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
362 varset:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
363 Fset (vectorp[op], POP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
365
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
366 case Bvarbind+6:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
367 op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
368 goto varbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
369
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
370 case Bvarbind+7:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
371 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
372 goto varbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
373
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
374 case Bvarbind: case Bvarbind+1: case Bvarbind+2: case Bvarbind+3:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
375 case Bvarbind+4: case Bvarbind+5:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
376 op -= Bvarbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
377 varbind:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
378 specbind (vectorp[op], POP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
379 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
380
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
381 case Bcall+6:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
382 op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
383 goto docall;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
384
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
385 case Bcall+7:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
386 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
387 goto docall;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
388
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
389 case Bcall: case Bcall+1: case Bcall+2: case Bcall+3:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
390 case Bcall+4: case Bcall+5:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
391 op -= Bcall;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
392 docall:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
393 DISCARD(op);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
394 TOP = Ffuncall (op + 1, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
395 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
396
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
397 case Bunbind+6:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
398 op = FETCH;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
399 goto dounbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
400
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
401 case Bunbind+7:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
402 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
403 goto dounbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
404
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
405 case Bunbind: case Bunbind+1: case Bunbind+2: case Bunbind+3:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
406 case Bunbind+4: case Bunbind+5:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
407 op -= Bunbind;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
408 dounbind:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
409 unbind_to (specpdl_ptr - specpdl - op, Qnil);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
410 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
411
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
412 case Bunbind_all:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
413 /* To unbind back to the beginning of this frame. Not used yet,
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
414 but wil be needed for tail-recursion elimination.
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
415 */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
416 unbind_to (count, Qnil);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
417 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
418
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
419 case Bgoto:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
420 QUIT;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
421 op = FETCH2; /* pc = FETCH2 loses since FETCH2 contains pc++ */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
422 pc = XSTRING (string_saved)->data + op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
423 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
424
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
425 case Bgotoifnil:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
426 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
427 if (NULL (POP))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
428 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
429 QUIT;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
430 pc = XSTRING (string_saved)->data + op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
431 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
432 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
433
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
434 case Bgotoifnonnil:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
435 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
436 if (!NULL (POP))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
437 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
438 QUIT;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
439 pc = XSTRING (string_saved)->data + op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
440 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
441 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
442
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
443 case Bgotoifnilelsepop:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
444 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
445 if (NULL (TOP))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
446 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
447 QUIT;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
448 pc = XSTRING (string_saved)->data + op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
449 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
450 else DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
451 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
452
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
453 case Bgotoifnonnilelsepop:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
454 op = FETCH2;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
455 if (!NULL (TOP))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
456 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
457 QUIT;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
458 pc = XSTRING (string_saved)->data + op;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
459 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
460 else DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
461 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
462
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
463 case Breturn:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
464 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
465 goto exit;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
466
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
467 case Bdiscard:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
468 DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
469 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
470
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
471 case Bdup:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
472 v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
473 PUSH (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
474 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
475
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
476 case Bconstant2:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
477 PUSH (vectorp[FETCH2]);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
478 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
479
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
480 case Bsave_excursion:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
481 record_unwind_protect (save_excursion_restore, save_excursion_save ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
482 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
483
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
484 case Bsave_window_excursion:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
485 TOP = Fsave_window_excursion (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
486 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
487
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
488 case Bsave_restriction:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
489 record_unwind_protect (save_restriction_restore, save_restriction_save ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
490 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
491
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
492 case Bcatch:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
493 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
494 TOP = internal_catch (TOP, Feval, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
495 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
496
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
497 case Bunwind_protect:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
498 record_unwind_protect (0, POP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
499 (specpdl_ptr - 1)->symbol = Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
500 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
501
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
502 case Bcondition_case:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
503 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
504 v1 = Fcons (POP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
505 TOP = Fcondition_case (Fcons (TOP, v1));
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
506 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
507
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
508 case Btemp_output_buffer_setup:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
509 temp_output_buffer_setup (XSTRING (TOP)->data);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
510 TOP = Vstandard_output;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
511 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
512
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
513 case Btemp_output_buffer_show:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
514 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
515 temp_output_buffer_show (TOP, Qnil);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
516 TOP = v1;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
517 /* pop binding of standard-output */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
518 unbind_to (specpdl_ptr - specpdl - 1, Qnil);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
519 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
520
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
521 case Bnth:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
522 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
523 v2 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
524 nth_entry:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
525 CHECK_NUMBER (v2, 0);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
526 op = XINT (v2);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
527 immediate_quit = 1;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
528 while (--op >= 0)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
529 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
530 if (CONSP (v1))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
531 v1 = XCONS (v1)->cdr;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
532 else if (!NULL (v1))
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
533 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
534 immediate_quit = 0;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
535 v1 = wrong_type_argument (Qlistp, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
536 immediate_quit = 1;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
537 op++;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
538 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
539 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
540 immediate_quit = 0;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
541 goto docar;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
542
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
543 case Bsymbolp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
544 TOP = XTYPE (TOP) == Lisp_Symbol ? Qt : Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
545 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
546
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
547 case Bconsp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
548 TOP = CONSP (TOP) ? Qt : Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
549 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
550
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
551 case Bstringp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
552 TOP = XTYPE (TOP) == Lisp_String ? Qt : Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
553 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
554
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
555 case Blistp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
556 TOP = CONSP (TOP) || NULL (TOP) ? Qt : Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
557 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
558
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
559 case Beq:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
560 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
561 TOP = EQ (v1, TOP) ? Qt : Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
562 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
563
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
564 case Bmemq:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
565 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
566 TOP = Fmemq (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
567 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
568
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
569 case Bnot:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
570 TOP = NULL (TOP) ? Qt : Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
571 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
572
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
573 case Bcar:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
574 v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
575 docar:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
576 if (CONSP (v1)) TOP = XCONS (v1)->car;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
577 else if (NULL (v1)) TOP = Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
578 else Fcar (wrong_type_argument (Qlistp, v1));
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
579 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
580
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
581 case Bcdr:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
582 v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
583 if (CONSP (v1)) TOP = XCONS (v1)->cdr;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
584 else if (NULL (v1)) TOP = Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
585 else Fcdr (wrong_type_argument (Qlistp, v1));
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
586 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
587
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
588 case Bcons:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
589 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
590 TOP = Fcons (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
591 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
592
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
593 case Blist1:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
594 TOP = Fcons (TOP, Qnil);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
595 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
596
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
597 case Blist2:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
598 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
599 TOP = Fcons (TOP, Fcons (v1, Qnil));
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
600 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
601
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
602 case Blist3:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
603 DISCARD(2);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
604 TOP = Flist (3, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
605 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
606
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
607 case Blist4:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
608 DISCARD(3);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
609 TOP = Flist (4, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
610 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
611
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
612 case Blength:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
613 TOP = Flength (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
614 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
615
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
616 case Baref:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
617 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
618 TOP = Faref (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
619 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
620
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
621 case Baset:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
622 v2 = POP; v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
623 TOP = Faset (TOP, v1, v2);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
624 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
625
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
626 case Bsymbol_value:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
627 TOP = Fsymbol_value (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
628 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
629
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
630 case Bsymbol_function:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
631 TOP = Fsymbol_function (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
632 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
633
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
634 case Bset:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
635 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
636 TOP = Fset (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
637 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
638
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
639 case Bfset:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
640 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
641 TOP = Ffset (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
642 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
643
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
644 case Bget:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
645 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
646 TOP = Fget (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
647 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
648
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
649 case Bsubstring:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
650 v2 = POP; v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
651 TOP = Fsubstring (TOP, v1, v2);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
652 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
653
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
654 case Bconcat2:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
655 DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
656 TOP = Fconcat (2, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
657 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
658
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
659 case Bconcat3:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
660 DISCARD(2);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
661 TOP = Fconcat (3, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
662 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
663
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
664 case Bconcat4:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
665 DISCARD(3);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
666 TOP = Fconcat (4, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
667 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
668
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
669 case Bsub1:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
670 v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
671 if (XTYPE (v1) == Lisp_Int)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
672 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
673 XSETINT (v1, XINT (v1) - 1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
674 TOP = v1;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
675 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
676 else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
677 TOP = Fsub1 (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
678 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
679
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
680 case Badd1:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
681 v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
682 if (XTYPE (v1) == Lisp_Int)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
683 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
684 XSETINT (v1, XINT (v1) + 1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
685 TOP = v1;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
686 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
687 else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
688 TOP = Fadd1 (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
689 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
690
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
691 case Beqlsign:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
692 v2 = POP; v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
693 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v1, 0);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
694 CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (v2, 0);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
695 TOP = (XFLOATINT (v1) == XFLOATINT (v2)) ? Qt : Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
696 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
697
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
698 case Bgtr:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
699 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
700 TOP = Fgtr (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
701 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
702
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
703 case Blss:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
704 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
705 TOP = Flss (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
706 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
707
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
708 case Bleq:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
709 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
710 TOP = Fleq (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
711 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
712
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
713 case Bgeq:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
714 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
715 TOP = Fgeq (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
716 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
717
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
718 case Bdiff:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
719 DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
720 TOP = Fminus (2, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
721 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
722
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
723 case Bnegate:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
724 v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
725 if (XTYPE (v1) == Lisp_Int)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
726 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
727 XSETINT (v1, - XINT (v1));
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
728 TOP = v1;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
729 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
730 else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
731 TOP = Fminus (1, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
732 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
733
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
734 case Bplus:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
735 DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
736 TOP = Fplus (2, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
737 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
738
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
739 case Bmax:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
740 DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
741 TOP = Fmax (2, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
742 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
743
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
744 case Bmin:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
745 DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
746 TOP = Fmin (2, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
747 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
748
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
749 case Bmult:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
750 DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
751 TOP = Ftimes (2, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
752 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
753
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
754 case Bquo:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
755 DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
756 TOP = Fquo (2, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
757 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
758
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
759 case Brem:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
760 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
761 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
762 TOP = Frem (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
763 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
764
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
765 case Bpoint:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
766 XFASTINT (v1) = point;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
767 PUSH (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
768 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
769
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
770 case Bgoto_char:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
771 TOP = Fgoto_char (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
772 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
773
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
774 case Binsert:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
775 TOP = Finsert (1, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
776 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
777
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
778 case Bpoint_max:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
779 XFASTINT (v1) = ZV;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
780 PUSH (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
781 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
782
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
783 case Bpoint_min:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
784 XFASTINT (v1) = BEGV;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
785 PUSH (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
786 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
787
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
788 case Bchar_after:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
789 TOP = Fchar_after (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
790 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
791
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
792 case Bfollowing_char:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
793 XFASTINT (v1) = PT == ZV ? 0 : FETCH_CHAR (point);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
794 PUSH (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
795 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
796
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
797 case Bpreceding_char:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
798 XFASTINT (v1) = point <= BEGV ? 0 : FETCH_CHAR (point - 1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
799 PUSH (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
800 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
801
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
802 case Bcurrent_column:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
803 XFASTINT (v1) = current_column ();
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
804 PUSH (v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
805 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
806
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
807 case Bindent_to:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
808 TOP = Findent_to (TOP, Qnil);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
809 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
810
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
811 case Beolp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
812 PUSH (Feolp ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
813 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
814
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
815 case Beobp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
816 PUSH (Feobp ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
817 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
818
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
819 case Bbolp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
820 PUSH (Fbolp ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
821 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
822
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
823 case Bbobp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
824 PUSH (Fbobp ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
825 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
826
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
827 case Bcurrent_buffer:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
828 PUSH (Fcurrent_buffer ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
829 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
830
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
831 case Bset_buffer:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
832 TOP = Fset_buffer (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
833 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
834
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
835 case Bread_char:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
836 PUSH (Fread_char ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
837 QUIT;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
838 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
839
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
840 case Binteractive_p:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
841 PUSH (Finteractive_p ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
842 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
843
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
844 case Bforward_char:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
845 /* This was wrong! --jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
846 TOP = Fforward_char (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
847 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
848
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
849 case Bforward_word:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
850 /* This was wrong! --jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
851 TOP = Fforward_word (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
852 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
853
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
854 case Bskip_chars_forward:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
855 /* This was wrong! --jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
856 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
857 TOP = Fskip_chars_forward (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
858 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
859
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
860 case Bskip_chars_backward:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
861 /* This was wrong! --jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
862 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
863 TOP = Fskip_chars_backward (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
864 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
865
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
866 case Bforward_line:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
867 /* This was wrong! --jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
868 TOP = Fforward_line (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
869 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
870
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
871 case Bchar_syntax:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
872 CHECK_NUMBER (TOP, 0);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
873 XFASTINT (TOP) = syntax_code_spec[(int) SYNTAX (0xFF & XINT (TOP))];
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
874 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
875
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
876 case Bbuffer_substring:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
877 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
878 TOP = Fbuffer_substring (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
879 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
880
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
881 case Bdelete_region:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
882 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
883 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
884 TOP = Fdelete_region (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
885 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
886
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
887 case Bnarrow_to_region:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
888 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
889 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
890 TOP = Fnarrow_to_region (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
891 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
892
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
893 case Bwiden:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
894 PUSH (Fwiden ());
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
895 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
896
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
897 case Bstringeqlsign:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
898 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
899 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
900 TOP = Fstring_equal (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
901 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
902
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
903 case Bstringlss:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
904 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
905 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
906 TOP = Fstring_lessp (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
907 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
908
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
909 case Bequal:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
910 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
911 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
912 TOP = Fequal (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
913 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
914
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
915 case Bnthcdr:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
916 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
917 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
918 TOP = Fnthcdr (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
919 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
920
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
921 case Belt:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
922 if (XTYPE (TOP) == Lisp_Cons)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
923 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
924 /* Exchange args and then do nth. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
925 v2 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
926 v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
927 goto nth_entry;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
928 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
929 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
930 TOP = Felt (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
931 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
932
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
933 case Bmember:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
934 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
935 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
936 TOP = Fmember (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
937 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
938
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
939 case Bassq:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
940 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
941 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
942 TOP = Fassq (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
943 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
944
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
945 case Bnreverse:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
946 TOP = Fnreverse (TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
947 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
948
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
949 case Bsetcar:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
950 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
951 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
952 TOP = Fsetcar (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
953 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
954
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
955 case Bsetcdr:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
956 v1 = POP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
957 /* This had args in the wrong order. -- jwz */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
958 TOP = Fsetcdr (TOP, v1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
959 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
960
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
961 case Bcar_safe:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
962 v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
963 if (XTYPE (v1) == Lisp_Cons)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
964 TOP = XCONS (v1)->car;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
965 else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
966 TOP = Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
967 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
968
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
969 case Bcdr_safe:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
970 v1 = TOP;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
971 if (XTYPE (v1) == Lisp_Cons)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
972 TOP = XCONS (v1)->cdr;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
973 else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
974 TOP = Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
975 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
976
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
977 case Bnconc:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
978 DISCARD(1);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
979 TOP = Fnconc (2, &TOP);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
980 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
981
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
982 case Bnumberp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
983 TOP = (XTYPE (TOP) == Lisp_Int || XTYPE (TOP) == Lisp_Float
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
984 ? Qt : Qnil);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
985 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
986
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
987 case Bintegerp:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
988 TOP = XTYPE (TOP) == Lisp_Int ? Qt : Qnil;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
989 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
990
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
991 #ifdef BYTE_CODE_SAFE
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
992 case Bset_mark:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
993 error ("set-mark is an obsolete bytecode");
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
994 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
995 case Bscan_buffer:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
996 error ("scan-buffer is an obsolete bytecode");
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
997 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
998 case Bmark:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
999 error("mark is an obsolete bytecode");
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1000 break;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1001 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1002
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1003 default:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1004 #ifdef BYTE_CODE_SAFE
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1005 if (op < Bconstant)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1006 error ("unknown bytecode %d (byte compiler bug)", op);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1007 if ((op -= Bconstant) >= const_length)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1008 error ("no constant number %d (byte compiler bug)", op);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1009 PUSH (vectorp[op]);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1010 #else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1011 PUSH (vectorp[op - Bconstant]);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1012 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1013 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1014 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1015
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1016 exit:
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1017 UNGCPRO;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1018 /* Binds and unbinds are supposed to be compiled balanced. */
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1019 if (specpdl_ptr - specpdl != count)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1020 #ifdef BYTE_CODE_SAFE
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1021 error ("binding stack not balanced (serious byte compiler bug)");
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1022 #else
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1023 abort ();
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1024 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1025 return v1;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1026 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1027
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1028 syms_of_bytecode ()
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1029 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1030 Qbytecode = intern ("byte-code");
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1031 staticpro (&Qbytecode);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1032
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1033 defsubr (&Sbyte_code);
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1034
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1035 #ifdef BYTE_CODE_METER
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1036
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1037 DEFVAR_LISP ("byte-code-meter", &Vbyte_code_meter,
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1038 "a vector of vectors which holds a histogram of byte-code usage.");
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1039 DEFVAR_BOOL ("byte-metering-on", &byte_metering_on, "");
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1040
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1041 byte_metering_on = 0;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1042 Vbyte_code_meter = Fmake_vector(make_number(256), make_number(0));
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1043
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1044 {
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1045 int i = 256;
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1046 while (i--)
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1047 XVECTOR(Vbyte_code_meter)->contents[i] =
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1048 Fmake_vector(make_number(256), make_number(0));
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1049 }
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1050 #endif
88bee8093f43 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1051 }