factor/native/word.h

52 lines
1.4 KiB
C

typedef void (*XT)(void);
typedef struct {
/* TAGGED header */
CELL header;
/* untagged hashcode */
CELL hashcode;
/* untagged execution token: jump here to execute word */
CELL xt;
/* untagged on-disk primitive number */
CELL primitive;
/* TAGGED parameter to xt; used for colon definitions */
CELL parameter;
/* TAGGED property list for library code */
CELL plist;
/* UNTAGGED call count incremented by profiler */
CELL call_count;
/* UNTAGGED amount of memory allocated in word */
CELL allot_count;
} F_WORD;
INLINE F_WORD* untag_word(CELL tagged)
{
type_check(WORD_TYPE,tagged);
return (F_WORD*)UNTAG(tagged);
}
INLINE CELL tag_word(F_WORD* word)
{
return RETAG(word,WORD_TYPE);
}
F_WORD* word(CELL primitive, CELL parameter, CELL plist);
void update_xt(F_WORD* word);
void primitive_word(void);
void primitive_word_hashcode(void);
void primitive_word_primitive(void);
void primitive_set_word_primitive(void);
void primitive_word_xt(void);
void primitive_set_word_xt(void);
void primitive_word_parameter(void);
void primitive_set_word_parameter(void);
void primitive_word_plist(void);
void primitive_set_word_plist(void);
void primitive_word_call_count(void);
void primitive_set_word_call_count(void);
void primitive_word_allot_count(void);
void primitive_set_word_allot_count(void);
void primitive_word_compiledp(void);
void fixup_word(F_WORD* word);
void collect_word(F_WORD* word);