Update of /cvsroot/sbcl/sbcl/src/runtime In directory usw-pr-cvs1:/tmp/cvs-serv19981/src/runtime Modified Files: Tag: gc_cleanup_branch Config.x86-bsd Config.x86-linux alloc.c alpha-linux-os.c alpha-osf1-os.c bsd-os.c cheneygc.c coreparse.c gc-common.c gc-internal.h gc.h gencgc.c globals.c interrupt.c linux-os.c osf1-os.c ppc-linux-os.c purify.c runtime.c save.c sparc-linux-os.c sparc-sunos-os.c validate.c x86-assem.S x86-linux-os.c Log Message: 0.7.6.gc-cleanup-branch.4 Mostly-mechanical preprocessor symbol cleanup GENCGC->LISP_FEATURE_GENCGC Index: Config.x86-bsd =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.x86-bsd,v retrieving revision 1.7 retrieving revision 1.7.14.1 diff -u -d -r1.7 -r1.7.14.1 --- Config.x86-bsd 19 May 2001 01:03:02 -0000 1.7 +++ Config.x86-bsd 31 Jul 2002 17:02:00 -0000 1.7.14.1 @@ -16,4 +16,3 @@ OS_LIBS = -lm # -ldl GC_SRC = gencgc.c -CFLAGS += -DGENCGC Index: Config.x86-linux =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Config.x86-linux,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -d -r1.8 -r1.8.2.1 --- Config.x86-linux 19 May 2002 19:17:09 -0000 1.8 +++ Config.x86-linux 31 Jul 2002 17:02:00 -0000 1.8.2.1 @@ -27,4 +27,4 @@ OS_LIBS = -ldl GC_SRC = gencgc.c -CFLAGS += -DGENCGC + Index: alloc.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/alloc.c,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -d -r1.12 -r1.12.2.1 --- alloc.c 7 Jun 2002 01:54:42 -0000 1.12 +++ alloc.c 31 Jul 2002 17:02:00 -0000 1.12.2.1 @@ -30,7 +30,7 @@ #define ALIGNED_SIZE(n) (n+LOWTAG_MASK) & ~LOWTAG_MASK -#if defined GENCGC +#if defined LISP_FEATURE_GENCGC extern lispobj *alloc(int bytes); #else static lispobj * Index: alpha-linux-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/alpha-linux-os.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- alpha-linux-os.c 16 Jul 2002 13:48:06 -0000 1.6 +++ alpha-linux-os.c 31 Jul 2002 17:02:00 -0000 1.6.2.1 @@ -39,10 +39,6 @@ #include "validate.h" size_t os_vm_page_size; -#if defined GENCGC /* unlikely ... */ -#error SBCL Alpha does not work with the GENCGC -#include "gencgc.h" -#endif os_context_register_t * os_context_register_addr(os_context_t *context, int offset) Index: alpha-osf1-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/alpha-osf1-os.c,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- alpha-osf1-os.c 7 Jun 2002 11:30:46 -0000 1.1 +++ alpha-osf1-os.c 31 Jul 2002 17:02:00 -0000 1.1.2.1 @@ -41,10 +41,6 @@ #include "validate.h" size_t os_vm_page_size; -#if defined GENCGC /* unlikely ... */ -#error SBCL Alpha does not work with the GENCGC -#include "gencgc.h" -#endif os_context_register_t * os_context_register_addr(os_context_t *context, int offset) Index: bsd-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/bsd-os.c,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -d -r1.12 -r1.12.2.1 --- bsd-os.c 23 Jul 2002 17:22:37 -0000 1.12 +++ bsd-os.c 31 Jul 2002 17:02:00 -0000 1.12.2.1 @@ -37,9 +37,6 @@ #include "validate.h" vm_size_t os_vm_page_size; -#if defined GENCGC -#include "gencgc.h" -#endif /* The different BSD variants have diverged in exactly where they * store signal context information, but at least they tend to use the @@ -204,15 +201,7 @@ * any OS-dependent special low-level handling for signals */ -#if !defined GENCGC - -void -os_install_interrupt_handlers(void) -{ - SHOW("os_install_interrupt_handlers()/bsd-os/!defined(GENCGC)"); -} - -#else +#if defined LISP_FEATURE_GENCGC /* * The GENCGC needs to be hooked into whatever signal is raised for @@ -246,4 +235,12 @@ SHOW("leaving os_install_interrupt_handlers()"); } -#endif /* !defined GENCGC */ +#else +/* As of 2002.07.31, this configuration has never been tested */ +void +os_install_interrupt_handlers(void) +{ + SHOW("os_install_interrupt_handlers()/bsd-os/!defined(GENCGC)"); +} + +#endif /* defined GENCGC */ Index: cheneygc.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Attic/cheneygc.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- cheneygc.c 31 Jul 2002 15:51:46 -0000 1.1.2.1 +++ cheneygc.c 31 Jul 2002 17:02:00 -0000 1.1.2.2 @@ -47,11 +47,6 @@ static void scavenge_newspace(void); static void scavenge_interrupt_contexts(void); -#if 0 -static void scavenge(lispobj *start, u32 nwords); -static void scan_weak_pointers(void); -static int scav_lose(lispobj *where, lispobj object); -#endif /* collecting garbage */ @@ -584,7 +579,8 @@ } -/* initialization */ +/* initialization. if gc_init can be moved to after core load, we could + * combine these two functions */ void gc_init(void) @@ -593,6 +589,14 @@ scavtab[SIMPLE_VECTOR_WIDETAG] = scav_vector; scavtab[WEAK_POINTER_WIDETAG] = scav_weak_pointer; } + +void +gc_initialize_pointers(void) +{ + current_dynamic_space = DYNAMIC_0_SPACE_START; +} + + /* noise to manipulate the gc trigger stuff */ Index: coreparse.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/coreparse.c,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -u -d -r1.14 -r1.14.2.1 --- coreparse.c 15 Jun 2002 03:05:19 -0000 1.14 +++ coreparse.c 31 Jul 2002 17:02:00 -0000 1.14.2.1 @@ -68,7 +68,7 @@ switch (id) { case DYNAMIC_CORE_SPACE_ID: -#ifdef GENCGC +#ifdef LISP_FEATURE_GENCGC if (addr != (os_vm_address_t)DYNAMIC_SPACE_START) { fprintf(stderr, "in core: 0x%lx; in runtime: 0x%lx \n", (long)addr, (long)DYNAMIC_SPACE_START); @@ -87,7 +87,7 @@ /* FIXME: Should the conditional here be reg_ALLOC instead of * defined(__i386__) * ? */ -#if defined(__i386__) +#if defined(LISP_FEATURE_X86) SetSymbolValue(ALLOCATION_POINTER, (lispobj)free_pointer); #else dynamic_space_free_pointer = free_pointer; Index: gc-common.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Attic/gc-common.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- gc-common.c 31 Jul 2002 15:38:12 -0000 1.1.2.2 +++ gc-common.c 31 Jul 2002 17:02:00 -0000 1.1.2.3 @@ -109,8 +109,8 @@ lispobj *new; lispobj *source, *dest; - gc_assert(is_lisp_pointer((lispobj *)object)); - gc_assert(from_space_p((lispobj *)object)); + gc_assert(is_lisp_pointer(object)); + gc_assert(from_space_p(object)); gc_assert((nwords & 0x01) == 0); /* Get tag of object. */ Index: gc-internal.h =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/Attic/gc-internal.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -d -r1.1.2.2 -r1.1.2.3 --- gc-internal.h 31 Jul 2002 15:38:12 -0000 1.1.2.2 +++ gc-internal.h 31 Jul 2002 17:02:00 -0000 1.1.2.3 @@ -41,9 +41,7 @@ #define ALLOC_UNBOXED 1 #define ALLOC_QUICK 1 - void *gc_general_alloc(int nbytes,int unboxed_p,int quick_p); -void gc_init(void); extern int (*scavtab[256])(lispobj *where, lispobj object); extern lispobj (*transother[256])(lispobj object); @@ -51,6 +49,8 @@ extern struct weak_pointer *weak_pointers; /* in gc-common.c */ +extern void scavenge(lispobj *start, long n_words); +extern void scan_weak_pointers(void); lispobj copy_large_unboxed_object(lispobj object, int nwords); lispobj copy_unboxed_object(lispobj object, int nwords); Index: gc.h =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/gc.h,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -d -r1.4.2.1 -r1.4.2.2 --- gc.h 31 Jul 2002 13:05:33 -0000 1.4.2.1 +++ gc.h 31 Jul 2002 17:02:00 -0000 1.4.2.2 @@ -17,6 +17,7 @@ #define _GC_H_ extern void gc_init(void); +extern void gc_initialize_pointers(void); extern void collect_garbage(unsigned last_gen); #include "os.h" Index: gencgc.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/gencgc.c,v retrieving revision 1.22.2.2 retrieving revision 1.22.2.3 diff -u -d -r1.22.2.2 -r1.22.2.3 --- gencgc.c 31 Jul 2002 15:38:12 -0000 1.22.2.2 +++ gencgc.c 31 Jul 2002 17:02:00 -0000 1.22.2.3 @@ -4185,7 +4185,7 @@ * The ALLOCATION_POINTER points to the end of the dynamic space. * * XX A scan is needed to identify the closest first objects for pages. */ -void +static void gencgc_pickup_dynamic(void) { int page = 0; @@ -4210,6 +4210,14 @@ current_region_free_pointer = boxed_region.free_pointer; current_region_end_addr = boxed_region.end_addr; } + +void +gc_initialize_pointers(void) +{ + gencgc_pickup_dynamic(); +} + + /* a counter for how deep we are in alloc(..) calls */ int alloc_entered = 0; Index: globals.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/globals.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -d -r1.9 -r1.9.2.1 --- globals.c 23 Jul 2002 17:22:37 -0000 1.9 +++ globals.c 31 Jul 2002 17:02:01 -0000 1.9.2.1 @@ -37,7 +37,7 @@ lispobj *dynamic_space_free_pointer; #endif -#ifndef GENCGC /* since GENCGC has its own way to record trigger */ +#ifndef LISP_FEATURE_GENCGC /* GENCGC has its own way to record trigger */ lispobj *current_auto_gc_trigger; #endif @@ -51,7 +51,7 @@ /* Space, stack, and free pointer vars are initialized by * validate() and coreparse(). */ -#ifndef GENCGC /* since GENCGC has its own way to record trigger */ +#ifndef LISP_FEATURE_GENCGC /* no GC trigger yet */ current_auto_gc_trigger = NULL; #endif Index: interrupt.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/interrupt.c,v retrieving revision 1.31 retrieving revision 1.31.2.1 diff -u -d -r1.31 -r1.31.2.1 --- interrupt.c 25 Jul 2002 17:41:31 -0000 1.31 +++ interrupt.c 31 Jul 2002 17:02:01 -0000 1.31.2.1 @@ -502,7 +502,8 @@ * stuff to detect and handle hitting the GC trigger */ -#ifndef GENCGC /* since GENCGC has its own way to record trigger */ +#ifndef LISP_FEATURE_GENCGC +/* since GENCGC has its own way to record trigger */ static boolean gc_trigger_hit(int signal, siginfo_t *info, os_context_t *context) { @@ -571,7 +572,7 @@ else return 0; } -#ifndef __i386__ +#ifndef LISP_FEATURE_X86 /* This function gets called from the SIGSEGV (for e.g. Linux or * OpenBSD) or SIGBUS (for e.g. FreeBSD) handler. Here we check * whether the signal was due to treading on the mprotect()ed zone - @@ -582,11 +583,13 @@ os_context_t *context=(os_context_t *) void_context; if (!foreign_function_call_active -#ifndef GENCGC /* since GENCGC has its own way to record trigger */ +#ifndef LISP_FEATURE_GENCGC + /* nb: GENCGC on non-x86? I really don't think so. This + * happens every time */ && gc_trigger_hit(signal, info, context) #endif ) { -#ifndef GENCGC /* since GENCGC has its own way to record trigger */ +#ifndef LISP_FEATURE_GENCGC clear_auto_gc_trigger(); #endif Index: linux-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/linux-os.c,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -d -r1.16 -r1.16.2.1 --- linux-os.c 23 Jul 2002 17:22:37 -0000 1.16 +++ linux-os.c 31 Jul 2002 17:02:01 -0000 1.16.2.1 @@ -44,9 +44,7 @@ #include "validate.h" size_t os_vm_page_size; -#if defined GENCGC -#include "gencgc.h" -#endif +#include "gc.h" #ifdef sparc @@ -243,7 +241,7 @@ */ -#if defined GENCGC +#if defined LISP_FEATURE_GENCGC /* * The GENCGC needs to be hooked into whatever signal is raised for Index: osf1-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/osf1-os.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- osf1-os.c 23 Jul 2002 17:22:37 -0000 1.3 +++ osf1-os.c 31 Jul 2002 17:02:01 -0000 1.3.2.1 @@ -49,9 +49,6 @@ #include "validate.h" size_t os_vm_page_size; -#if defined GENCGC -#include "gencgc.h" -#endif void os_init(void) Index: ppc-linux-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/ppc-linux-os.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- ppc-linux-os.c 16 Jul 2002 13:48:07 -0000 1.3 +++ ppc-linux-os.c 31 Jul 2002 17:02:01 -0000 1.3.2.1 @@ -38,11 +38,6 @@ #include "validate.h" size_t os_vm_page_size; -#if defined GENCGC /* unlikely ... */ -#error SBCL PPC does not work with the GENCGC -#include "gencgc.h" -#endif - os_context_register_t * os_context_register_addr(os_context_t *context, int offset) { Index: purify.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/purify.c,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -u -d -r1.19 -r1.19.2.1 --- purify.c 25 Mar 2002 18:25:04 -0000 1.19 +++ purify.c 31 Jul 2002 17:02:01 -0000 1.19.2.1 @@ -26,9 +26,8 @@ #include "interrupt.h" #include "purify.h" #include "interr.h" -#ifdef GENCGC -#include "gencgc.h" -#endif +#include "gc.h" +#include "gc-internal.h" #define PRINTNOISE @@ -1445,7 +1444,7 @@ #if !defined(__i386__) dynamic_space_free_pointer = current_dynamic_space; #else -#if defined GENCGC +#if defined LISP_FEATURE_GENCGC gc_free_heap(); #else #error unsupported case /* in CMU CL, was "ibmrt using GC" */ Index: runtime.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/runtime.c,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -d -r1.15 -r1.15.2.1 --- runtime.c 23 Jul 2002 17:22:37 -0000 1.15 +++ runtime.c 31 Jul 2002 17:02:01 -0000 1.15.2.1 @@ -40,9 +40,6 @@ #include "interr.h" #include "monitor.h" #include "validate.h" -#if defined GENCGC -#include "gencgc.h" -#endif #include "core.h" #include "save.h" #include "lispregs.h" @@ -263,10 +260,7 @@ SHOW("freeing core"); free(core); -#if defined GENCGC - gencgc_pickup_dynamic(); -#else -#endif + gc_initialize_pointers(); #ifdef BINDING_STACK_POINTER SetSymbolValue(BINDING_STACK_POINTER, BINDING_STACK_START); Index: save.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/save.c,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -u -d -r1.11 -r1.11.2.1 --- save.c 15 Jun 2002 03:05:19 -0000 1.11 +++ save.c 31 Jul 2002 17:02:01 -0000 1.11.2.1 @@ -23,10 +23,7 @@ #include "dynbind.h" #include "lispregs.h" #include "validate.h" - -#ifdef GENCGC -#include "gencgc.h" -#endif +#include "gc-internal.h" static long write_bytes(FILE *file, char *addr, long bytes) @@ -134,7 +131,7 @@ (lispobj *)current_dynamic_space, dynamic_space_free_pointer); #else -#ifdef GENCGC +#ifdef LISP_FEATURE_GENCGC /* Flush the current_region, updating the tables. */ gc_alloc_update_page_tables(0,&boxed_region); gc_alloc_update_page_tables(1,&unboxed_region); Index: sparc-linux-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/sparc-linux-os.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- sparc-linux-os.c 16 Jul 2002 13:48:07 -0000 1.3 +++ sparc-linux-os.c 31 Jul 2002 17:02:01 -0000 1.3.2.1 @@ -37,9 +37,6 @@ #include "validate.h" size_t os_vm_page_size; -#if defined GENCGC /* unlikely ... */ -#include "gencgc.h" -#endif os_context_register_t * os_context_register_addr(os_context_t *context, int offset) Index: sparc-sunos-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/sparc-sunos-os.c,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -d -r1.3 -r1.3.2.1 --- sparc-sunos-os.c 20 Jun 2002 11:23:48 -0000 1.3 +++ sparc-sunos-os.c 31 Jul 2002 17:02:01 -0000 1.3.2.1 @@ -36,9 +36,6 @@ #include "validate.h" -#if defined GENCGC /* unlikely ... */ -#include "gencgc.h" -#endif os_context_register_t * os_context_register_addr(os_context_t *context, int offset) Index: validate.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/validate.c,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -u -d -r1.12 -r1.12.2.1 --- validate.c 23 Jul 2002 17:22:37 -0000 1.12 +++ validate.c 31 Jul 2002 17:02:01 -0000 1.12.2.1 @@ -66,7 +66,7 @@ ensure_space( (lispobj *)READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE); ensure_space( (lispobj *)STATIC_SPACE_START , STATIC_SPACE_SIZE); -#ifdef GENCGC +#ifdef LISP_FEATURE_GENCGC ensure_space( (lispobj *)DYNAMIC_SPACE_START , DYNAMIC_SPACE_SIZE); #else ensure_space( (lispobj *)DYNAMIC_0_SPACE_START , DYNAMIC_SPACE_SIZE); @@ -80,9 +80,6 @@ #ifdef HOLES make_holes(); -#endif -#ifndef GENCGC - current_dynamic_space = DYNAMIC_0_SPACE_START; #endif #ifdef PRINTNOISE Index: x86-assem.S =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-assem.S,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -d -r1.8 -r1.8.2.1 --- x86-assem.S 7 Mar 2002 02:02:24 -0000 1.8 +++ x86-assem.S 31 Jul 2002 17:02:01 -0000 1.8.2.1 @@ -324,11 +324,13 @@ ret .size GNAME(do_pending_interrupt),.-GNAME(do_pending_interrupt) -#ifdef GENCGC +#ifdef LISP_FEATURE_GENCGC /* This is a fast bzero using the FPU. The first argument is the start * address which needs to be aligned on an 8 byte boundary, the second * argument is the number of bytes, which must be a nonzero multiple * of 8 bytes. */ +/* FIXME whether this is still faster than using the OS's bzero or + * equivalent, we don't know */ .text .globl GNAME(i586_bzero) .type GNAME(i586_bzero),@function @@ -655,7 +657,7 @@ -#ifdef GENCGC +#ifdef LISP_FEATURE_GENCGC /* These routines are called from Lisp when an inline allocation * overflows. Every register except the result needs to be preserved. Index: x86-linux-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-linux-os.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- x86-linux-os.c 23 Jul 2002 17:22:37 -0000 1.6 +++ x86-linux-os.c 31 Jul 2002 17:02:01 -0000 1.6.2.1 @@ -38,9 +38,6 @@ #include "validate.h" size_t os_vm_page_size; -#if defined GENCGC -#include "gencgc.h" -#endif /* KLUDGE: As of kernel 2.2.14 on Red Hat 6.2, there's code in the * <sys/ucontext.h> file to define symbolic names for offsets into |