annotate src/bytecode.c @ 39433:65168fc5a6f5

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