X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fsgen-mono.c;h=2956d95420a1460145c6ab4a3c8e688ef5ce00f4;hb=56ad8f4e5dfb8198e4671f631a3103b1e8b83dd3;hp=8421b903ba6f967366bba0f2d7c7b337510ac1ee;hpb=032a79f8a2ba11382cb8c027bd5c979acd0c4a6a;p=mono.git diff --git a/mono/metadata/sgen-mono.c b/mono/metadata/sgen-mono.c index 8421b903ba6..2956d95420a 100644 --- a/mono/metadata/sgen-mono.c +++ b/mono/metadata/sgen-mono.c @@ -3,18 +3,7 @@ * * Copyright (C) 2014 Xamarin Inc * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License 2.0 as published by the Free Software Foundation; - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License 2.0 along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include "config.h" @@ -37,6 +26,7 @@ #include "metadata/handle.h" #include "utils/mono-memory-model.h" #include "utils/mono-logger-internals.h" +#include "sgen/sgen-thread-pool.h" #ifdef HEAVY_STATISTICS static guint64 stat_wbarrier_set_arrayref = 0; @@ -1591,7 +1581,7 @@ find_next_card (guint8 *card_data, guint8 *end) #define ARRAY_OBJ_INDEX(ptr,array,elem_size) (((char*)(ptr) - ((char*)(array) + G_STRUCT_OFFSET (MonoArray, vector))) / (elem_size)) gboolean -sgen_client_cardtable_scan_object (GCObject *obj, mword block_obj_size, guint8 *cards, gboolean mod_union, ScanCopyContext ctx) +sgen_client_cardtable_scan_object (GCObject *obj, mword block_obj_size, guint8 *cards, ScanCopyContext ctx) { MonoVTable *vt = SGEN_LOAD_VTABLE (obj); MonoClass *klass = vt->klass; @@ -1671,20 +1661,11 @@ LOOP_HEAD: for (; elem < card_end; elem += elem_size) scan_vtype_func (obj, elem, desc, ctx.queue BINARY_PROTOCOL_ARG (elem_size)); } else { - CopyOrMarkObjectFunc copy_func = ctx.ops->copy_or_mark_object; + ScanPtrFieldFunc scan_ptr_field_func = ctx.ops->scan_ptr_field; HEAVY_STAT (++los_array_cards); - for (; elem < card_end; elem += SIZEOF_VOID_P) { - GCObject *new_; - gpointer old = *(gpointer*)elem; - if ((mod_union && old) || G_UNLIKELY (sgen_ptr_in_nursery (old))) { - HEAVY_STAT (++los_array_remsets); - copy_func ((GCObject**)elem, ctx.queue); - new_ = *(GCObject **)elem; - if (G_UNLIKELY (sgen_ptr_in_nursery (new_))) - sgen_add_to_global_remset (elem, new_); - } - } + for (; elem < card_end; elem += SIZEOF_VOID_P) + scan_ptr_field_func (obj, (GCObject**)elem, ctx.queue); } binary_protocol_card_scan (first_elem, elem - first_elem); @@ -2987,6 +2968,7 @@ mono_gc_base_init (void) void mono_gc_base_cleanup (void) { + sgen_thread_pool_shutdown (); } gboolean