diff --git a/ldb/gc.c b/ldb/gc.c index a3f0820ae7bffdda6b5d9be9b71de701cc42e077..02592d336066f441a152886d34dde9db376139b4 100644 --- a/ldb/gc.c +++ b/ldb/gc.c @@ -1,7 +1,7 @@ /* * Stop and Copy GC based on Cheney's algorithm. * - * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/gc.c,v 1.32 1992/03/02 03:56:01 wlott Exp $ + * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/gc.c,v 1.33 1992/03/08 18:39:38 wlott Exp $ * * Written by Christopher Hoover. */ @@ -1108,22 +1108,22 @@ lispobj *where; return length; } -/* Note: on the sparc we don't have to do anything special for symbols, */ -/* cause the raw-function-addr has the correct lowtag. */ +/* Note: on the sparc we don't have to do anything special for fdefns, */ +/* cause the raw-addr has a function lowtag. */ #ifndef sparc static -scav_symbol(where, object) +scav_fdefn(where, object) lispobj *where, object; { - struct symbol *symbol; + struct fdefn *fdefn; #define RAW_ADDR_OFFSET (6*sizeof(lispobj) - type_FunctionPointer) - symbol = (struct symbol *)where; + fdefn = (struct fdefn *)where; - if ((char *)(symbol->function + RAW_ADDR_OFFSET) == symbol->raw_function_addr) { - scavenge(where + 1, sizeof(struct symbol)/sizeof(lispobj) - 1); - symbol->raw_function_addr = (char *)(symbol->function + RAW_ADDR_OFFSET); - return sizeof(struct symbol) / sizeof(lispobj); + if ((char *)(fdefn->function + RAW_ADDR_OFFSET) == fdefn->raw_addr) { + scavenge(where + 1, sizeof(struct fdefn)/sizeof(lispobj) - 1); + fdefn->raw_addr = (char *)(fdefn->function + RAW_ADDR_OFFSET); + return sizeof(struct fdefn) / sizeof(lispobj); } else return 1; @@ -1804,17 +1804,17 @@ gc_init() scavtab[type_ClosureHeader] = scav_boxed; scavtab[type_FuncallableInstanceHeader] = scav_boxed; scavtab[type_ValueCellHeader] = scav_boxed; -#ifndef sparc - scavtab[type_SymbolHeader] = scav_symbol; -#else scavtab[type_SymbolHeader] = scav_boxed; -#endif scavtab[type_BaseChar] = scav_immediate; scavtab[type_Sap] = scav_unboxed; scavtab[type_UnboundMarker] = scav_immediate; scavtab[type_WeakPointer] = scav_weak_pointer; scavtab[type_StructureHeader] = scav_boxed; - +#ifndef sparc + scavtab[type_Fdefn] = scav_fdefn; +#else + scavtab[type_Fdefn] = scav_boxed; +#endif /* Transport Other Table */ for (i = 0; i < 256; i++) @@ -1853,6 +1853,7 @@ gc_init() transother[type_UnboundMarker] = trans_immediate; transother[type_WeakPointer] = trans_weak_pointer; transother[type_StructureHeader] = trans_vector; + transother[type_Fdefn] = trans_boxed; /* Size table */ @@ -1906,6 +1907,7 @@ gc_init() sizetab[type_UnboundMarker] = size_immediate; sizetab[type_WeakPointer] = size_weak_pointer; sizetab[type_StructureHeader] = size_vector; + sizetab[type_Fdefn] = size_boxed; } diff --git a/ldb/print.c b/ldb/print.c index 92efcf312c1ba1d0e21fb89fc8a0c2bb87102ec0..080586e13144c4d7c54e5e2f4467d4c76a70ed6b 100644 --- a/ldb/print.c +++ b/ldb/print.c @@ -1,4 +1,4 @@ -/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/print.c,v 1.16 1991/11/10 22:32:59 wlott Exp $ */ +/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/print.c,v 1.17 1992/03/08 18:39:57 wlott Exp $ */ #include <stdio.h> #include "ldb.h" @@ -65,7 +65,8 @@ char *subtype_Names[] = { "SAP", "unbound marker", "weak pointer", - "structure header" + "structure header", + "fdefn" }; static void indent(in) @@ -347,14 +348,15 @@ long *ptr; print_obj("???: ", *ptr++); } -static char *symbol_slots[] = {"value: ", "function: ", "raw fn addr: ", -"setf fn: ", "plist: ", "name: ", "package: ", NULL}; +static char *symbol_slots[] = {"value: ", "unused: ", + "plist: ", "name: ", "package: ", NULL}; static char *ratio_slots[] = {"numer: ", "denom: ", NULL}; static char *complex_slots[] = {"real: ", "imag: ", NULL}; static char *code_slots[] = {"words: ", "entry: ", "debug: ", NULL}; static char *fn_slots[] = {"self: ", "next: ", "name: ", "arglist: ", "type: ", NULL}; static char *closure_slots[] = {"fn: ", NULL}; static char *weak_pointer_slots[] = {"value: ", NULL}; +static char *fdefn_slots[] = {"name: ", "function: ", "raw_addr: ", NULL}; static void print_otherptr(obj) lispobj obj; @@ -486,6 +488,10 @@ lispobj obj; printf("pointer to an immediate?"); break; + case type_Fdefn: + print_slots(fdefn_slots, count, ptr); + break; + default: NEWLINE; printf("Unknown header object?"); diff --git a/ldb/purify.c b/ldb/purify.c index 9c662848c9bdaf0671d4a86c6c13599d657e9249..02317a5bf0e832613bd8964ea947d9052ccc545c 100644 --- a/ldb/purify.c +++ b/ldb/purify.c @@ -1,6 +1,6 @@ /* Purify. */ -/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/purify.c,v 1.16 1992/01/25 14:39:55 wlott Exp $ */ +/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/purify.c,v 1.17 1992/03/08 18:39:54 wlott Exp $ */ #include <stdio.h> @@ -121,11 +121,11 @@ static lispobj ptrans_boxed(thing, header, constant) return result; } -static lispobj ptrans_symbol(thing, header) +static lispobj ptrans_fdefn(thing, header) { int nwords; lispobj result, *new, *old, oldfn; - struct symbol *sym; + struct fdefn *fdefn; nwords = 1 + HeaderValue(header); @@ -140,13 +140,13 @@ static lispobj ptrans_symbol(thing, header) /* Deposit forwarding pointer. */ result = (lispobj)new | LowtagOf(thing); *old = result; - + /* Scavenge the function. */ - sym = (struct symbol *)new; - oldfn = sym->function; - pscav(&sym->function, 1, FALSE); - if ((char *)oldfn + RAW_ADDR_OFFSET == sym->raw_function_addr) - sym->raw_function_addr = (char *)sym->function + RAW_ADDR_OFFSET; + fdefn = (struct fdefn *)new; + oldfn = fdefn->function; + pscav(&fdefn->function, 1, FALSE); + if ((char *)oldfn + RAW_ADDR_OFFSET == fdefn->raw_addr) + fdefn->raw_addr = (char *)fdefn->function + RAW_ADDR_OFFSET; return result; } @@ -421,7 +421,7 @@ static lispobj ptrans_otherptr(thing, header, constant) return ptrans_boxed(thing, header, FALSE); case type_SymbolHeader: - return ptrans_symbol(thing, header); + return ptrans_boxed(thing, header, FALSE); case type_SimpleString: return ptrans_vector(thing, 8, 1, FALSE, constant); @@ -459,41 +459,28 @@ static lispobj ptrans_otherptr(thing, header, constant) case type_ReturnPcHeader: return ptrans_returnpc(thing, header); + case type_Fdefn: + return ptrans_fdefn(thing, header); + default: /* Should only come across other pointers to the above stuff. */ gc_abort(); } } -static int pscav_symbol(symbol) - struct symbol *symbol; +static int pscav_fdefn(fdefn) + struct fdefn *fdefn; { boolean fix_func; - fix_func = ((char *)(symbol->function + RAW_ADDR_OFFSET) == - symbol->raw_function_addr); - pscav(&symbol->value, sizeof(struct symbol)/sizeof(lispobj) - 1, FALSE); + fix_func = ((char *)(fdefn->function+RAW_ADDR_OFFSET) == fdefn->raw_addr); + pscav(&fdefn->name, 1, TRUE); + pscav(&fdefn->function, 1, FALSE); if (fix_func) - symbol->raw_function_addr = - (char *)(symbol->function + RAW_ADDR_OFFSET); - return sizeof(struct symbol) / sizeof(lispobj); + fdefn->raw_addr = (char *)(fdefn->function + RAW_ADDR_OFFSET); + return sizeof(struct fdefn) / sizeof(lispobj); } -#if 0 -static int pscav_code(addr) - lispobj *addr; -{ - struct code *code; - - code = (struct code *)addr; - - pscav_later(&code->debug_info, 1); - pscav(code->constants, HeaderValue(code->header)-4, TRUE); - - return HeaderValue(code->header) + FIXNUM_TO_INT(code->code_size); -} -#endif - static lispobj *pscav(addr, nwords, constant) lispobj *addr; int nwords; @@ -554,11 +541,6 @@ static lispobj *pscav(addr, nwords, constant) count = HeaderValue(thing)+1; break; - case type_SymbolHeader: - /* Symbols must have the raw function addr fixed up. */ - count = pscav_symbol((struct symbol *)addr); - break; - case type_SimpleVector: if (HeaderValue(thing) == subtype_VectorValidHashing) *addr = (subtype_VectorMustRehash<<type_Bits) |