Fix performance problem: literals were being scanned too often

db4
Slava Pestov 2008-11-25 21:27:07 -06:00
parent 2f025f58ae
commit c7c1f3903f
1 changed files with 10 additions and 9 deletions

View File

@ -885,12 +885,13 @@ void garbage_collection(CELL gen,
/* collect objects referenced from older generations */ /* collect objects referenced from older generations */
collect_cards(); collect_cards();
if(collecting_gen != TENURED) /* don't scan code heap unless it has pointers to this
generation or younger */
if(collecting_gen >= last_code_heap_scan)
{ {
/* don't scan code heap unless it has pointers to this if(collecting_gen != TENURED)
generation or younger */
if(collecting_gen >= last_code_heap_scan)
{ {
/* if we are doing code GC, then we will copy over /* if we are doing code GC, then we will copy over
literals from any code block which gets marked as live. literals from any code block which gets marked as live.
if we are not doing code GC, just consider all literals if we are not doing code GC, just consider all literals
@ -898,12 +899,12 @@ void garbage_collection(CELL gen,
code_heap_scans++; code_heap_scans++;
collect_literals(); collect_literals();
if(collecting_accumulation_gen_p())
last_code_heap_scan = collecting_gen;
else
last_code_heap_scan = collecting_gen + 1;
} }
if(collecting_accumulation_gen_p())
last_code_heap_scan = collecting_gen;
else
last_code_heap_scan = collecting_gen + 1;
} }
collect_next_loop(scan,&newspace->here); collect_next_loop(scan,&newspace->here);