#include <stdio.h>
#include <signal.h>
+#include <string.h>
#include "runtime.h"
#include "sbcl.h"
#include "os.h"
{
int tag;
lispobj *new;
- lispobj *source, *dest;
gc_assert(is_lisp_pointer(object));
gc_assert(from_space_p(object));
/* 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);
}
/* 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) {
switch (widetag_of(*first_pointer)) {
case SIMPLE_FUN_HEADER_WIDETAG:
- case CLOSURE_FUN_HEADER_WIDETAG:
copy = trans_fun_header(object);
break;
default:
/* 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;
return nwords;
}
+#ifndef LISP_FEATURE_X86
static int
scav_return_pc_header(lispobj *where, lispobj object)
{
(unsigned long) object);
return 0; /* bogus return value to satisfy static type checking */
}
+#endif /* LISP_FEATURE_X86 */
static lispobj
trans_return_pc_header(lispobj object)
}
#endif
+#ifndef LISP_FEATURE_X86
static int
scav_fun_header(lispobj *where, lispobj object)
{
(unsigned long) object);
return 0; /* bogus return value to satisfy static type checking */
}
+#endif /* LISP_FEATURE_X86 */
static lispobj
trans_fun_header(lispobj object)
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
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
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
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;
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
#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;