From: William Harold Newman Date: Tue, 17 Oct 2000 23:59:29 +0000 (+0000) Subject: 0.6.7.13: dynamic-space simplification (only one dynamic space now) X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=3358092524adbaecaa483d6510fb3d7031441ccb;p=sbcl.git 0.6.7.13: dynamic-space simplification (only one dynamic space now) --- diff --git a/src/code/debug-int.lisp b/src/code/debug-int.lisp index ecabc00..0bead79 100644 --- a/src/code/debug-int.lisp +++ b/src/code/debug-int.lisp @@ -2477,10 +2477,10 @@ (or (< sb!vm:read-only-space-start val (* sb!vm:*read-only-space-free-pointer* sb!vm:word-bytes)) - (< sb!vm::static-space-start val + (< sb!vm:static-space-start val (* sb!vm:*static-space-free-pointer* sb!vm:word-bytes)) - (< (sb!vm:current-dynamic-space-start) val + (< (sb!vm:dynamic-space-start) val (sap-int (dynamic-space-free-pointer)))))) (make-lisp-obj val) :invalid-object)) diff --git a/src/code/gc.lisp b/src/code/gc.lisp index 3f8f2aa..e0bc9de 100644 --- a/src/code/gc.lisp +++ b/src/code/gc.lisp @@ -29,7 +29,6 @@ (def-c-var-frob sb!vm:control-stack-start "control_stack") #!+x86 (def-c-var-frob control-stack-end "control_stack_end") (def-c-var-frob sb!vm:binding-stack-start "binding_stack") -(def-c-var-frob sb!vm:current-dynamic-space-start "current_dynamic_space") #!-sb-fluid (declaim (inline dynamic-usage)) (def-c-var-frob dynamic-usage "bytes_allocated") diff --git a/src/code/room.lisp b/src/code/room.lisp index f674ce2..db1f7d5 100644 --- a/src/code/room.lisp +++ b/src/code/room.lisp @@ -126,7 +126,7 @@ (values (int-sap read-only-space-start) (int-sap (* *read-only-space-free-pointer* word-bytes)))) (:dynamic - (values (int-sap (current-dynamic-space-start)) + (values (int-sap dynamic-space-start) (dynamic-space-free-pointer))))) ;;; Return the total number of bytes used in SPACE. diff --git a/src/runtime/alloc.c b/src/runtime/alloc.c index ae9fc67..d11c820 100644 --- a/src/runtime/alloc.c +++ b/src/runtime/alloc.c @@ -31,9 +31,8 @@ #define SET_GC_TRIGGER(new_value) \ (SetSymbolValue(INTERNAL_GC_TRIGGER,(lispobj)(new_value))) #else -#define GET_FREE_POINTER() current_dynamic_space_free_pointer -#define SET_FREE_POINTER(new_value) \ - (current_dynamic_space_free_pointer = (new_value)) +#define GET_FREE_POINTER() dynamic_space_free_pointer +#define SET_FREE_POINTER(new_value) (dynamic_space_free_pointer = (new_value)) #define GET_GC_TRIGGER() current_auto_gc_trigger #define SET_GC_TRIGGER(new_value) \ clear_auto_gc_trigger(); set_auto_gc_trigger(new_value); @@ -56,7 +55,7 @@ static lispobj *alloc(int bytes) if (GET_GC_TRIGGER() && GET_FREE_POINTER() > GET_GC_TRIGGER()) { SET_GC_TRIGGER((char *)GET_FREE_POINTER() - - (char *)current_dynamic_space); + - (char *)DYNAMIC_SPACE_START); } return result; diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index bd60796..613be8b 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -194,8 +194,7 @@ is_valid_lisp_addr(os_vm_address_t addr) { return in_range_p(addr, READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE) || in_range_p(addr, STATIC_SPACE_START , STATIC_SPACE_SIZE ) - || in_range_p(addr, DYNAMIC_0_SPACE_START, DYNAMIC_SPACE_SIZE ) - || in_range_p(addr, DYNAMIC_1_SPACE_START, DYNAMIC_SPACE_SIZE ) + || in_range_p(addr, DYNAMIC_SPACE_START , DYNAMIC_SPACE_SIZE ) || in_range_p(addr, CONTROL_STACK_START , CONTROL_STACK_SIZE ) || in_range_p(addr, BINDING_STACK_START , BINDING_STACK_SIZE ); } diff --git a/src/runtime/coreparse.c b/src/runtime/coreparse.c index 51cbb8d..9239489 100644 --- a/src/runtime/coreparse.c +++ b/src/runtime/coreparse.c @@ -65,15 +65,13 @@ static void process_directory(int fd, long *ptr, int count) switch (id) { case DYNAMIC_SPACE_ID: - if (addr != (os_vm_address_t)dynamic_0_space - && addr != (os_vm_address_t)dynamic_1_space) { - lose("bizarre dynamic space!"); + if (addr != (os_vm_address_t)DYNAMIC_SPACE_START) { + lose("incorrect dynamic space"); } - current_dynamic_space = (lispobj *)addr; #if defined(ibmrt) || defined(__i386__) SetSymbolValue(ALLOCATION_POINTER, (lispobj)free_pointer); #else - current_dynamic_space_free_pointer = free_pointer; + dynamic_space_free_pointer = free_pointer; #endif break; case STATIC_SPACE_ID: diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 29dea31..65ddf79 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -6030,7 +6030,7 @@ gc_init(void) gc_init_tables(); - heap_base = (void*)DYNAMIC_0_SPACE_START; + heap_base = (void*)DYNAMIC_SPACE_START; /* Initialize each page structure. */ for (i = 0; i < NUM_PAGES; i++) { @@ -6089,7 +6089,7 @@ void gencgc_pickup_dynamic(void) { int page = 0; - int addr = DYNAMIC_0_SPACE_START; + int addr = DYNAMIC_SPACE_START; int alloc_ptr = SymbolValue(ALLOCATION_POINTER); /* Initialize the first region. */ @@ -6099,7 +6099,7 @@ gencgc_pickup_dynamic(void) page_table[page].bytes_used = 4096; page_table[page].large_object = 0; page_table[page].first_object_offset = - (void *)DYNAMIC_0_SPACE_START - page_address(page); + (void *)DYNAMIC_SPACE_START - page_address(page); addr += 4096; page++; } while (addr < alloc_ptr); diff --git a/src/runtime/globals.c b/src/runtime/globals.c index 691bfb1..9129424 100644 --- a/src/runtime/globals.c +++ b/src/runtime/globals.c @@ -33,17 +33,14 @@ lispobj *current_binding_stack_pointer; lispobj *read_only_space; lispobj *static_space; -lispobj *dynamic_0_space; -lispobj *dynamic_1_space; lispobj *control_stack; #ifdef __i386__ lispobj *control_stack_end; #endif lispobj *binding_stack; -lispobj *current_dynamic_space; #ifndef ALLOCATION_POINTER -lispobj *current_dynamic_space_free_pointer; +lispobj *dynamic_space_free_pointer; #endif #ifndef INTERNAL_GC_TRIGGER lispobj *current_auto_gc_trigger; diff --git a/src/runtime/globals.h b/src/runtime/globals.h index e0ba454..3e8feca 100644 --- a/src/runtime/globals.h +++ b/src/runtime/globals.h @@ -30,16 +30,13 @@ extern lispobj *current_binding_stack_pointer; extern lispobj *read_only_space; extern lispobj *static_space; -extern lispobj *dynamic_0_space; -extern lispobj *dynamic_1_space; extern lispobj *control_stack; extern lispobj *binding_stack; #ifdef __i386__ extern lispobj *control_stack_end; #endif -extern lispobj *current_dynamic_space; #if !defined(ibmrt) && !defined(__i386__) -extern lispobj *current_dynamic_space_free_pointer; +extern lispobj *dynamic_space_free_pointer; extern lispobj *current_auto_gc_trigger; #endif @@ -77,7 +74,7 @@ EXTERN(current_control_stack_pointer, 4) EXTERN(current_control_frame_pointer, 4) #if !defined(ibmrt) && !defined(__i386__) EXTERN(current_binding_stack_pointer, 4) -EXTERN(current_dynamic_space_free_pointer, 4) +EXTERN(dynamic_space_free_pointer, 4) #endif #ifdef mips diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index fdf1ab2..0bd56d0 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -113,10 +113,10 @@ fake_foreign_function_call(os_context_t *context) /* Get current Lisp state from context. */ #ifdef reg_ALLOC - current_dynamic_space_free_pointer = + dynamic_space_free_pointer = (lispobj *)(*os_context_register_addr(context, reg_ALLOC)); #ifdef alpha - if ((long)current_dynamic_space_free_pointer & 1) { + if ((long)dynamic_space_free_pointer & 1) { lose("dead in fake_foreign_function_call, context = %x", context); } #endif @@ -212,7 +212,7 @@ undo_fake_foreign_function_call(os_context_t *context) #ifdef reg_ALLOC /* Put the dynamic space free pointer back into the context. */ *os_context_register_addr(context, reg_ALLOC) = - (unsigned long) current_dynamic_space_free_pointer; + (unsigned long) dynamic_space_free_pointer; #endif } @@ -447,7 +447,7 @@ gc_trigger_hit(int signal, siginfo_t *info, os_context_t *context) context); return (badaddr >= current_auto_gc_trigger && - badaddr < current_dynamic_space + DYNAMIC_SPACE_SIZE); + badaddr < DYNAMIC_SPACE_START + DYNAMIC_SPACE_SIZE); } } #endif diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c index 8bcb7a8..76bb9ed 100644 --- a/src/runtime/linux-os.c +++ b/src/runtime/linux-os.c @@ -251,8 +251,7 @@ is_valid_lisp_addr(os_vm_address_t addr) return in_range_p(addr, READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE) || in_range_p(addr, STATIC_SPACE_START , STATIC_SPACE_SIZE) || - in_range_p(addr, DYNAMIC_0_SPACE_START, DYNAMIC_SPACE_SIZE) || - in_range_p(addr, DYNAMIC_1_SPACE_START, DYNAMIC_SPACE_SIZE) || + in_range_p(addr, DYNAMIC_SPACE_START , DYNAMIC_SPACE_SIZE) || in_range_p(addr, CONTROL_STACK_START , CONTROL_STACK_SIZE) || in_range_p(addr, BINDING_STACK_START , BINDING_STACK_SIZE); } diff --git a/src/runtime/monitor.c b/src/runtime/monitor.c index 4bfa931..e31af04 100644 --- a/src/runtime/monitor.c +++ b/src/runtime/monitor.c @@ -157,13 +157,13 @@ static void regs_cmd(char **ptr) printf("BSP\t=\t0x%08X\n", SymbolValue(BINDING_STACK_POINTER)); #endif - printf("DYNAMIC\t=\t0x%08lX\n", (unsigned long)current_dynamic_space); + printf("DYNAMIC\t=\t0x%08lX\n", (unsigned long)DYNAMIC_SPACE_START); #if defined(ibmrt) || defined(__i386__) printf("ALLOC\t=\t0x%08lX\n", SymbolValue(ALLOCATION_POINTER)); printf("TRIGGER\t=\t0x%08lX\n", SymbolValue(INTERNAL_GC_TRIGGER)); #else printf("ALLOC\t=\t0x%08X\n", - (unsigned long)current_dynamic_space_free_pointer); + (unsigned long)dynamic_space_free_pointer); printf("TRIGGER\t=\t0x%08X\n", (unsigned long)current_auto_gc_trigger); #endif printf("STATIC\t=\t0x%08lX\n", SymbolValue(STATIC_SPACE_FREE_POINTER)); diff --git a/src/runtime/parse.c b/src/runtime/parse.c index 99729cd..4538a1b 100644 --- a/src/runtime/parse.c +++ b/src/runtime/parse.c @@ -249,11 +249,11 @@ static boolean lookup_symbol(char *name, lispobj *result) } /* Search dynamic space. */ - headerptr = current_dynamic_space; + headerptr = DYNAMIC_SPACE_START; #if !defined(ibmrt) && !defined(__i386__) - count = current_dynamic_space_free_pointer - current_dynamic_space; + count = dynamic_space_free_pointer - DYNAMIC_SPACE_START; #else - count = (lispobj *)SymbolValue(ALLOCATION_POINTER) - current_dynamic_space; + count = (lispobj *)SymbolValue(ALLOCATION_POINTER) - DYNAMIC_SPACE_START; #endif if (search_for_symbol(name, &headerptr, &count)) { *result = (lispobj)headerptr | type_OtherPointer; diff --git a/src/runtime/purify.c b/src/runtime/purify.c index d194d35..c34eb01 100644 --- a/src/runtime/purify.c +++ b/src/runtime/purify.c @@ -36,7 +36,7 @@ #undef PRINTNOISE #if defined(ibmrt) || defined(__i386__) -static lispobj *current_dynamic_space_free_pointer; +static lispobj *dynamic_space_free_pointer; #endif #define gc_abort() \ @@ -96,12 +96,16 @@ static boolean dynamic_pointer_p(lispobj ptr) { #ifndef __i386__ - return (ptr >= (lispobj)dynamic_0_space); + /* KLUDGE: This has an implicit dependence on the ordering of + * address spaces, and is therefore basically wrong. I'd fix it, + * but I don't have a non-386 port to test it on. Porters are + * encouraged to fix it. -- WHN 2000-10-17 */ + return (ptr >= (lispobj)DYNAMIC_SPACE_START); #else /* Be more conservative, and remember, this is a maybe. */ - return (ptr >= (lispobj)current_dynamic_space + return (ptr >= (lispobj)DYNAMIC_SPACE_START && - ptr < (lispobj)current_dynamic_space_free_pointer); + ptr < (lispobj)dynamic_space_free_pointer); #endif } @@ -1382,7 +1386,7 @@ int purify(lispobj static_roots, lispobj read_only_roots) } #if defined(ibmrt) || defined(__i386__) - current_dynamic_space_free_pointer = + dynamic_space_free_pointer = (lispobj*)SymbolValue(ALLOCATION_POINTER); #endif @@ -1486,11 +1490,12 @@ int purify(lispobj static_roots, lispobj read_only_roots) #endif #if defined(WANT_CGC) && defined(X86_CGC_ACTIVE_P) - if(SymbolValue(X86_CGC_ACTIVE_P) != T) - os_zero((os_vm_address_t) current_dynamic_space, - (os_vm_size_t) DYNAMIC_SPACE_SIZE); + if(SymbolValue(X86_CGC_ACTIVE_P) != T) { + os_zero((os_vm_address_t) DYNAMIC_SPACE_START, + (os_vm_size_t) DYNAMIC_SPACE_SIZE); + } #else - os_zero((os_vm_address_t) current_dynamic_space, + os_zero((os_vm_address_t) DYNAMIC_SPACE_START, (os_vm_size_t) DYNAMIC_SPACE_SIZE); #endif @@ -1526,20 +1531,20 @@ int purify(lispobj static_roots, lispobj read_only_roots) SetSymbolValue(STATIC_SPACE_FREE_POINTER, (lispobj)static_free); #if !defined(ibmrt) && !defined(__i386__) - current_dynamic_space_free_pointer = current_dynamic_space; + dynamic_space_free_pointer = DYNAMIC_SPACE_START; #else #if defined(WANT_CGC) && defined(X86_CGC_ACTIVE_P) /* X86 using CGC */ if(SymbolValue(X86_CGC_ACTIVE_P) != T) - SetSymbolValue(ALLOCATION_POINTER, (lispobj)current_dynamic_space); + SetSymbolValue(ALLOCATION_POINTER, (lispobj)DYNAMIC_SPACE_START); else - cgc_free_heap(); + cgc_free_heap(); #else #if defined GENCGC gc_free_heap(); #else /* ibmrt using GC */ - SetSymbolValue(ALLOCATION_POINTER, (lispobj)current_dynamic_space); + SetSymbolValue(ALLOCATION_POINTER, (lispobj)DYNAMIC_SPACE_START); #endif #endif #endif diff --git a/src/runtime/save.c b/src/runtime/save.c index 3e379a5..aed18ec 100644 --- a/src/runtime/save.c +++ b/src/runtime/save.c @@ -103,7 +103,7 @@ save(char *filename, lispobj init_function) * MBs of just cleared heap. */ if(SymbolValue(X86_CGC_ACTIVE_P) != NIL) - SetSymbolValue(ALLOCATION_POINTER,DYNAMIC_0_SPACE_START); + SetSymbolValue(ALLOCATION_POINTER, DYNAMIC_SPACE_START); #endif /* Open the file: */ unlink(filename); @@ -138,8 +138,8 @@ save(char *filename, lispobj init_function) output_space(file, STATIC_SPACE_ID, static_space, (lispobj *)SymbolValue(STATIC_SPACE_FREE_POINTER)); #ifdef reg_ALLOC - output_space(file, DYNAMIC_SPACE_ID, current_dynamic_space, - current_dynamic_space_free_pointer); + output_space(file, DYNAMIC_SPACE_ID, DYNAMIC_SPACE_START, + dynamic_space_free_pointer); #else #ifdef GENCGC /* Flush the current_region updating the tables. */ @@ -147,7 +147,7 @@ save(char *filename, lispobj init_function) gc_alloc_update_page_tables(1,&unboxed_region); update_x86_dynamic_space_free_pointer(); #endif - output_space(file, DYNAMIC_SPACE_ID, current_dynamic_space, + output_space(file, DYNAMIC_SPACE_ID, DYNAMIC_SPACE_START, (lispobj *)SymbolValue(ALLOCATION_POINTER)); #endif diff --git a/src/runtime/validate.c b/src/runtime/validate.c index 63a5623..d3e6c7c 100644 --- a/src/runtime/validate.c +++ b/src/runtime/validate.c @@ -72,16 +72,7 @@ void validate(void) ensure_space(static_space, STATIC_SPACE_SIZE); /* Dynamic-0 Space */ - dynamic_0_space = (lispobj *) DYNAMIC_0_SPACE_START; - ensure_space(dynamic_0_space, DYNAMIC_SPACE_SIZE); - - current_dynamic_space = dynamic_0_space; - - /* Dynamic-1 Space */ - dynamic_1_space = (lispobj *) DYNAMIC_1_SPACE_START; -#ifndef GENCGC - ensure_space(dynamic_1_space, DYNAMIC_SPACE_SIZE); -#endif + ensure_space(DYNAMIC_SPACE_START, DYNAMIC_SPACE_SIZE); /* Control Stack */ control_stack = (lispobj *) CONTROL_STACK_START; diff --git a/src/runtime/x86-validate.h b/src/runtime/x86-validate.h index 38eeb81..e7cefb3 100644 --- a/src/runtime/x86-validate.h +++ b/src/runtime/x86-validate.h @@ -64,12 +64,7 @@ #define CONTROL_STACK_START (0x40000000) #define CONTROL_STACK_SIZE (0x08000000) /* 128MB */ -#define DYNAMIC_0_SPACE_START (0x48000000) -#ifdef GENCGC -#define DYNAMIC_SPACE_SIZE (0x40000000) /* May be up to 2GB */ -#else -#define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */ -#endif +#define DYNAMIC_SPACE_SIZE (0x40000000) /* may be up to 2GB */ #endif /* FIXME: It's gross to have numbers like 0x50000000 wired into the @@ -94,15 +89,7 @@ #define CONTROL_STACK_START (0x50000000) #define CONTROL_STACK_SIZE (0x07fff000) /* 128MB - 1 page */ -#define DYNAMIC_0_SPACE_START (0x09000000) -#ifdef GENCGC #define DYNAMIC_SPACE_SIZE (0x20000000) /* 512MB */ -#else -#define DYNAMIC_SPACE_SIZE (0x04000000) /* 64MB */ -#endif #endif #define CONTROL_STACK_END (CONTROL_STACK_START + CONTROL_STACK_SIZE) - -/* Note that GENCGC only uses dynamic_space 0. */ -#define DYNAMIC_1_SPACE_START (DYNAMIC_0_SPACE_START + DYNAMIC_SPACE_SIZE) diff --git a/version.lisp-expr b/version.lisp-expr index 10fa3e6..5521f55 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -15,4 +15,4 @@ ;;; versions, and a string a la "0.6.5.12" is used for versions which ;;; aren't released but correspond only to CVS tags or snapshots. -"0.6.7.11" +"0.6.7.13"