X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fgc-common.c;h=26bc938b8a803ecd4d31d8eaa5a8496362b6ac06;hb=531b03cfcbc4071c5283309f05d9186e051e5513;hp=08baf7488ab1b260740fe67c93d3dd14939015b9;hpb=902e93736a0888aa6b04dc328b1eb328423bf426;p=sbcl.git diff --git a/src/runtime/gc-common.c b/src/runtime/gc-common.c index 08baf74..26bc938 100644 --- a/src/runtime/gc-common.c +++ b/src/runtime/gc-common.c @@ -42,6 +42,7 @@ #include #include +#include #include "runtime.h" #include "sbcl.h" #include "os.h" @@ -112,7 +113,6 @@ copy_object(lispobj object, int nwords) { int tag; lispobj *new; - lispobj *source, *dest; gc_assert(is_lisp_pointer(object)); gc_assert(from_space_p(object)); @@ -124,18 +124,8 @@ copy_object(lispobj object, int nwords) /* Allocate space. */ new = gc_general_alloc(nwords*4,ALLOC_BOXED,ALLOC_QUICK); - dest = new; - source = (lispobj *) native_pointer(object); - /* Copy the object. */ - while (nwords > 0) { - dest[0] = source[0]; - dest[1] = source[1]; - dest += 2; - source += 2; - nwords -= 2; - } - + memcpy(new,native_pointer(object),nwords*4); return make_lispobj(new,tag); } @@ -144,14 +134,12 @@ static int scav_lose(lispobj *where, lispobj object); /* forward decl */ /* FIXME: Most calls end up going to some trouble to compute an * 'n_words' value for this function. The system might be a little * simpler if this function used an 'end' parameter instead. */ - void scavenge(lispobj *start, long n_words) { lispobj *end = start + n_words; lispobj *object_ptr; int n_words_scavenged; - for (object_ptr = start; object_ptr < end; object_ptr += n_words_scavenged) { @@ -233,7 +221,6 @@ scav_fun_pointer(lispobj *where, lispobj object) switch (widetag_of(*first_pointer)) { case SIMPLE_FUN_HEADER_WIDETAG: - case CLOSURE_FUN_HEADER_WIDETAG: copy = trans_fun_header(object); break; default: @@ -328,7 +315,7 @@ trans_code(struct code *code) /* fix self pointer. */ nfheaderp->self = -#ifdef LISP_FEATURE_GENCGC /* GENCGC? Maybe x86 is better conditional */ +#ifdef LISP_FEATURE_X86 FUN_RAW_ADDR_OFFSET + #endif nfheaderl; @@ -1536,10 +1523,18 @@ gc_init_tables(void) scav_vector_unsigned_byte_2; scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] = scav_vector_unsigned_byte_4; + scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_7_WIDETAG] = + scav_vector_unsigned_byte_8; scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_8_WIDETAG] = scav_vector_unsigned_byte_8; + scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_15_WIDETAG] = + scav_vector_unsigned_byte_16; scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_16_WIDETAG] = scav_vector_unsigned_byte_16; + scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_29_WIDETAG] = + scav_vector_unsigned_byte_32; + scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_31_WIDETAG] = + scav_vector_unsigned_byte_32; scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_32_WIDETAG] = scav_vector_unsigned_byte_32; #ifdef SIMPLE_ARRAY_SIGNED_BYTE_8_WIDETAG @@ -1582,7 +1577,6 @@ gc_init_tables(void) scavtab[CODE_HEADER_WIDETAG] = scav_code_header; #ifndef LISP_FEATURE_GENCGC /* FIXME ..._X86 ? */ scavtab[SIMPLE_FUN_HEADER_WIDETAG] = scav_fun_header; - scavtab[CLOSURE_FUN_HEADER_WIDETAG] = scav_fun_header; scavtab[RETURN_PC_HEADER_WIDETAG] = scav_return_pc_header; #endif #ifdef LISP_FEATURE_X86 @@ -1633,10 +1627,18 @@ gc_init_tables(void) trans_vector_unsigned_byte_2; transother[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] = trans_vector_unsigned_byte_4; + transother[SIMPLE_ARRAY_UNSIGNED_BYTE_7_WIDETAG] = + trans_vector_unsigned_byte_8; transother[SIMPLE_ARRAY_UNSIGNED_BYTE_8_WIDETAG] = trans_vector_unsigned_byte_8; + transother[SIMPLE_ARRAY_UNSIGNED_BYTE_15_WIDETAG] = + trans_vector_unsigned_byte_16; transother[SIMPLE_ARRAY_UNSIGNED_BYTE_16_WIDETAG] = trans_vector_unsigned_byte_16; + transother[SIMPLE_ARRAY_UNSIGNED_BYTE_29_WIDETAG] = + trans_vector_unsigned_byte_32; + transother[SIMPLE_ARRAY_UNSIGNED_BYTE_31_WIDETAG] = + trans_vector_unsigned_byte_32; transother[SIMPLE_ARRAY_UNSIGNED_BYTE_32_WIDETAG] = trans_vector_unsigned_byte_32; #ifdef SIMPLE_ARRAY_SIGNED_BYTE_8_WIDETAG @@ -1682,7 +1684,6 @@ gc_init_tables(void) transother[COMPLEX_ARRAY_WIDETAG] = trans_boxed; transother[CODE_HEADER_WIDETAG] = trans_code_header; transother[SIMPLE_FUN_HEADER_WIDETAG] = trans_fun_header; - transother[CLOSURE_FUN_HEADER_WIDETAG] = trans_fun_header; transother[RETURN_PC_HEADER_WIDETAG] = trans_return_pc_header; transother[CLOSURE_HEADER_WIDETAG] = trans_boxed; transother[FUNCALLABLE_INSTANCE_HEADER_WIDETAG] = trans_boxed; @@ -1734,10 +1735,18 @@ gc_init_tables(void) size_vector_unsigned_byte_2; sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] = size_vector_unsigned_byte_4; + sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_7_WIDETAG] = + size_vector_unsigned_byte_8; sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_8_WIDETAG] = size_vector_unsigned_byte_8; + sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_15_WIDETAG] = + size_vector_unsigned_byte_16; sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_16_WIDETAG] = size_vector_unsigned_byte_16; + sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_29_WIDETAG] = + size_vector_unsigned_byte_32; + sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_31_WIDETAG] = + size_vector_unsigned_byte_32; sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_32_WIDETAG] = size_vector_unsigned_byte_32; #ifdef SIMPLE_ARRAY_SIGNED_BYTE_8_WIDETAG @@ -1781,7 +1790,6 @@ gc_init_tables(void) #if 0 /* We shouldn't see these, so just lose if it happens. */ sizetab[SIMPLE_FUN_HEADER_WIDETAG] = size_function_header; - sizetab[CLOSURE_FUN_HEADER_WIDETAG] = size_function_header; sizetab[RETURN_PC_HEADER_WIDETAG] = size_return_pc_header; #endif sizetab[CLOSURE_HEADER_WIDETAG] = size_boxed;