X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fpurify.c;h=992df23c5c4022c5cd36eccb218ece44f2fc32e6;hb=568214ddf4c8ecc881caec98e20848d017974ec0;hp=6f3bb4213377c7940b73883bb2bf33f60305f3a9;hpb=cacfac8c22699a62fefab099866b65f490478571;p=sbcl.git diff --git a/src/runtime/purify.c b/src/runtime/purify.c index 6f3bb42..992df23 100644 --- a/src/runtime/purify.c +++ b/src/runtime/purify.c @@ -33,6 +33,7 @@ #include "thread.h" #include "genesis/primitive-objects.h" #include "genesis/static-symbols.h" +#include "genesis/layout.h" #define PRINTNOISE @@ -90,7 +91,7 @@ static long later_count = 0; /* FIXME: Shouldn't this be defined in sbcl.h? See also notes in * cheneygc.c */ -#ifdef sparc +#ifdef LISP_FEATURE_SPARC #define FUN_RAW_ADDR_OFFSET 0 #else #define FUN_RAW_ADDR_OFFSET (6*sizeof(lispobj) - FUN_POINTER_LOWTAG) @@ -1054,7 +1055,7 @@ ptrans_otherptr(lispobj thing, lispobj header, boolean constant) #ifdef LISP_FEATURE_X86 return ptrans_vector(thing, 96, 0, 0, constant); #endif -#ifdef sparc +#ifdef LISP_FEATURE_SPARC return ptrans_vector(thing, 128, 0, 0, constant); #endif #endif @@ -1074,7 +1075,7 @@ ptrans_otherptr(lispobj thing, lispobj header, boolean constant) #ifdef LISP_FEATURE_X86 return ptrans_vector(thing, 192, 0, 0, constant); #endif -#ifdef sparc +#ifdef LISP_FEATURE_SPARC return ptrans_vector(thing, 256, 0, 0, constant); #endif #endif @@ -1323,7 +1324,7 @@ pscav(lispobj *addr, long nwords, boolean constant) #ifdef LISP_FEATURE_X86 count = fixnum_value(vector->length)*3+2; #endif -#ifdef sparc +#ifdef LISP_FEATURE_SPARC count = fixnum_value(vector->length)*4+2; #endif break; @@ -1343,7 +1344,7 @@ pscav(lispobj *addr, long nwords, boolean constant) #ifdef LISP_FEATURE_X86 count = fixnum_value(vector->length)*6+2; #endif -#ifdef sparc +#ifdef LISP_FEATURE_SPARC count = fixnum_value(vector->length)*8+2; #endif break; @@ -1392,6 +1393,18 @@ pscav(lispobj *addr, long nwords, boolean constant) count = pscav_fdefn((struct fdefn *)addr); break; + case INSTANCE_HEADER_WIDETAG: + { + struct instance *instance = (struct instance *) addr; + struct layout *layout + = (struct layout *) native_pointer(instance->slots[0]); + long nuntagged = fixnum_value(layout->n_untagged_slots); + long nslots = HeaderValue(*addr); + pscav(addr + 1, nslots - nuntagged, constant); + count = CEILING(1 + nslots, 2); + } + break; + default: count = 1; break; @@ -1599,6 +1612,10 @@ purify(lispobj static_roots, lispobj read_only_roots) #endif #endif + /* Blast away instruction cache */ + os_flush_icache((os_vm_address_t)READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE); + os_flush_icache((os_vm_address_t)STATIC_SPACE_START, STATIC_SPACE_SIZE); + #ifdef PRINTNOISE printf(" done]\n"); fflush(stdout);