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