annotate src/bytecode.c @ 17394:b793e8f5a9c2

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