PERL CVS PARROT 25 CVS COMMIT PARROT SRC GC GMS C LIST C
Date: 25 Feb 2005 09:33:08 -0000

Subject: cvs commit: parrot/src gc_gms.c list.c
From: leo@no-spam (Leopold Toetsch)

cvsuser 05/02/25 01:33:08

Modified: src gc_gms.c list.c Log:
GMS generational MS 9 - remove warnings; add TODO comment Revision Changes Path 1.3 +46 -1 parrot/src/gc_gms.c Index: gc_gms.c ===================================================================
RCS file: /cvs/public/parrot/src/gc_gms.c,v retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gc_gms.c 24 Feb 2005 11:56:44 -0000 1.2
+++ gc_gms.c 25 Feb 2005 09:33:07 -0000 1.3
@@no-spam -1,6 +1,6 @@no-spam /*
Copyright: 2001-2004 The Perl Foundation. All Rights Reserved.
-$Id: gc_gms.c,v 1.2 2005/02/24 11:56:44 leo Exp $
+$Id: gc_gms.c,v 1.3 2005/02/25 09:33:07 leo Exp $
=head1 NAME @@no-spam -114,6 +114,51 @@no-spam #if PARROT_GC_GMS /*
+ * XXX + *
+ * Main problem TODO 1):
+ *
+ * [ PCont ] ... continuation object in old generation + * |
+ * v + * [ Stack chunk ] --> [ e.g. P register frame ] ... new generation + *
+ * By pushing a new stack chunk onto the (old) existing stack frame,
+ * we'd need a WRITE_BARRIER that promotes the stack chunk to the old + * generation of the continuation.
+ * This would also need an IGP entry for the stack chunk buffer. But -
+ * as buffers aren't really containers in Parrot - this isn't possible.
+ *
+ * To get that right, the code needs better support by the running + * interpreter.
+ * - never promote continuations (and stacks) in the current stack frame + * to an old generation + * - create scope_enter / scope_exit opcodes + *
+ * A scope_enter happens on a subroutine call *and' with new_pad /
+ * push_pad opcodes. Each lexical scope must have its distinct register + * frame, else timely detruction can't work.
+ * If the frame needs active destruction, the old frame should be + * converted to the (new-1) generation, the inner frame is the nursery.
+ * On scope exit the newest (nursery) generation is collected and the + * current generation number is reset back to (new-1).
+ *
+ * If the scope_enter doesn't indicate timely destruction, generation + * promoting should be done only, if object statistics indicate the + * presence of a fair amount of live objects.
+ *
+ * TODO 2) in lazy sweep + * If timely destruction didn't find (all) eager objects, go back to + * older generations, until all these objects have been seen.
+ *
+ * TODO 3) interpreter startup + * After all internal structures are created, promote interpreter state + * into initial first old generation by running one GC cycle before + * program execution begins (or just treat all objects as being alive).
+ *
+ */
+
+/*
* call code to verify chain of pointers after each change * this is very expensive, but should be used during development */
1.54 +13 -7 parrot/src/list.c Index: list.c ===================================================================
RCS file: /cvs/public/parrot/src/list.c,v retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- list.c 25 Feb 2005 08:40:55 -0000 1.53
+++ list.c 25 Feb 2005 09:33:07 -0000 1.54
@@no-spam -1,7 +1,7 @@no-spam /*
Copyright: (c) 2002 Leopold Toetsch <lt@no-spam>
License: Artistic/GPL, see README and LICENSES for details -$Id: list.c,v 1.53 2005/02/25 08:40:55 leo Exp $
+$Id: list.c,v 1.54 2005/02/25 09:33:07 leo Exp $
=head1 NAME @@no-spam -239,8 +239,9 @@no-spam chunk->prev = NULL;
Parrot_allocate_zeroed(interpreter, (Buffer *)chunk, size);
/* see also src/hash.c */
- if (list->container)
+ if (list->container) {
DOD_WRITE_BARRIER(interpreter, list->container, 0, chunk);
+ }
Parrot_unblock_DOD(interpreter);
/*Parrot_unblock_GC(interpreter); */
return chunk;
@@no-spam -404,8 +405,9 @@no-spam if(prev->items + chunk->items > MAX_ITEMS) {
Parrot_reallocate(interpreter, (Buffer *)prev,
MAX_ITEMS * list->item_size);
- if (list->container)
+ if (list->container) {
DOD_WRITE_BARRIER(interpreter, list->container, 0, prev);

+ }
mem_sys_memmove(
(char *) PObj_bufstart(&prev->data) +
prev->items * list->item_size,
@@no-spam -422,8 +424,9 @@no-spam else {
Parrot_reallocate(interpreter, (Buffer *)prev,
(prev->items + chunk->items) * list->item_size);
- if (list->container)
+ if (list->container) {
DOD_WRITE_BARRIER(interpreter, list->container, 0, prev);

+ }
mem_sys_memmove(
(char *) PObj_bufstart(&prev->data) +
prev->items * list->item_size,
@@no-spam -509,8 +512,9 @@no-spam len = 4;
Parrot_reallocate(interpreter, (Buffer *)list,
len * sizeof(List_chunk *));
- if (list->container)
+ if (list->container) {
DOD_WRITE_BARRIER(interpreter, list->container, 0, list);
+ }
list->collect_runs = interpreter->arena_base->collect_runs;
}
@@no-spam -941,8 +945,9 @@no-spam /* it fits, just allocate */
Parrot_reallocate(interpreter, (Buffer *)chunk,
chunk->items * list->item_size);
- if (list->container)
+ if (list->container) {
DOD_WRITE_BARRIER(interpreter, list->container, 0, chunk);
+ }
chunk->flags |= no_power_2;
chunk->flags &= ~sparse;
}
@@no-spam -955,8 +960,9 @@no-spam chunk->items = n2;
Parrot_reallocate(interpreter, (Buffer *)chunk,
chunk->items * list->item_size);
- if (list->container)
+ if (list->container) {
DOD_WRITE_BARRIER(interpreter, list->container, 0, chunk);
+ }
chunk->flags &= ~sparse;
if (n3) {
new_chunk = allocate_chunk(interpreter, list, n3, list->item_size);