Skip to content

Commit

Permalink
[sgen] Remove unnecessary entries from remembered set function table.
Browse files Browse the repository at this point in the history
  • Loading branch information
schani committed Feb 27, 2013
1 parent a337176 commit d0ee020
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 44 deletions.
35 changes: 1 addition & 34 deletions mono/metadata/sgen-gc.c
Expand Up @@ -2536,9 +2536,6 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
stat_minor_gcs++; stat_minor_gcs++;
gc_stats.minor_gc_count ++; gc_stats.minor_gc_count ++;


if (remset.prepare_for_minor_collection)
remset.prepare_for_minor_collection ();

MONO_GC_CHECKPOINT_1 (GENERATION_NURSERY); MONO_GC_CHECKPOINT_1 (GENERATION_NURSERY);


sgen_process_fin_stage_entries (); sgen_process_fin_stage_entries ();
Expand Down Expand Up @@ -2576,14 +2573,6 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
sgen_check_consistency (); sgen_check_consistency ();


sgen_workers_start_all_workers (); sgen_workers_start_all_workers ();

/*
* Perform the sequential part of remembered set scanning.
* This usually involves scanning global information that might later be produced by evacuation.
*/
if (remset.begin_scan_remsets)
remset.begin_scan_remsets (sgen_get_nursery_start (), nursery_next, WORKERS_DISTRIBUTE_GRAY_QUEUE);

sgen_workers_start_marking (); sgen_workers_start_marking ();


frssjd = sgen_alloc_internal_dynamic (sizeof (FinishRememberedSetScanJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE); frssjd = sgen_alloc_internal_dynamic (sizeof (FinishRememberedSetScanJobData), INTERNAL_MEM_WORKER_JOB_DATA, TRUE);
Expand Down Expand Up @@ -2726,8 +2715,7 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)


g_assert (sgen_gray_object_queue_is_empty (&gray_queue)); g_assert (sgen_gray_object_queue_is_empty (&gray_queue));


if (remset.finish_minor_collection) remset.finish_minor_collection ();
remset.finish_minor_collection ();


check_scan_starts (); check_scan_starts ();


Expand Down Expand Up @@ -3930,13 +3918,6 @@ mono_gc_deregister_root (char* addr)


unsigned int sgen_global_stop_count = 0; unsigned int sgen_global_stop_count = 0;


void
sgen_fill_thread_info_for_suspend (SgenThreadInfo *info)
{
if (remset.fill_thread_info_for_suspend)
remset.fill_thread_info_for_suspend (info);
}

int int
sgen_get_current_collection_generation (void) sgen_get_current_collection_generation (void)
{ {
Expand Down Expand Up @@ -4111,9 +4092,6 @@ sgen_thread_register (SgenThreadInfo* info, void *addr)
stack_end = info->stack_end; stack_end = info->stack_end;
#endif #endif


if (remset.register_thread)
remset.register_thread (info);

SGEN_LOG (3, "registered thread %p (%p) stack end %p", info, (gpointer)mono_thread_info_get_tid (info), info->stack_end); SGEN_LOG (3, "registered thread %p (%p) stack end %p", info, (gpointer)mono_thread_info_get_tid (info), info->stack_end);


if (gc_callbacks.thread_attach_func) if (gc_callbacks.thread_attach_func)
Expand All @@ -4123,13 +4101,6 @@ sgen_thread_register (SgenThreadInfo* info, void *addr)
return info; return info;
} }


static void
sgen_wbarrier_cleanup_thread (SgenThreadInfo *p)
{
if (remset.cleanup_thread)
remset.cleanup_thread (p);
}

static void static void
sgen_thread_unregister (SgenThreadInfo *p) sgen_thread_unregister (SgenThreadInfo *p)
{ {
Expand Down Expand Up @@ -4181,7 +4152,6 @@ sgen_thread_unregister (SgenThreadInfo *p)
gc_callbacks.thread_detach_func (p->runtime_data); gc_callbacks.thread_detach_func (p->runtime_data);
p->runtime_data = NULL; p->runtime_data = NULL;
} }
sgen_wbarrier_cleanup_thread (p);


mono_threads_unregister_current_thread (p); mono_threads_unregister_current_thread (p);
UNLOCK_GC; UNLOCK_GC;
Expand Down Expand Up @@ -5242,9 +5212,6 @@ mono_gc_base_init (void)


sgen_card_table_init (&remset); sgen_card_table_init (&remset);


if (remset.register_thread)
remset.register_thread (mono_thread_info_current ());

gc_initialized = 1; gc_initialized = 1;
} }


Expand Down
9 changes: 1 addition & 8 deletions mono/metadata/sgen-gc.h
Expand Up @@ -378,8 +378,6 @@ void sgen_wait_for_suspend_ack (int count) MONO_INTERNAL;
gboolean sgen_park_current_thread_if_doing_handshake (SgenThreadInfo *p) MONO_INTERNAL; gboolean sgen_park_current_thread_if_doing_handshake (SgenThreadInfo *p) MONO_INTERNAL;
void sgen_os_init (void) MONO_INTERNAL; void sgen_os_init (void) MONO_INTERNAL;


void sgen_fill_thread_info_for_suspend (SgenThreadInfo *info) MONO_INTERNAL;

gboolean sgen_is_worker_thread (MonoNativeThreadId thread) MONO_INTERNAL; gboolean sgen_is_worker_thread (MonoNativeThreadId thread) MONO_INTERNAL;


void sgen_update_heap_boundaries (mword low, mword high) MONO_INTERNAL; void sgen_update_heap_boundaries (mword low, mword high) MONO_INTERNAL;
Expand Down Expand Up @@ -685,16 +683,11 @@ typedef struct {
void (*wbarrier_generic_nostore) (gpointer ptr); void (*wbarrier_generic_nostore) (gpointer ptr);
void (*record_pointer) (gpointer ptr); void (*record_pointer) (gpointer ptr);


void (*begin_scan_remsets) (void *start_nursery, void *end_nursery, SgenGrayQueue *queue); /* OPTIONAL */
void (*finish_scan_remsets) (void *start_nursery, void *end_nursery, SgenGrayQueue *queue); void (*finish_scan_remsets) (void *start_nursery, void *end_nursery, SgenGrayQueue *queue);


void (*register_thread) (SgenThreadInfo *p); /* OPTIONAL */
void (*cleanup_thread) (SgenThreadInfo *p); /* OPTIONAL */
void (*fill_thread_info_for_suspend) (SgenThreadInfo *info); /* OPTIONAL */
void (*prepare_for_minor_collection) (void); /* OPTIONAL */
void (*prepare_for_major_collection) (void); void (*prepare_for_major_collection) (void);


void (*finish_minor_collection) (void); /* OPTIONAL */ void (*finish_minor_collection) (void);
gboolean (*find_address) (char *addr); gboolean (*find_address) (char *addr);
} SgenRemeberedSet; } SgenRemeberedSet;


Expand Down
2 changes: 0 additions & 2 deletions mono/metadata/sgen-os-posix.c
Expand Up @@ -66,8 +66,6 @@ suspend_thread (SgenThreadInfo *info, void *context)
if (0 && info->stop_count == stop_count) if (0 && info->stop_count == stop_count)
return; return;


sgen_fill_thread_info_for_suspend (info);

stack_start = context ? (char*) ARCH_SIGCTX_SP (context) - REDZONE_SIZE : NULL; stack_start = context ? (char*) ARCH_SIGCTX_SP (context) - REDZONE_SIZE : NULL;
/* If stack_start is not within the limits, then don't set it /* If stack_start is not within the limits, then don't set it
in info and we will be restarted. */ in info and we will be restarted. */
Expand Down

0 comments on commit d0ee020

Please sign in to comment.