return newspace_copy;
}
-int (*scavtab[256])(lispobj *where, lispobj object);
+long (*scavtab[256])(lispobj *where, lispobj object);
lispobj (*transother[256])(lispobj object);
-int (*sizetab[256])(lispobj *where);
+long (*sizetab[256])(lispobj *where);
struct weak_pointer *weak_pointers;
unsigned long bytes_consed_between_gcs = 12*1024*1024;
/* to copy a boxed object */
lispobj
-copy_object(lispobj object, int nwords)
+copy_object(lispobj object, long nwords)
{
int tag;
lispobj *new;
return make_lispobj(new,tag);
}
-static int scav_lose(lispobj *where, lispobj object); /* forward decl */
+static long 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
{
lispobj *end = start + n_words;
lispobj *object_ptr;
- int n_words_scavenged;
+ long n_words_scavenged;
for (object_ptr = start;
+
object_ptr < end;
object_ptr += n_words_scavenged) {
static lispobj trans_fun_header(lispobj object); /* forward decls */
static lispobj trans_boxed(lispobj object);
-static int
+static long
scav_fun_pointer(lispobj *where, lispobj object)
{
lispobj *first_pointer;
{
struct code *new_code;
lispobj first, l_code, l_new_code;
- int nheader_words, ncode_words, nwords;
+ long nheader_words, ncode_words, nwords;
unsigned long displacement;
lispobj fheaderl, *prev_pointer;
/* fix self pointer. */
nfheaderp->self =
-#ifdef LISP_FEATURE_X86
+#if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
FUN_RAW_ADDR_OFFSET +
#endif
nfheaderl;
fheaderl = fheaderp->next;
prev_pointer = &nfheaderp->next;
}
- os_flush_icache((os_vm_address_t) (((int *)new_code) + nheader_words),
- ncode_words * sizeof(int));
+ os_flush_icache((os_vm_address_t) (((long *)new_code) + nheader_words),
+ ncode_words * sizeof(long));
#ifdef LISP_FEATURE_GENCGC
gencgc_apply_code_fixups(code, new_code);
#endif
return new_code;
}
-static int
+static long
scav_code_header(lispobj *where, lispobj object)
{
struct code *code;
- int n_header_words, n_code_words, n_words;
+ long n_header_words, n_code_words, n_words;
lispobj entry_point; /* tagged pointer to entry point */
struct simple_fun *function_ptr; /* untagged pointer to entry point */
}
-static int
+static long
size_code_header(lispobj *where)
{
struct code *code;
- int nheader_words, ncode_words, nwords;
+ long nheader_words, ncode_words, nwords;
code = (struct code *) where;
return nwords;
}
-#ifndef LISP_FEATURE_X86
-static int
+#ifndef LISP_FEATURE_X86 || LISP_FEATURE_X86_64
+static long
scav_return_pc_header(lispobj *where, lispobj object)
{
lose("attempted to scavenge a return PC header where=0x%08x object=0x%08x",
* objects don't move, we don't need to update anything, but we do
* have to figure out that the function is still live. */
-#ifdef LISP_FEATURE_X86
-static int
+#if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
+static long
scav_closure_header(lispobj *where, lispobj object)
{
struct closure *closure;
}
#endif
-#ifndef LISP_FEATURE_X86
-static int
+#if !(defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64))
+static long
scav_fun_header(lispobj *where, lispobj object)
{
lose("attempted to scavenge a function header where=0x%08x object=0x%08x",
* instances
*/
-static int
+static long
scav_instance_pointer(lispobj *where, lispobj object)
{
lispobj copy, *first_pointer;
static lispobj trans_list(lispobj object);
-static int
+static long
scav_list_pointer(lispobj *where, lispobj object)
{
lispobj first, *first_pointer;
* scavenging and transporting other pointers
*/
-static int
+static long
scav_other_pointer(lispobj *where, lispobj object)
{
lispobj first, *first_pointer;
* immediate, boxed, and unboxed objects
*/
-static int
+static long
size_pointer(lispobj *where)
{
return 1;
}
-static int
+static long
scav_immediate(lispobj *where, lispobj object)
{
return 1;
return NIL; /* bogus return value to satisfy static type checking */
}
-static int
+static long
size_immediate(lispobj *where)
{
return 1;
}
-static int
+static long
scav_boxed(lispobj *where, lispobj object)
{
return 1;
}
-static int
+static long
size_boxed(lispobj *where)
{
lispobj header;
/* Note: on the sparc we don't have to do anything special for fdefns, */
/* 'cause the raw-addr has a function lowtag. */
#ifndef LISP_FEATURE_SPARC
-static int
+static long
scav_fdefn(lispobj *where, lispobj object)
{
struct fdefn *fdefn;
}
#endif
-static int
+static long
scav_unboxed(lispobj *where, lispobj object)
{
unsigned long length;
return copy_unboxed_object(object, length);
}
-static int
+static long
size_unboxed(lispobj *where)
{
lispobj header;
return length;
}
-static int\f
+\f
/* vector-like objects */
-
+static long
scav_base_string(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
/* NOTE: Strings contain one more byte of data than the length */
/* slot indicates. */
trans_base_string(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
-size_character_string(lispobj *where)
+static long
+size_base_string(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
/* NOTE: A string contains one more byte of data (a terminating
* '\0' to help when interfacing with C functions) than indicated
vector = (struct vector *) where;
length = fixnum_value(vector->length) + 1;
- nwords = CEILING(NWORDS(length, 32) + 2, 2);
+ nwords = CEILING(NWORDS(length, 8) + 2, 2);
return nwords;
}
+static long
scav_character_string(lispobj *where, lispobj object)
{
struct vector *vector;
return copy_large_unboxed_object(object, nwords);
}
-static int
-size_base_string(lispobj *where)
+static long
+size_character_string(lispobj *where)
{
struct vector *vector;
int length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length) + 1;
- nwords = CEILING(NWORDS(length, 8) + 2, 2);
+ nwords = CEILING(NWORDS(length, 32) + 2, 2);
return nwords;
}
trans_vector(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_object(object, nwords);
}
-static int
+static long
size_vector(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static int
+static long
scav_vector_nil(lispobj *where, lispobj object)
{
return 2;
return copy_unboxed_object(object, 2);
}
-static int
+static long
size_vector_nil(lispobj *where)
{
/* Just the header word and the length word */
return 2;
}
-static int
+static long
scav_vector_bit(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_bit(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_bit(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static int
+static long
scav_vector_unsigned_byte_2(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_2(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_unsigned_byte_2(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static int
+static long
scav_vector_unsigned_byte_4(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_4(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_unsigned_byte_4(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
}
-static int
+static long
scav_vector_unsigned_byte_8(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_8(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_unsigned_byte_8(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
}
-static int
+static long
scav_vector_unsigned_byte_16(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_16(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_unsigned_byte_16(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static int
+static long
scav_vector_unsigned_byte_32(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_32(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_unsigned_byte_32(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
}
#if N_WORD_BITS == 64
-static int
+static long
scav_vector_unsigned_byte_64(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_unsigned_byte_64(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_unsigned_byte_64(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
}
#endif
-static int
+static long
scav_vector_single_float(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_single_float(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_single_float(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return nwords;
}
-static int
+static long
scav_vector_double_float(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_double_float(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_double_float(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
}
#ifdef SIMPLE_ARRAY_LONG_FLOAT_WIDETAG
-static int
+static long
scav_vector_long_float(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_long_float(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_long_float(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
#ifdef SIMPLE_ARRAY_COMPLEX_SINGLE_FLOAT_WIDETAG
-static int
+static long
scav_vector_complex_single_float(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_complex_single_float(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_complex_single_float(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
#endif
#ifdef SIMPLE_ARRAY_COMPLEX_DOUBLE_FLOAT_WIDETAG
-static int
+static long
scav_vector_complex_double_float(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_complex_double_float(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_complex_double_float(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
#ifdef SIMPLE_ARRAY_COMPLEX_LONG_FLOAT_WIDETAG
-static int
+static long
scav_vector_complex_long_float(lispobj *where, lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
trans_vector_complex_long_float(lispobj object)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
gc_assert(is_lisp_pointer(object));
return copy_large_unboxed_object(object, nwords);
}
-static int
+static long
size_vector_complex_long_float(lispobj *where)
{
struct vector *vector;
- int length, nwords;
+ long length, nwords;
vector = (struct vector *) where;
length = fixnum_value(vector->length);
return copy;
}
-static int
+static long
size_weak_pointer(lispobj *where)
{
return WEAK_POINTER_NWORDS;
* initialization
*/
-static int
+static long
scav_lose(lispobj *where, lispobj object)
{
lose("no scavenge function for object 0x%08x (widetag 0x%x)",
return NIL; /* bogus return value to satisfy static type checking */
}
-static int
+static long
size_lose(lispobj *where)
{
lose("no size function for object at 0x%08x (widetag 0x%x)",
void
gc_init_tables(void)
{
- int i;
+ long i;
/* Set default value in all slots of scavenge table. FIXME
* replace this gnarly sizeof with something based on
scavtab[SIMPLE_FUN_HEADER_WIDETAG] = scav_fun_header;
scavtab[RETURN_PC_HEADER_WIDETAG] = scav_return_pc_header;
#endif
-#ifdef LISP_FEATURE_X86
+#if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
scavtab[CLOSURE_HEADER_WIDETAG] = scav_closure_header;
scavtab[FUNCALLABLE_INSTANCE_HEADER_WIDETAG] = scav_closure_header;
#else