1 #define INLINE inline static
3 typedef unsigned char u8
;
4 typedef unsigned short u16
;
5 typedef unsigned int u32
;
6 typedef unsigned long long u64
;
7 typedef signed char s8
;
8 typedef signed short s16
;
9 typedef signed int s32
;
10 typedef signed long long s64
;
13 typedef long long F_FIXNUM
;
14 typedef unsigned long long CELL
;
16 typedef long F_FIXNUM
;
17 typedef unsigned long CELL
;
20 #define CELLS ((signed)sizeof(CELL))
22 #define WORD_SIZE (CELLS*8)
23 #define HALF_WORD_SIZE (CELLS*4)
24 #define HALF_WORD_MASK (((unsigned long)1<<HALF_WORD_SIZE)-1)
28 #define TAG(cell) ((CELL)(cell) & TAG_MASK)
29 #define UNTAG(cell) ((CELL)(cell) & ~TAG_MASK)
30 #define RETAG(cell,tag) (UNTAG(cell) | (tag))
39 #define COMPLEX_TYPE 6
41 /* Canonical F object */
45 #define HEADER_TYPE 7 /* anything less than or equal to this is a tag */
47 #define GC_COLLECTED 5 /* See gc.c */
49 /*** Header types ***/
51 #define WRAPPER_TYPE 9
52 #define BYTE_ARRAY_TYPE 10
53 #define CALLSTACK_TYPE 11
54 #define STRING_TYPE 12
56 #define QUOTATION_TYPE 14
62 INLINE
bool immediate_p(CELL obj
)
64 return (obj
== F
|| TAG(obj
) == FIXNUM_TYPE
);
67 INLINE F_FIXNUM
untag_fixnum_fast(CELL tagged
)
69 return ((F_FIXNUM
)tagged
) >> TAG_BITS
;
72 INLINE CELL
tag_fixnum(F_FIXNUM untagged
)
74 return RETAG(untagged
<< TAG_BITS
,FIXNUM_TYPE
);
77 INLINE
void *untag_object(CELL tagged
)
79 return (void *)UNTAG(tagged
);
84 /* Assembly code makes assumptions about the layout of this struct */
91 typedef F_ARRAY F_BYTE_ARRAY
;
93 /* Assembly code makes assumptions about the layout of this struct */
96 /* tagged num of chars */
104 /* The compiled code heap is structured into blocks. */
107 char type
; /* this is WORD_TYPE or QUOTATION_TYPE */
108 char last_scan
; /* the youngest generation in which this block's literals may live */
109 char needs_fixup
; /* is this a new block that needs full fixup? */
110 CELL code_length
; /* # bytes */
111 CELL literals
; /* # bytes */
112 CELL relocation
; /* tagged pointer to byte-array or f */
115 /* Assembly code makes assumptions about the layout of this struct */
119 /* TAGGED hashcode */
121 /* TAGGED word name */
123 /* TAGGED word vocabulary */
125 /* TAGGED definition */
127 /* TAGGED property assoc for library code */
129 /* TAGGED t or f, t means its compiled with the optimizing compiler,
130 f means its compiled with the non-optimizing compiler */
132 /* TAGGED call count for profiling */
134 /* TAGGED machine code for sub-primitive */
136 /* UNTAGGED execution token: jump here to execute word */
138 /* UNTAGGED compiled code block */
140 /* UNTAGGED profiler stub */
141 F_CODE_BLOCK
*profiling
;
144 /* Assembly code makes assumptions about the layout of this struct */
150 /* Assembly code makes assumptions about the layout of this struct */
157 /* Assembly code makes assumptions about the layout of this struct */
159 /* We use a union here to force the float value to be aligned on an
168 /* Assembly code makes assumptions about the layout of this struct */
177 /* UNTAGGED compiled code block */
181 /* Assembly code makes assumptions about the layout of this struct */
188 /* Assembly code makes assumptions about the layout of this struct */
201 /* tagged byte array holding a C string */
203 /* OS-specific handle */
216 /* Frame size in bytes */
220 /* These are really just arrays, but certain elements have special