factor/native/word.h

51 lines
1.3 KiB
C
Raw Normal View History

2004-07-16 02:26:21 -04:00
typedef void (*XT)(void);
typedef struct {
2004-07-27 23:29:37 -04:00
/* TAGGED header */
CELL header;
2004-08-29 04:03:16 -04:00
/* untagged hashcode */
CELL hashcode;
2004-07-27 23:29:37 -04:00
/* untagged execution token: jump here to execute word */
2004-07-16 02:26:21 -04:00
CELL xt;
2004-07-27 23:29:37 -04:00
/* untagged on-disk primitive number */
2004-07-16 02:26:21 -04:00
CELL primitive;
/* TAGGED parameter to xt; used for colon definitions */
CELL parameter;
/* TAGGED property list for library code */
CELL plist;
2004-08-23 01:13:09 -04:00
/* UNTAGGED call count incremented by profiler */
CELL call_count;
2004-08-29 03:20:19 -04:00
/* UNTAGGED amount of memory allocated in word */
CELL allot_count;
2004-07-16 02:26:21 -04:00
} WORD;
INLINE WORD* untag_word(CELL tagged)
{
type_check(WORD_TYPE,tagged);
return (WORD*)UNTAG(tagged);
}
INLINE CELL tag_word(WORD* word)
{
return RETAG(word,WORD_TYPE);
}
2004-08-05 15:18:31 -04:00
WORD* word(CELL primitive, CELL parameter, CELL plist);
2004-07-16 02:26:21 -04:00
void update_xt(WORD* word);
void primitive_word(void);
2004-08-29 04:03:16 -04:00
void primitive_word_hashcode(void);
2004-07-16 02:26:21 -04:00
void primitive_word_primitive(void);
void primitive_set_word_primitive(void);
2004-09-06 02:32:04 -04:00
void primitive_word_xt(void);
void primitive_set_word_xt(void);
2004-07-16 02:26:21 -04:00
void primitive_word_parameter(void);
void primitive_set_word_parameter(void);
void primitive_word_plist(void);
void primitive_set_word_plist(void);
2004-08-23 01:13:09 -04:00
void primitive_word_call_count(void);
void primitive_set_word_call_count(void);
2004-08-29 03:20:19 -04:00
void primitive_word_allot_count(void);
void primitive_set_word_allot_count(void);
2004-08-23 01:13:09 -04:00
void fixup_word(WORD* word);
void collect_word(WORD* word);