From: Christophe R. <cr...@us...> - 2003-03-10 14:54:40
|
Update of /cvsroot/sbcl/sbcl/src/runtime In directory sc8-pr-cvs1:/tmp/cvs-serv3225a/src/runtime Modified Files: gc-common.c gencgc.c Log Message: 0.7.13.21: The (ARRAY NIL) has landed. ... implement a SIMPLE-ARRAY-NIL primitive type, including in garbage collection and (ROOM) logic; ... adjust implementation of array creation and reference to deal with arrays that can't contain anything; ... (HAIRY-)DATA-VECTOR-REF are can no longer be FLUSHABLE; Enjoy! Index: gc-common.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/gc-common.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gc-common.c 27 Feb 2003 15:19:49 -0000 1.4 +++ gc-common.c 10 Mar 2003 14:54:29 -0000 1.5 @@ -846,6 +846,26 @@ } static int +scav_vector_nil(lispobj *where, lispobj object) +{ + return 2; +} + +static lispobj +trans_vector_nil(lispobj object) +{ + gc_assert(is_lisp_pointer(object)); + return copy_unboxed_object(object, 2); +} + +static int +size_vector_nil(lispobj *where) +{ + /* Just the header word and the length word */ + return 2; +} + +static int scav_vector_bit(lispobj *where, lispobj object) { struct vector *vector; @@ -1508,6 +1528,7 @@ scavtab[SIMPLE_ARRAY_WIDETAG] = scav_boxed; scavtab[SIMPLE_STRING_WIDETAG] = scav_string; scavtab[SIMPLE_BIT_VECTOR_WIDETAG] = scav_vector_bit; + scavtab[SIMPLE_ARRAY_NIL_WIDETAG] = scav_vector_nil; scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG] = scav_vector_unsigned_byte_2; scavtab[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] = @@ -1603,6 +1624,7 @@ transother[SIMPLE_STRING_WIDETAG] = trans_string; transother[SIMPLE_BIT_VECTOR_WIDETAG] = trans_vector_bit; transother[SIMPLE_VECTOR_WIDETAG] = trans_vector; + transother[SIMPLE_ARRAY_NIL_WIDETAG] = trans_vector_nil; transother[SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG] = trans_vector_unsigned_byte_2; transother[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] = @@ -1702,6 +1724,7 @@ sizetab[SIMPLE_STRING_WIDETAG] = size_string; sizetab[SIMPLE_BIT_VECTOR_WIDETAG] = size_vector_bit; sizetab[SIMPLE_VECTOR_WIDETAG] = size_vector; + sizetab[SIMPLE_ARRAY_NIL_WIDETAG] = size_vector_nil; sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG] = size_vector_unsigned_byte_2; sizetab[SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG] = Index: gencgc.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/gencgc.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- gencgc.c 27 Feb 2003 15:19:52 -0000 1.26 +++ gencgc.c 10 Mar 2003 14:54:30 -0000 1.27 @@ -2306,6 +2306,7 @@ #endif case SIMPLE_STRING_WIDETAG: case SIMPLE_BIT_VECTOR_WIDETAG: + case SIMPLE_ARRAY_NIL_WIDETAG: case SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG: case SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG: case SIMPLE_ARRAY_UNSIGNED_BYTE_8_WIDETAG: @@ -2389,6 +2390,7 @@ case BIGNUM_WIDETAG: case SIMPLE_STRING_WIDETAG: case SIMPLE_BIT_VECTOR_WIDETAG: + case SIMPLE_ARRAY_NIL_WIDETAG: case SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG: case SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG: case SIMPLE_ARRAY_UNSIGNED_BYTE_8_WIDETAG: @@ -3380,6 +3382,7 @@ #endif case SIMPLE_STRING_WIDETAG: case SIMPLE_BIT_VECTOR_WIDETAG: + case SIMPLE_ARRAY_NIL_WIDETAG: case SIMPLE_ARRAY_UNSIGNED_BYTE_2_WIDETAG: case SIMPLE_ARRAY_UNSIGNED_BYTE_4_WIDETAG: case SIMPLE_ARRAY_UNSIGNED_BYTE_8_WIDETAG: |