mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Remove hashset slots from GOOPS classes
* libguile/goops.h (SCM_CLASS_CLASS_LAYOUT, SCM_INSTANCE_HASH) (SCM_SET_HASHSET): * libguile/goops.c (prep_hashsets, scm_sys_make_root_class, scm_sys_init_layout_x): * module/oop/goops.scm (build-<class>-slots): Remove hashsets from classes. We haven't implemented hashed dispatch since Guile 1.8, and it's not clear that the particular formulation of dispatch is a good idea.
This commit is contained in:
parent
57898597ad
commit
e03e310126
3 changed files with 9 additions and 51 deletions
|
@ -448,8 +448,6 @@ SCM_DEFINE (scm_sys_init_layout_x, "%init-layout!", 2, 0, 0,
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
static void prep_hashsets (SCM);
|
|
||||||
|
|
||||||
SCM_DEFINE (scm_sys_inherit_magic_x, "%inherit-magic!", 2, 0, 0,
|
SCM_DEFINE (scm_sys_inherit_magic_x, "%inherit-magic!", 2, 0, 0,
|
||||||
(SCM class, SCM dsupers),
|
(SCM class, SCM dsupers),
|
||||||
"")
|
"")
|
||||||
|
@ -459,21 +457,10 @@ SCM_DEFINE (scm_sys_inherit_magic_x, "%inherit-magic!", 2, 0, 0,
|
||||||
scm_i_struct_inherit_vtable_magic (SCM_CLASS_OF (class), class);
|
scm_i_struct_inherit_vtable_magic (SCM_CLASS_OF (class), class);
|
||||||
SCM_SET_CLASS_FLAGS (class, SCM_CLASSF_GOOPS_OR_VALID);
|
SCM_SET_CLASS_FLAGS (class, SCM_CLASSF_GOOPS_OR_VALID);
|
||||||
|
|
||||||
prep_hashsets (class);
|
|
||||||
|
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
static void
|
|
||||||
prep_hashsets (SCM class)
|
|
||||||
{
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 8; ++i)
|
|
||||||
SCM_SET_HASHSET (class, i, scm_c_uniform32 (goops_rstate));
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
|
@ -508,8 +495,6 @@ SCM_DEFINE (scm_sys_make_root_class, "%make-root-class", 3, 0, 0,
|
||||||
SCM_SET_SLOT (z, scm_si_getters_n_setters, getters_n_setters); /* will be changed */
|
SCM_SET_SLOT (z, scm_si_getters_n_setters, getters_n_setters); /* will be changed */
|
||||||
SCM_SET_SLOT (z, scm_si_redefined, SCM_BOOL_F);
|
SCM_SET_SLOT (z, scm_si_redefined, SCM_BOOL_F);
|
||||||
|
|
||||||
prep_hashsets (z);
|
|
||||||
|
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
|
@ -63,14 +63,6 @@
|
||||||
/* see also, SCM_VTABLE_BASE_LAYOUT, and build_class_class_slots */
|
/* see also, SCM_VTABLE_BASE_LAYOUT, and build_class_class_slots */
|
||||||
#define SCM_CLASS_CLASS_LAYOUT \
|
#define SCM_CLASS_CLASS_LAYOUT \
|
||||||
"pw" /* redefined */ \
|
"pw" /* redefined */ \
|
||||||
"uw" /* h0 */ \
|
|
||||||
"uw" /* h1 */ \
|
|
||||||
"uw" /* h2 */ \
|
|
||||||
"uw" /* h3 */ \
|
|
||||||
"uw" /* h4 */ \
|
|
||||||
"uw" /* h5 */ \
|
|
||||||
"uw" /* h6 */ \
|
|
||||||
"uw" /* h7 */ \
|
|
||||||
"pw" /* direct supers */ \
|
"pw" /* direct supers */ \
|
||||||
"pw" /* direct slots */ \
|
"pw" /* direct slots */ \
|
||||||
"pw" /* direct subclasses */ \
|
"pw" /* direct subclasses */ \
|
||||||
|
@ -81,24 +73,15 @@
|
||||||
"pw" /* nfields */
|
"pw" /* nfields */
|
||||||
|
|
||||||
#define scm_si_redefined (scm_vtable_offset_user + 0)
|
#define scm_si_redefined (scm_vtable_offset_user + 0)
|
||||||
#define scm_si_h0 (scm_vtable_offset_user + 1)
|
#define scm_si_direct_supers (scm_vtable_offset_user + 1) /* (class ...) */
|
||||||
#define scm_si_hashsets scm_si_h0
|
#define scm_si_direct_slots (scm_vtable_offset_user + 2) /* ((name . options) ...) */
|
||||||
#define scm_si_h1 (scm_vtable_offset_user + 2)
|
#define scm_si_direct_subclasses (scm_vtable_offset_user + 3) /* (class ...) */
|
||||||
#define scm_si_h2 (scm_vtable_offset_user + 3)
|
#define scm_si_direct_methods (scm_vtable_offset_user + 4) /* (methods ...) */
|
||||||
#define scm_si_h3 (scm_vtable_offset_user + 4)
|
#define scm_si_cpl (scm_vtable_offset_user + 5) /* (class ...) */
|
||||||
#define scm_si_h4 (scm_vtable_offset_user + 5)
|
#define scm_si_slots (scm_vtable_offset_user + 6) /* ((name . options) ...) */
|
||||||
#define scm_si_h5 (scm_vtable_offset_user + 6)
|
#define scm_si_getters_n_setters (scm_vtable_offset_user + 7)
|
||||||
#define scm_si_h6 (scm_vtable_offset_user + 7)
|
#define scm_si_nfields (scm_vtable_offset_user + 8) /* an integer */
|
||||||
#define scm_si_h7 (scm_vtable_offset_user + 8)
|
#define SCM_N_CLASS_SLOTS (scm_vtable_offset_user + 9)
|
||||||
#define scm_si_direct_supers (scm_vtable_offset_user + 9) /* (class ...) */
|
|
||||||
#define scm_si_direct_slots (scm_vtable_offset_user + 10) /* ((name . options) ...) */
|
|
||||||
#define scm_si_direct_subclasses (scm_vtable_offset_user + 11) /* (class ...) */
|
|
||||||
#define scm_si_direct_methods (scm_vtable_offset_user + 12) /* (methods ...) */
|
|
||||||
#define scm_si_cpl (scm_vtable_offset_user + 13) /* (class ...) */
|
|
||||||
#define scm_si_slots (scm_vtable_offset_user + 14) /* ((name . options) ...) */
|
|
||||||
#define scm_si_getters_n_setters (scm_vtable_offset_user + 15)
|
|
||||||
#define scm_si_nfields (scm_vtable_offset_user + 16) /* an integer */
|
|
||||||
#define SCM_N_CLASS_SLOTS (scm_vtable_offset_user + 17)
|
|
||||||
|
|
||||||
#define SCM_OBJ_CLASS_REDEF(x) (SCM_PACK (SCM_STRUCT_VTABLE_DATA (x) [scm_si_redefined]))
|
#define SCM_OBJ_CLASS_REDEF(x) (SCM_PACK (SCM_STRUCT_VTABLE_DATA (x) [scm_si_redefined]))
|
||||||
#define SCM_INST(x) SCM_STRUCT_DATA (x)
|
#define SCM_INST(x) SCM_STRUCT_DATA (x)
|
||||||
|
@ -120,8 +103,6 @@
|
||||||
|
|
||||||
#define SCM_SLOT(x, i) (SCM_STRUCT_SLOT_REF (x, i))
|
#define SCM_SLOT(x, i) (SCM_STRUCT_SLOT_REF (x, i))
|
||||||
#define SCM_SET_SLOT(x, i, v) (SCM_STRUCT_SLOT_SET (x, i, v))
|
#define SCM_SET_SLOT(x, i, v) (SCM_STRUCT_SLOT_SET (x, i, v))
|
||||||
#define SCM_INSTANCE_HASH(c, i) (SCM_INST (c) [scm_si_hashsets + (i)])
|
|
||||||
#define SCM_SET_HASHSET(c, i, h) (SCM_INST (c) [scm_si_hashsets + (i)] = (h))
|
|
||||||
|
|
||||||
#define SCM_SUBCLASSP(c1, c2) (scm_is_true (scm_c_memq (c2, SCM_SLOT (c1, scm_si_cpl))))
|
#define SCM_SUBCLASSP(c1, c2) (scm_is_true (scm_c_memq (c2, SCM_SLOT (c1, scm_si_cpl))))
|
||||||
#define SCM_IS_A_P(x, c) \
|
#define SCM_IS_A_P(x, c) \
|
||||||
|
|
|
@ -226,14 +226,6 @@
|
||||||
(specialized-slot reserved-0 <hidden-slot>)
|
(specialized-slot reserved-0 <hidden-slot>)
|
||||||
(specialized-slot reserved-1 <hidden-slot>)
|
(specialized-slot reserved-1 <hidden-slot>)
|
||||||
(unspecialized-slot redefined)
|
(unspecialized-slot redefined)
|
||||||
(specialized-slot h0 <int-slot>)
|
|
||||||
(specialized-slot h1 <int-slot>)
|
|
||||||
(specialized-slot h2 <int-slot>)
|
|
||||||
(specialized-slot h3 <int-slot>)
|
|
||||||
(specialized-slot h4 <int-slot>)
|
|
||||||
(specialized-slot h5 <int-slot>)
|
|
||||||
(specialized-slot h6 <int-slot>)
|
|
||||||
(specialized-slot h7 <int-slot>)
|
|
||||||
(unspecialized-slot direct-supers)
|
(unspecialized-slot direct-supers)
|
||||||
(unspecialized-slot direct-slots)
|
(unspecialized-slot direct-slots)
|
||||||
(unspecialized-slot direct-subclasses)
|
(unspecialized-slot direct-subclasses)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue