Don't JIT inside heap scan loop, too fragile
parent
8fde3fb914
commit
7cd21081af
|
@ -730,7 +730,6 @@ void garbage_collection(CELL gen,
|
|||
|
||||
/* collect objects referenced from stacks and environment */
|
||||
collect_roots();
|
||||
|
||||
/* collect objects referenced from older generations */
|
||||
collect_cards();
|
||||
|
||||
|
|
24
vm/factor.c
24
vm/factor.c
|
@ -36,22 +36,36 @@ void do_stage1_init(void)
|
|||
fprintf(stderr,"*** Stage 2 early init... ");
|
||||
fflush(stderr);
|
||||
|
||||
GROWABLE_ARRAY(words);
|
||||
|
||||
begin_scan();
|
||||
|
||||
CELL obj;
|
||||
while((obj = next_object()) != F)
|
||||
{
|
||||
if(type_of(obj) == WORD_TYPE)
|
||||
{
|
||||
F_WORD *word = untag_object(obj);
|
||||
default_word_code(word,false);
|
||||
update_word_xt(word);
|
||||
}
|
||||
GROWABLE_ADD(words,obj);
|
||||
}
|
||||
|
||||
/* End heap scan */
|
||||
gc_off = false;
|
||||
|
||||
GROWABLE_TRIM(words);
|
||||
REGISTER_ROOT(words);
|
||||
|
||||
CELL i;
|
||||
CELL length = array_capacity(untag_object(words));
|
||||
for(i = 0; i < length; i++)
|
||||
{
|
||||
F_WORD *word = untag_word(array_nth(untag_array(words),i));
|
||||
REGISTER_UNTAGGED(word);
|
||||
default_word_code(word,false);
|
||||
UNREGISTER_UNTAGGED(word);
|
||||
update_word_xt(word);
|
||||
}
|
||||
|
||||
UNREGISTER_ROOT(words);
|
||||
|
||||
iterate_code_heap(relocate_code_block);
|
||||
|
||||
userenv[STAGE2_ENV] = T;
|
||||
|
|
3
vm/run.c
3
vm/run.c
|
@ -21,10 +21,13 @@ void fix_stacks(void)
|
|||
/* called before entry into foreign C code. Note that ds and rs might
|
||||
be stored in registers, so callbacks must save and restore the correct values */
|
||||
void save_stacks(void)
|
||||
{
|
||||
if(stack_chain)
|
||||
{
|
||||
stack_chain->datastack = ds;
|
||||
stack_chain->retainstack = rs;
|
||||
}
|
||||
}
|
||||
|
||||
/* called on entry into a compiled callback */
|
||||
void nest_stacks(void)
|
||||
|
|
Loading…
Reference in New Issue