Currently failing some guardian tests.
* libguile/tags.h: Refactor tagging so that tc3 bits for a pair live in
the SCM value, not in the heap words. Do the same for structs. This
more rational tagging strategy will make native code generation
easier. Note that this means that to check a heap pointer for its
type, you first have to ensure that it has the expected tc3, as not
all the type bits are on the heap.
(SCM_TYP3): Check the SCM tag type, not the bits in the cell.
(SCM_HAS_TYP3): New helper.
(SCM_I_CONSP): Redefine to just check the typ3.
(scm_tcs_cons_imcar, scm_tcs_cons_nimcar, scm_tcs_struct): Remove, as
they are no longer necessary.
* libguile/array-handle.c (scm_i_array_implementation_for_obj): Check
for heap objects before checking type bits, so we don't check pairs.
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/gc.c (scm_i_tag_name):
* libguile/goops.c (scm_class_of)
* libguile/hash.c (scm_hasher):
* libguile/print.c (iprin1): Adapt to tagging changes.
* libguile/gc.c (scm_storage_prehistory): Register all displacements
here. There are the same displacements as before, unfortunately.
* libguile/list.c (SCM_I_CONS):
* libguile/pairs.c (scm_cons):
* libguile/pairs.h (scm_is_pair):
* libguile/vm-engine.h (CONS): Tag pairs with scm_tc3_pair.
* libguile/modules.c (scm_post_boot_init_modules):
* libguile/modules.h (SCM_MODULEP):
* libguile/struct.c (struct_finalizer_trampoline, scm_i_alloc_struct):
(scm_make_vtable_vtable):
* libguile/struct.h (SCM_STRUCTP, SCM_STRUCT_VTABLE_DATA):
(SCM_STRUCT_VTABLE_SLOTS):
* libguile/vm-i-scheme.c (make-struct): Adapt to struct tagging
changes.
* libguile/numbers.h (SCM_I_INUMP):
* module/rnrs/arithmetic/fixnums.scm (fixnum?, inline-fixnum?): Adapt
to the new fixnum tag.
* libguile/numbers.h (SCM_INEXACTP): Make sure of the tc3 before looking
at the cell type.
* libguile/array-handle.c (scm_i_register_array_implementation):
(scm_i_array_implementation_for_obj): Add generic array facility,
which will (in a few commits) detangle the array code.
(scm_array_get_handle): Use the generic array facility. Note that
scm_t_array_handle no longer has ref and set function pointers;
instead it has a pointer to the array implementation. It is unlikely
that code out there used these functions, however, as the supported
way was through scm_array_handle_ref/set_x.
(scm_array_handle_pos): Move this function here from arrays.c.
(scm_array_handle_element_type): New function, returns a Scheme value
representing the type of element stored in this array.
* libguile/array-handle.h (scm_t_array_element_type): New enum, for
generically determining the type of an array.
(scm_array_handle_rank):
(scm_array_handle_dims): These are now just #defines.
* libguile/arrays.c:
* libguile/bitvectors.c:
* libguile/bytevectors.c:
* libguile/srfi-4.c:
* libguile/strings.c:
* libguile/vectors.c: Register array implementations for all of these.
* libguile/inline.h: Update for array_handle_ref/set change.
* libguile/deprecated.h: Need to include arrays.h now.
* libguile/array-handle.c:
* libguile/array-handle.h: Move some parts of unif.c and unif.h to these
new files.
* libguile/unif.c:
* libguile/unif.h: Update includers. Since unif.h depends on the array
handle type, we include array-handle.h, which also means that there
will be no difference for our callers.
* libguile/init.c: Call scm_init_array_handle, though it does nothing as
of yet.
* libguile/Makefile.am: Adapt for new files.