annotate src/bytecode.c @ 27796:1cd9f06b5f21

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