Fix 'become'

db4
Slava Pestov 2009-04-21 00:05:39 -05:00
parent cb6205e9d4
commit 461ddfac1a
3 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,8 @@ sequences tools.test words namespaces layouts classes
classes.builtin arrays quotations io.launcher system ;
IN: memory.tests
[ ] [ { } { } become ] unit-test
! LOL
[ ] [
vm

View File

@ -564,6 +564,8 @@ void primitive_clear_gc_stats(void)
clear_gc_stats();
}
/* classes.tuple uses this to reshape tuples; tools.deploy.shaker uses this
to coalesce equal but distinct quotations and wrappers. */
void primitive_become(void)
{
F_ARRAY *new_objects = untag_array(dpop());
@ -585,5 +587,9 @@ void primitive_become(void)
gc();
/* If a word's definition quotation was in old_objects and the
quotation in new_objects is not compiled, we might leak memory
by referencing the old quotation unless we recompile all
unoptimized words. */
compile_all_words();
}

View File

@ -532,7 +532,8 @@ void compile_all_words(void)
{
F_WORD *word = untag_word(array_nth(untag_array(words),i));
REGISTER_UNTAGGED(word);
jit_compile_word(word,word->def,false);
if(word->optimizedp == F)
jit_compile_word(word,word->def,false);
UNREGISTER_UNTAGGED(word);
update_word_xt(word);
}