annotate src/bytecode.c @ 90201:fbb2bea03df9

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