X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fsgen%2Fsgen-split-nursery.c;h=38dc0c8c3a7a68b5b836e361ee0931471fcad54b;hb=57d7457da522af3ae0c61304ed0d97eca258258f;hp=3606607809e954c2888f1dceae8b70d0ea4cb135;hpb=56ad8f4e5dfb8198e4671f631a3103b1e8b83dd3;p=mono.git diff --git a/mono/sgen/sgen-split-nursery.c b/mono/sgen/sgen-split-nursery.c index 3606607809e..38dc0c8c3a7 100644 --- a/mono/sgen/sgen-split-nursery.c +++ b/mono/sgen/sgen-split-nursery.c @@ -1,5 +1,6 @@ -/* - * sgen-splliy-nursery.c: 3-space based nursery collector. +/** + * \file + * 3-space based nursery collector. * * Author: * Rodrigo Kumpera Kumpera @@ -254,8 +255,10 @@ alloc_for_promotion (GCVTable vtable, GCObject *obj, size_t objsize, gboolean ha int age; age = get_object_age (obj); - if (age >= promote_age) + if (age >= promote_age) { + total_promoted_size += objsize; return major_collector.alloc_object (vtable, objsize, has_references); + } /* Promote! */ ++age; @@ -265,8 +268,10 @@ alloc_for_promotion (GCVTable vtable, GCObject *obj, size_t objsize, gboolean ha age_alloc_buffers [age].next += objsize; } else { p = alloc_for_promotion_slow_path (age, objsize); - if (!p) + if (!p) { + total_promoted_size += objsize; return major_collector.alloc_object (vtable, objsize, has_references); + } } /* FIXME: assumes object layout */ @@ -414,18 +419,40 @@ print_gc_param_usage (void) /******************************************Copy/Scan functins ************************************************/ +#define collector_pin_object(obj, queue) sgen_pin_object (obj, queue); +#define COLLECTOR_SERIAL_ALLOC_FOR_PROMOTION alloc_for_promotion + +#include "sgen-copy-object.h" + #define SGEN_SPLIT_NURSERY -#define SERIAL_COPY_OBJECT split_nursery_serial_copy_object -#define SERIAL_COPY_OBJECT_FROM_OBJ split_nursery_serial_copy_object_from_obj +#include "sgen-minor-copy-object.h" +#include "sgen-minor-scan-object.h" + +static void +fill_serial_ops (SgenObjectOperations *ops) +{ + ops->copy_or_mark_object = SERIAL_COPY_OBJECT; + FILL_MINOR_COLLECTOR_SCAN_OBJECT (ops); +} + +#define SGEN_CONCURRENT_MAJOR #include "sgen-minor-copy-object.h" #include "sgen-minor-scan-object.h" +static void +fill_serial_with_concurrent_major_ops (SgenObjectOperations *ops) +{ + ops->copy_or_mark_object = SERIAL_COPY_OBJECT; + FILL_MINOR_COLLECTOR_SCAN_OBJECT (ops); +} + void sgen_split_nursery_init (SgenMinorCollector *collector) { collector->is_split = TRUE; + collector->is_parallel = FALSE; collector->alloc_for_promotion = minor_alloc_for_promotion; @@ -438,8 +465,8 @@ sgen_split_nursery_init (SgenMinorCollector *collector) collector->handle_gc_param = handle_gc_param; collector->print_gc_param_usage = print_gc_param_usage; - FILL_MINOR_COLLECTOR_COPY_OBJECT (collector); - FILL_MINOR_COLLECTOR_SCAN_OBJECT (collector); + fill_serial_ops (&collector->serial_ops); + fill_serial_with_concurrent_major_ops (&collector->serial_ops_with_concurrent_major); }