factor/native/compiler.c

37 lines
582 B
C
Raw Normal View History

2004-09-06 02:32:04 -04:00
#include "factor.h"
void init_compiler(void)
{
init_zone(&compiling,COMPILE_ZONE_SIZE);
literal_top = compiling.base;
2004-09-06 02:32:04 -04:00
}
void primitive_compiled_offset(void)
2004-09-06 02:32:04 -04:00
{
2004-09-19 17:39:28 -04:00
box_integer(compiling.here);
2004-09-06 02:32:04 -04:00
}
void primitive_set_compiled_offset(void)
{
2004-09-19 17:39:28 -04:00
CELL offset = unbox_integer();
compiling.here = offset;
}
void primitive_literal_top(void)
{
2004-09-19 17:39:28 -04:00
box_integer(literal_top);
}
void primitive_set_literal_top(void)
{
2004-09-19 17:39:28 -04:00
CELL offset = unbox_integer();
literal_top = offset;
}
void collect_literals(void)
{
2004-12-24 02:52:02 -05:00
CELL i;
for(i = compiling.base; i < literal_top; i += CELLS)
copy_object((CELL*)i);
}