Commit | Line | Data |
---|---|---|
0f2d19dd JB |
1 | /* classes: h_files */ |
2 | ||
3 | #ifndef TAGSH | |
4 | #define TAGSH | |
b7f3516f | 5 | /* Copyright (C) 1995,1996, 1997 Free Software Foundation, Inc. |
8ce94504 | 6 | * |
0f2d19dd JB |
7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation; either version 2, or (at your option) | |
10 | * any later version. | |
8ce94504 | 11 | * |
0f2d19dd JB |
12 | * This program is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
8ce94504 | 16 | * |
0f2d19dd JB |
17 | * You should have received a copy of the GNU General Public License |
18 | * along with this software; see the file COPYING. If not, write to | |
82892bed JB |
19 | * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
20 | * Boston, MA 02111-1307 USA | |
0f2d19dd JB |
21 | * |
22 | * As a special exception, the Free Software Foundation gives permission | |
23 | * for additional uses of the text contained in its release of GUILE. | |
24 | * | |
25 | * The exception is that, if you link the GUILE library with other files | |
26 | * to produce an executable, this does not by itself cause the | |
27 | * resulting executable to be covered by the GNU General Public License. | |
28 | * Your use of that executable is in no way restricted on account of | |
29 | * linking the GUILE library code into it. | |
30 | * | |
31 | * This exception does not however invalidate any other reasons why | |
32 | * the executable file might be covered by the GNU General Public License. | |
33 | * | |
34 | * This exception applies only to the code released by the | |
35 | * Free Software Foundation under the name GUILE. If you copy | |
36 | * code from other Free Software Foundation releases into a copy of | |
37 | * GUILE, as the General Public License permits, the exception does | |
38 | * not apply to the code that you add in this way. To avoid misleading | |
39 | * anyone as to the status of such modified files, you must delete | |
40 | * this exception notice from them. | |
41 | * | |
42 | * If you write modifications of your own for GUILE, it is your choice | |
43 | * whether to permit this exception to apply to your modifications. | |
82892bed | 44 | * If you do not wish that, delete this exception notice. */ |
0f2d19dd JB |
45 | \f |
46 | ||
8ce94504 | 47 | /** This file defines the format of SCM values and cons pairs. |
0f2d19dd JB |
48 | ** It is here that tag bits are assigned for various purposes. |
49 | **/ | |
50 | ||
51 | \f | |
52 | ||
53 | /* In the beginning was the Word: | |
54 | */ | |
55 | typedef long SCM; | |
56 | ||
57 | ||
58 | ||
59 | /* Cray machines have pointers that are incremented once for each word, | |
60 | * rather than each byte, the 3 most significant bits encode the byte | |
61 | * within the word. The following macros deal with this by storing the | |
62 | * native Cray pointers like the ones that looks like scm expects. This | |
63 | * is done for any pointers that might appear in the car of a scm_cell, pointers | |
64 | * to scm_vector elts, functions, &c are not munged. | |
65 | */ | |
66 | #ifdef _UNICOS | |
67 | # define SCM2PTR(x) ((int)(x) >> 3) | |
68 | # define PTR2SCM(x) (((SCM)(x)) << 3) | |
69 | # define SCM_POINTERS_MUNGED | |
70 | #else | |
71 | # define SCM2PTR(x) (x) | |
72 | # define PTR2SCM(x) ((SCM)(x)) | |
73 | #endif /* def _UNICOS */ | |
74 | ||
75 | \f | |
76 | /* SCM variables can contain: | |
77 | * | |
78 | * Non-objects -- meaning that the tag-related macros don't apply to them | |
79 | * in the usual way. | |
80 | * | |
81 | * Immediates -- meaning that the variable contains an entire Scheme object. | |
82 | * | |
3c205827 JB |
83 | * Non-immediates -- meaning that the variable holds a (possibly |
84 | * tagged) pointer into the cons pair heap. | |
85 | * | |
86 | * Non-objects are distinguished from other values by careful coding | |
87 | * only (i.e., programmers must keep track of any SCM variables they | |
88 | * create that don't contain ordinary scheme values). | |
89 | * | |
90 | * All immediates and non-immediates must have a 0 in bit 0. Only | |
91 | * non-object values can have a 1 in bit 0. In some cases, bit 0 of a | |
92 | * word in the heap is used for the GC tag so during garbage | |
93 | * collection, that bit might be 1 even in an immediate or | |
94 | * non-immediate value. In other cases, bit 0 of a word in the heap | |
95 | * is used to tag a pointer to a GLOC (VM global variable address) or | |
96 | * the header of a struct. But whenever an SCM variable holds a | |
97 | * normal Scheme value, bit 0 is 0. | |
0f2d19dd JB |
98 | * |
99 | * Immediates and non-immediates are distinguished by bits two and four. | |
100 | * Immediate values must have a 1 in at least one of those bits. Does | |
c6c790ed | 101 | * this (or any other detail of tagging) seem arbitrary? Try changing it! |
0f2d19dd | 102 | * (Not always impossible but it is fair to say that many details of tags |
3c205827 | 103 | * are mutually dependent). */ |
0f2d19dd JB |
104 | |
105 | #define SCM_IMP(x) (6 & (int)(x)) | |
106 | #define SCM_NIMP(x) (!SCM_IMP(x)) | |
107 | ||
108 | /* Here is a summary of tagging in SCM values as they might occur in | |
8ce94504 | 109 | * SCM variables or in the heap. |
0f2d19dd JB |
110 | * |
111 | * low bits meaning | |
112 | * | |
8ce94504 | 113 | * |
0f2d19dd JB |
114 | * 0 Most objects except... |
115 | * 1 ...glocs and structs (this tag valid only in a SCM_CAR or | |
116 | * in the header of a struct's data). | |
117 | * | |
118 | * 00 heap addresses and many immediates (not integers) | |
119 | * 01 glocs/structs, some tc7_ codes | |
120 | * 10 immediate integers | |
121 | * 11 various tc7_ codes including, tc16_ codes. | |
122 | * | |
123 | * | |
124 | * 000 heap address | |
125 | * 001 glocs/structs | |
126 | * 010 integer | |
127 | * 011 closure | |
128 | * 100 immediates | |
129 | * 101 tc7_ | |
130 | * 110 integer | |
131 | * 111 tc7_ | |
132 | * | |
133 | * | |
134 | * 100 --- IMMEDIATES | |
135 | * | |
136 | * Looking at the seven final bits of an immediate: | |
8ce94504 | 137 | * |
0f2d19dd JB |
138 | * 0000-100 short instruction |
139 | * 0001-100 short instruction | |
140 | * 0010-100 short instruction | |
141 | * 0011-100 short instruction | |
142 | * 0100-100 short instruction | |
143 | * 0101-100 short instruction | |
144 | * 0110-100 various immediates and long instructions | |
145 | * 0111-100 short instruction | |
146 | * 1000-100 short instruction | |
147 | * 1001-100 short instruction | |
148 | * 1010-100 short instruction | |
149 | * 1011-100 short instruction | |
150 | * 1100-100 short instruction | |
151 | * 1101-100 short instruction | |
152 | * 1110-100 immediate characters | |
153 | * 1111-100 ilocs | |
154 | * | |
8ce94504 | 155 | * Some of the 0110100 immediates are long instructions (they dispatch |
0f2d19dd JB |
156 | * in two steps compared to one step for a short instruction). |
157 | * The two steps are, (1) dispatch on 7 bits to the long instruction | |
158 | * handler, (2) dispatch on 7 additional bits. | |
159 | * | |
160 | * One way to think of it is that there are 128 short instructions, | |
161 | * with the 13 immediates above being some of the most interesting. | |
162 | * | |
163 | * Also noteworthy are the groups of 16 7-bit instructions implied by | |
164 | * some of the 3-bit tags. For example, closure references consist | |
165 | * of an 8-bit aligned address tagged with 011. There are 16 identical 7-bit | |
166 | * instructions, all ending 011, which are invoked by evaluating closures. | |
167 | * | |
168 | * In other words, if you hand the evaluator a closure, the evaluator | |
169 | * treats the closure as a graph of virtual machine instructions. | |
170 | * A closure is a pair with a pointer to the body of the procedure | |
171 | * in the CDR and a pointer to the environment of the closure in the CAR. | |
172 | * The environment pointer is tagged 011 which implies that the least | |
173 | * significant 7 bits of the environment pointer also happen to be | |
174 | * a virtual machine instruction we could call "SELF" (for self-evaluating | |
175 | * object). | |
176 | * | |
177 | * A less trivial example are the 16 instructions ending 000. If those | |
178 | * bits tag the CAR of a pair, then evidently the pair is an ordinary | |
179 | * cons pair and should be evaluated as a procedure application. The sixteen, | |
180 | * 7-bit 000 instructions are all "NORMAL-APPLY" (Things get trickier. | |
181 | * For example, if the CAR of a procedure application is a symbol, the NORMAL-APPLY | |
182 | * instruction will, as a side effect, overwrite that CAR with a new instruction | |
183 | * that contains a cached address for the variable named by the symbol.) | |
184 | * | |
185 | * Here is a summary of tags in the CAR of a non-immediate: | |
186 | * | |
187 | * HEAP CELL: G=gc_mark; 1 during mark, 0 other times. | |
188 | * | |
189 | * cons ..........SCM car..............0 ...........SCM cdr.............G | |
190 | * gloc ..........SCM vcell..........001 ...........SCM cdr.............G | |
191 | * struct ..........void * type........001 ...........void * data.........G | |
192 | * closure ..........SCM code...........011 ...........SCM env.............G | |
193 | * tc7 .........long length....GxxxD1S1 ..........void *data............ | |
194 | * | |
195 | * | |
196 | * | |
197 | * 101 & 111 --- tc7_ types | |
198 | * | |
8ce94504 JB |
199 | * tc7_tags are 7 bit tags ending in 1x1. These tags |
200 | * occur only in the CAR of heap cells, and have the | |
201 | * handy property that all bits of the CAR above the | |
202 | * bottom eight can be used to store a length, thus | |
203 | * saving a word in the body itself. Thus, we use them | |
204 | * for strings, symbols, and vectors (among other | |
205 | * things). | |
0f2d19dd JB |
206 | * |
207 | * SCM_LENGTH returns the bits in "length" (see the diagram). | |
208 | * SCM_CHARS returns the data cast to "char *" | |
209 | * SCM_CDR returns the data cast to "SCM" | |
210 | * TYP7(X) returns bits 0...6 of SCM_CAR (X) | |
211 | * | |
212 | * For the interpretation of SCM_LENGTH and SCM_CHARS | |
213 | * that applies to a particular type, see the header file | |
214 | * for that type. | |
215 | * | |
8ce94504 JB |
216 | * Sometimes we choose the bottom seven bits carefully, |
217 | * so that the 4- and 1-valued bits (called the D and S | |
218 | * bits) can be masked off to reveal a common type. | |
219 | * | |
0f2d19dd | 220 | * TYP7S(X) returns TYP7, but masking out the option bit S. |
0f2d19dd | 221 | * |
8ce94504 JB |
222 | * For example, all strings have 001 in the 'xxx' bits in |
223 | * the diagram above, the D bit says whether it's a | |
b7f3516f | 224 | * substring. |
8ce94504 | 225 | * |
0f2d19dd | 226 | * for example: |
b7f3516f | 227 | * S |
8ce94504 | 228 | * scm_tc7_string = G0010101 |
527da704 | 229 | * scm_tc7_substring = G0010111 |
8ce94504 | 230 | * |
b7f3516f TT |
231 | * TYP7S turns all string tags into tc7_string; thus, |
232 | * testing TYP7S against tc7_string is a quick way to | |
8ce94504 | 233 | * test for any kind of string. |
0f2d19dd | 234 | * |
0f2d19dd JB |
235 | * Some TC7 types are subdivided into 256 subtypes giving |
236 | * rise to the macros: | |
237 | * | |
238 | * TYP16 | |
239 | * TYP16S | |
240 | * GCTYP16 | |
241 | * | |
242 | * TYP16S functions similarly wrt to TYP16 as TYP7S to TYP7, | |
243 | * but a different option bit is used (bit 2 for TYP7S, | |
244 | * bit 8 for TYP16S). | |
8ce94504 | 245 | * */ |
0f2d19dd JB |
246 | |
247 | ||
248 | ||
249 | \f | |
250 | /* {Non-immediate values.} | |
251 | * | |
252 | * If X is non-immediate, it is necessary to look at SCM_CAR (X) to | |
253 | * figure out Xs type. X may be a cons pair, in which case the | |
254 | * value SCM_CAR (x) will be either an immediate or non-immediate value. | |
255 | * X may be something other than a cons pair, in which case the value SCM_CAR (x) | |
8ce94504 | 256 | * will be a non-object value. |
0f2d19dd JB |
257 | * |
258 | * All immediates and non-immediates have a 0 in bit 0. We additionally preserve | |
259 | * the invariant that all non-object values stored in the SCM_CAR of a non-immediate | |
260 | * object have a 1 in bit 1: | |
261 | */ | |
262 | ||
263 | #define SCM_NCONSP(x) (1 & (int)SCM_CAR(x)) | |
264 | #define SCM_CONSP(x) (!SCM_NCONSP(x)) | |
265 | ||
266 | ||
ee4274a6 MD |
267 | /* SCM_ECONSP should be used instead of SCM_CONSP at places where GLOCS |
268 | * can be expected to occur. | |
0f2d19dd | 269 | */ |
b2530d66 MD |
270 | #define SCM_ECONSP(x) (SCM_CONSP (x) \ |
271 | || (SCM_TYP3(x) == 1 \ | |
272 | && SCM_CDR (SCM_CAR (x) - 1) != 0)) | |
273 | #define SCM_NECONSP(x) (SCM_NCONSP(x) \ | |
274 | && (SCM_TYP3(x) != 1 \ | |
275 | || SCM_CDR (SCM_CAR (x) - 1) == 0)) | |
0f2d19dd JB |
276 | |
277 | \f | |
278 | ||
279 | #define SCM_CELLP(x) (!SCM_NCELLP(x)) | |
280 | #define SCM_NCELLP(x) ((sizeof(scm_cell)-1) & (int)(x)) | |
281 | ||
8ce94504 | 282 | /* See numbers.h for macros relating to immediate integers. |
0f2d19dd JB |
283 | */ |
284 | ||
285 | #define SCM_ITAG3(x) (7 & (int)x) | |
286 | #define SCM_TYP3(x) (7 & (int)SCM_CAR(x)) | |
287 | #define scm_tc3_cons 0 | |
288 | #define scm_tc3_cons_gloc 1 | |
289 | #define scm_tc3_int_1 2 | |
290 | #define scm_tc3_closure 3 | |
291 | #define scm_tc3_imm24 4 | |
292 | #define scm_tc3_tc7_1 5 | |
293 | #define scm_tc3_int_2 6 | |
294 | #define scm_tc3_tc7_2 7 | |
295 | ||
296 | ||
297 | /* | |
298 | * Do not change the three bit tags. | |
299 | */ | |
300 | ||
301 | ||
302 | #define SCM_TYP7(x) (0x7f & (int)SCM_CAR(x)) | |
303 | #define SCM_TYP7S(x) (0x7d & (int)SCM_CAR(x)) | |
0f2d19dd JB |
304 | |
305 | ||
306 | #define SCM_TYP16(x) (0xffff & (int)SCM_CAR(x)) | |
307 | #define SCM_TYP16S(x) (0xfeff & (int)SCM_CAR(x)) | |
308 | #define SCM_GCTYP16(x) (0xff7f & (int)SCM_CAR(x)) | |
309 | ||
310 | ||
311 | ||
312 | /* Testing and Changing GC Marks in Various Standard Positions | |
313 | */ | |
314 | #define SCM_GCMARKP(x) (1 & (int)SCM_CDR(x)) | |
315 | #define SCM_GC8MARKP(x) (0x80 & (int)SCM_CAR(x)) | |
898a256f MD |
316 | #define SCM_SETGCMARK(x) SCM_SETOR_CDR (x,1) |
317 | #define SCM_CLRGCMARK(x) SCM_SETAND_CDR (x, ~1L) | |
318 | #define SCM_SETGC8MARK(x) SCM_SETOR_CAR (x, 0x80) | |
319 | #define SCM_CLRGC8MARK(x) SCM_SETAND_CAR (x, ~0x80L) | |
0f2d19dd JB |
320 | |
321 | ||
322 | \f | |
323 | ||
324 | /* couple */ | |
325 | #define scm_tc7_ssymbol 5 | |
326 | #define scm_tc7_msymbol 7 | |
327 | ||
328 | /* couple */ | |
329 | #define scm_tc7_vector 13 | |
330 | #define scm_tc7_wvect 15 | |
331 | ||
8a6d7c7c | 332 | /* couple */ |
0f2d19dd | 333 | #define scm_tc7_string 21 |
527da704 | 334 | #define scm_tc7_substring 23 |
0f2d19dd | 335 | |
8a6d7c7c MD |
336 | /* 29 and 31 are free! */ |
337 | ||
0f2d19dd JB |
338 | /* Many of the following should be turned |
339 | * into structs or smobs. We need back some | |
340 | * of these 7 bit tags! | |
341 | */ | |
342 | #define scm_tc7_uvect 37 | |
343 | #define scm_tc7_lvector 39 | |
344 | #define scm_tc7_fvect 45 | |
345 | #define scm_tc7_dvect 47 | |
346 | #define scm_tc7_cvect 53 | |
347 | #define scm_tc7_svect 55 | |
348 | #define scm_tc7_contin 61 | |
349 | #define scm_tc7_cclo 63 | |
350 | #define scm_tc7_rpsubr 69 | |
351 | #define scm_tc7_bvect 71 | |
352 | #define scm_tc7_byvect 77 | |
353 | #define scm_tc7_ivect 79 | |
354 | #define scm_tc7_subr_0 85 | |
355 | #define scm_tc7_subr_1 87 | |
356 | #define scm_tc7_cxr 93 | |
357 | #define scm_tc7_subr_3 95 | |
358 | #define scm_tc7_subr_2 101 | |
359 | #define scm_tc7_asubr 103 | |
360 | #define scm_tc7_subr_1o 109 | |
361 | #define scm_tc7_subr_2o 111 | |
362 | #define scm_tc7_lsubr_2 117 | |
363 | #define scm_tc7_lsubr 119 | |
364 | ||
365 | ||
366 | /* There are 256 port subtypes. Here are the first four. | |
367 | * These must agree with the init function in ports.c | |
368 | */ | |
369 | #define scm_tc7_port 125 | |
370 | ||
371 | /* fports and pipes form an intended TYP16S equivelancy | |
372 | * group (similar to a tc7 "couple". | |
373 | */ | |
374 | #define scm_tc16_fport (scm_tc7_port + 0*256L) | |
375 | #define scm_tc16_pipe (scm_tc7_port + 1*256L) | |
376 | ||
377 | #define scm_tc16_strport (scm_tc7_port + 2*256L) | |
378 | #define scm_tc16_sfport (scm_tc7_port + 3*256L) | |
379 | ||
380 | ||
381 | /* There are 256 smob subtypes. Here are the first four. | |
382 | */ | |
383 | ||
384 | #define scm_tc7_smob 127 /* DO NOT CHANGE [**] */ | |
385 | ||
386 | /* [**] If you change scm_tc7_smob, you must also change | |
387 | * the places it is hard coded in this file and possibly others. | |
388 | */ | |
389 | ||
390 | ||
391 | /* scm_tc_free_cell is also the 0th smob type. | |
392 | */ | |
393 | #define scm_tc_free_cell 127 | |
394 | ||
395 | /* The 1st smob type: | |
396 | */ | |
397 | #define scm_tc16_flo 0x017f | |
398 | #define scm_tc_flo 0x017fL | |
399 | ||
400 | /* Some option bits begeinning at bit 16 of scm_tc16_flo: | |
401 | */ | |
402 | #define SCM_REAL_PART (1L<<16) | |
403 | #define SCM_IMAG_PART (2L<<16) | |
404 | #define scm_tc_dblr (scm_tc16_flo|SCM_REAL_PART) | |
405 | #define scm_tc_dblc (scm_tc16_flo|SCM_REAL_PART|SCM_IMAG_PART) | |
406 | ||
407 | ||
8ce94504 | 408 | /* Smob types 2 and 3: |
0f2d19dd JB |
409 | */ |
410 | #define scm_tc16_bigpos 0x027f | |
411 | #define scm_tc16_bigneg 0x037f | |
412 | ||
413 | ||
414 | \f | |
8ce94504 | 415 | /* {Immediate Values} |
0f2d19dd JB |
416 | */ |
417 | ||
418 | enum scm_tags | |
419 | { | |
420 | scm_tc8_char = 0xf4, | |
4816f615 | 421 | scm_tc8_iloc = 0xfc |
0f2d19dd JB |
422 | }; |
423 | ||
424 | #define SCM_ITAG8(X) ((int)(X) & 0xff) | |
425 | #define SCM_MAKE_ITAG8(X, TAG) (((X)<<8) + TAG) | |
426 | #define SCM_ITAG8_DATA(X) ((X)>>8) | |
427 | ||
428 | ||
429 | \f | |
430 | /* Immediate Symbols, Special Symbols, Flags (various constants). | |
431 | */ | |
432 | ||
433 | /* SCM_ISYMP tests for ISPCSYM and ISYM */ | |
434 | #define SCM_ISYMP(n) ((0x187 & (int)(n))==4) | |
435 | ||
436 | /* SCM_IFLAGP tests for ISPCSYM, ISYM and IFLAG */ | |
437 | #define SCM_IFLAGP(n) ((0x87 & (int)(n))==4) | |
438 | #define SCM_ISYMNUM(n) ((int)((n)>>9)) | |
08b5b88c | 439 | #define SCM_ISYMCHARS(n) (scm_isymnames[SCM_ISYMNUM(n)]) |
0f2d19dd JB |
440 | #define SCM_MAKSPCSYM(n) (((n)<<9)+((n)<<3)+4L) |
441 | #define SCM_MAKISYM(n) (((n)<<9)+0x74L) | |
442 | #define SCM_MAKIFLAG(n) (((n)<<9)+0x174L) | |
443 | ||
8ce94504 | 444 | /* This table must agree with the declarations |
0f2d19dd JB |
445 | * in repl.c: {Names of immediate symbols}. |
446 | * | |
447 | * These are used only in eval but their values | |
448 | * have to be allocated here. | |
449 | * | |
450 | */ | |
451 | ||
452 | #define SCM_IM_AND SCM_MAKSPCSYM(0) | |
453 | #define SCM_IM_BEGIN SCM_MAKSPCSYM(1) | |
454 | #define SCM_IM_CASE SCM_MAKSPCSYM(2) | |
455 | #define SCM_IM_COND SCM_MAKSPCSYM(3) | |
456 | #define SCM_IM_DO SCM_MAKSPCSYM(4) | |
457 | #define SCM_IM_IF SCM_MAKSPCSYM(5) | |
458 | #define SCM_IM_LAMBDA SCM_MAKSPCSYM(6) | |
459 | #define SCM_IM_LET SCM_MAKSPCSYM(7) | |
460 | #define SCM_IM_LETSTAR SCM_MAKSPCSYM(8) | |
461 | #define SCM_IM_LETREC SCM_MAKSPCSYM(9) | |
462 | #define SCM_IM_OR SCM_MAKSPCSYM(10) | |
463 | #define SCM_IM_QUOTE SCM_MAKSPCSYM(11) | |
464 | #define SCM_IM_SET SCM_MAKSPCSYM(12) | |
465 | #define SCM_IM_DEFINE SCM_MAKSPCSYM(13) | |
466 | #define SCM_IM_APPLY SCM_MAKISYM(14) | |
467 | #define SCM_IM_CONT SCM_MAKISYM(15) | |
468 | #define SCM_BOOL_F SCM_MAKIFLAG(16) | |
469 | #define SCM_BOOL_T SCM_MAKIFLAG(17) | |
470 | #define SCM_UNDEFINED SCM_MAKIFLAG(18) | |
471 | #define SCM_EOF_VAL SCM_MAKIFLAG(19) | |
3c205827 | 472 | #define SCM_EOL SCM_MAKIFLAG(20) |
0f2d19dd JB |
473 | #define SCM_UNSPECIFIED SCM_MAKIFLAG(21) |
474 | ||
475 | ||
476 | #define SCM_UNBNDP(x) (SCM_UNDEFINED==(x)) | |
477 | ||
478 | \f | |
479 | ||
480 | /* Dispatching aids: | |
481 | */ | |
482 | ||
483 | ||
8ce94504 | 484 | /* For cons pairs with immediate values in the CAR |
0f2d19dd JB |
485 | */ |
486 | ||
487 | #define scm_tcs_cons_imcar 2:case 4:case 6:case 10:\ | |
488 | case 12:case 14:case 18:case 20:\ | |
489 | case 22:case 26:case 28:case 30:\ | |
490 | case 34:case 36:case 38:case 42:\ | |
491 | case 44:case 46:case 50:case 52:\ | |
492 | case 54:case 58:case 60:case 62:\ | |
493 | case 66:case 68:case 70:case 74:\ | |
494 | case 76:case 78:case 82:case 84:\ | |
495 | case 86:case 90:case 92:case 94:\ | |
496 | case 98:case 100:case 102:case 106:\ | |
497 | case 108:case 110:case 114:case 116:\ | |
498 | case 118:case 122:case 124:case 126 | |
499 | ||
500 | /* For cons pairs with non-immediate values in the SCM_CAR | |
501 | */ | |
502 | #define scm_tcs_cons_nimcar 0:case 8:case 16:case 24:\ | |
503 | case 32:case 40:case 48:case 56:\ | |
504 | case 64:case 72:case 80:case 88:\ | |
505 | case 96:case 104:case 112:case 120 | |
506 | ||
507 | /* A CONS_GLOC occurs in code. It's CAR is a pointer to the | |
508 | * CDR of a variable. The low order bits of the CAR are 001. | |
509 | * The CDR of the gloc is the code continuation. | |
510 | */ | |
511 | #define scm_tcs_cons_gloc 1:case 9:case 17:case 25:\ | |
512 | case 33:case 41:case 49:case 57:\ | |
513 | case 65:case 73:case 81:case 89:\ | |
514 | case 97:case 105:case 113:case 121 | |
515 | ||
516 | #define scm_tcs_closures 3:case 11:case 19:case 27:\ | |
517 | case 35:case 43:case 51:case 59:\ | |
518 | case 67:case 75:case 83:case 91:\ | |
519 | case 99:case 107:case 115:case 123 | |
520 | ||
521 | #define scm_tcs_subrs scm_tc7_asubr:case scm_tc7_subr_0:case scm_tc7_subr_1:case scm_tc7_cxr:\ | |
522 | case scm_tc7_subr_3:case scm_tc7_subr_2:case scm_tc7_rpsubr:case scm_tc7_subr_1o:\ | |
523 | case scm_tc7_subr_2o:case scm_tc7_lsubr_2:case scm_tc7_lsubr | |
524 | ||
525 | #define scm_tcs_symbols scm_tc7_ssymbol:case scm_tc7_msymbol | |
526 | ||
527 | #define scm_tcs_bignums scm_tc16_bigpos:case scm_tc16_bigneg | |
528 | ||
0f2d19dd | 529 | #endif /* TAGSH */ |