vm: debugging new card marking

db4
Slava Pestov 2009-10-14 04:59:28 -05:00
parent 1ce39963fd
commit 236efe4881
3 changed files with 15 additions and 9 deletions

View File

@ -170,7 +170,7 @@ cell factor_vm::compute_relocation(relocation_entry rel, cell index, code_block
case RT_HERE: case RT_HERE:
{ {
fixnum arg = untag_fixnum(ARG); fixnum arg = untag_fixnum(ARG);
return (arg >= 0 ? offset + arg : (cell)(compiled +1) - arg); return (arg >= 0 ? offset + arg : (cell)(compiled + 1) - arg);
} }
case RT_THIS: case RT_THIS:
return (cell)(compiled + 1); return (cell)(compiled + 1);
@ -372,7 +372,6 @@ struct code_block_relocator {
{ {
myvm->relocate_code_block_step(rel,index,compiled); myvm->relocate_code_block_step(rel,index,compiled);
} }
}; };
/* Perform all fixups on a code block */ /* Perform all fixups on a code block */

View File

@ -102,6 +102,8 @@ struct copying_collector : collector<TargetGeneration,Policy> {
{ {
if(decks[deck_index] & mask) if(decks[deck_index] & mask)
{ {
this->myvm->gc_stats.decks_scanned++;
cell first_card = first_card_in_deck(deck_index); cell first_card = first_card_in_deck(deck_index);
cell last_card = last_card_in_deck(deck_index); cell last_card = last_card_in_deck(deck_index);
@ -111,7 +113,9 @@ struct copying_collector : collector<TargetGeneration,Policy> {
{ {
if(cards[card_index] & mask) if(cards[card_index] & mask)
{ {
if(card_start_address(card_index) >= end) this->myvm->gc_stats.cards_scanned++;
if(end < card_start_address(card_index))
{ {
start = gen->find_object_containing_card(card_index - gen_start_card); start = gen->find_object_containing_card(card_index - gen_start_card);
binary_start = start + this->myvm->binary_payload_start((object *)start); binary_start = start + this->myvm->binary_payload_start((object *)start);
@ -134,17 +138,20 @@ scan_next_object: {
if(end < card_end_address(card_index)) if(end < card_end_address(card_index))
{ {
start = gen->next_object_after(this->myvm,start); start = gen->next_object_after(this->myvm,start);
if(!start) goto end; if(start)
binary_start = start + this->myvm->binary_payload_start((object *)start); {
end = start + this->myvm->untagged_object_size((object *)start); binary_start = start + this->myvm->binary_payload_start((object *)start);
goto scan_next_object; end = start + this->myvm->untagged_object_size((object *)start);
goto scan_next_object;
}
} }
} }
unmarker(card_dirty,&cards[card_index]); unmarker(card_dirty,&cards[card_index]);
this->myvm->gc_stats.cards_scanned++;
deck_dirty |= card_dirty; deck_dirty |= card_dirty;
if(!start) goto end;
} }
} }

View File

@ -155,7 +155,7 @@ void factor_vm::collect_growing_heap(cell requested_bytes, bool trace_contexts_p
{ {
data_heap *old = data; data_heap *old = data;
set_data_heap(data->grow(requested_bytes)); set_data_heap(data->grow(requested_bytes));
collect_full(trace_contexts_p); collect_full_impl(trace_contexts_p);
free_unmarked_code_blocks(true); free_unmarked_code_blocks(true);
delete old; delete old;
} }