[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 25/87: Remove hashset slots from GOOPS classes
From: |
Andy Wingo |
Subject: |
[Guile-commits] 25/87: Remove hashset slots from GOOPS classes |
Date: |
Thu, 22 Jan 2015 17:29:49 +0000 |
wingo pushed a commit to branch wip-goops-refactor
in repository guile.
commit 85b4f42a9436a552c613d1b48a92250dd873ac07
Author: Andy Wingo <address@hidden>
Date: Tue Jan 6 14:24:27 2015 -0500
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.
---
libguile/goops.c | 15 ---------------
libguile/goops.h | 37 +++++++++----------------------------
module/oop/goops.scm | 8 --------
3 files changed, 9 insertions(+), 51 deletions(-)
diff --git a/libguile/goops.c b/libguile/goops.c
index dcc8503..5e3ea48 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -448,8 +448,6 @@ SCM_DEFINE (scm_sys_init_layout_x, "%init-layout!", 2, 0, 0,
}
#undef FUNC_NAME
-static void prep_hashsets (SCM);
-
SCM_DEFINE (scm_sys_inherit_magic_x, "%inherit-magic!", 2, 0, 0,
(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_SET_CLASS_FLAGS (class, SCM_CLASSF_GOOPS_OR_VALID);
- prep_hashsets (class);
-
return SCM_UNSPECIFIED;
}
#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
@@ -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_redefined, SCM_BOOL_F);
- prep_hashsets (z);
-
return z;
}
#undef FUNC_NAME
diff --git a/libguile/goops.h b/libguile/goops.h
index 657c8ff..077efc6 100644
--- a/libguile/goops.h
+++ b/libguile/goops.h
@@ -63,14 +63,6 @@
/* see also, SCM_VTABLE_BASE_LAYOUT, and build_class_class_slots */
#define SCM_CLASS_CLASS_LAYOUT \
"pw" /* redefined */ \
- "uw" /* h0 */ \
- "uw" /* h1 */ \
- "uw" /* h2 */ \
- "uw" /* h3 */ \
- "uw" /* h4 */ \
- "uw" /* h5 */ \
- "uw" /* h6 */ \
- "uw" /* h7 */ \
"pw" /* direct supers */ \
"pw" /* direct slots */ \
"pw" /* direct subclasses */ \
@@ -81,24 +73,15 @@
"pw" /* nfields */
#define scm_si_redefined (scm_vtable_offset_user + 0)
-#define scm_si_h0 (scm_vtable_offset_user + 1)
-#define scm_si_hashsets scm_si_h0
-#define scm_si_h1 (scm_vtable_offset_user + 2)
-#define scm_si_h2 (scm_vtable_offset_user + 3)
-#define scm_si_h3 (scm_vtable_offset_user + 4)
-#define scm_si_h4 (scm_vtable_offset_user + 5)
-#define scm_si_h5 (scm_vtable_offset_user + 6)
-#define scm_si_h6 (scm_vtable_offset_user + 7)
-#define scm_si_h7 (scm_vtable_offset_user + 8)
-#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_si_direct_supers (scm_vtable_offset_user + 1) /* (class ...) */
+#define scm_si_direct_slots (scm_vtable_offset_user + 2) /* ((name .
options) ...) */
+#define scm_si_direct_subclasses (scm_vtable_offset_user + 3) /* (class ...) */
+#define scm_si_direct_methods (scm_vtable_offset_user + 4) /* (methods ...)
*/
+#define scm_si_cpl (scm_vtable_offset_user + 5) /* (class ...) */
+#define scm_si_slots (scm_vtable_offset_user + 6) /* ((name .
options) ...) */
+#define scm_si_getters_n_setters (scm_vtable_offset_user + 7)
+#define scm_si_nfields (scm_vtable_offset_user + 8) /* an integer */
+#define SCM_N_CLASS_SLOTS (scm_vtable_offset_user + 9)
#define SCM_OBJ_CLASS_REDEF(x) (SCM_PACK (SCM_STRUCT_VTABLE_DATA (x)
[scm_si_redefined]))
#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_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_IS_A_P(x, c) \
diff --git a/module/oop/goops.scm b/module/oop/goops.scm
index bac9600..70edcfe 100644
--- a/module/oop/goops.scm
+++ b/module/oop/goops.scm
@@ -226,14 +226,6 @@
(specialized-slot reserved-0 <hidden-slot>)
(specialized-slot reserved-1 <hidden-slot>)
(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-slots)
(unspecialized-slot direct-subclasses)
- [Guile-commits] 13/87: `class' is a hygienic macro, (continued)
- [Guile-commits] 13/87: `class' is a hygienic macro, Andy Wingo, 2015/01/22
- [Guile-commits] 14/87: define-generic, define-extended-generic are hygienic syntax, Andy Wingo, 2015/01/22
- [Guile-commits] 15/87: Remove unused *goops-module* definition., Andy Wingo, 2015/01/22
- [Guile-commits] 17/87: Remove unused scm_t_method and SCM_METHOD, Andy Wingo, 2015/01/22
- [Guile-commits] 20/87: Remove useless scm_s_slot_set_x export, Andy Wingo, 2015/01/22
- [Guile-commits] 18/87: Deprecate scm_no_applicable_method C export, Andy Wingo, 2015/01/22
- [Guile-commits] 21/87: Remove unused `default-slot-definition-class' <class> slot, Andy Wingo, 2015/01/22
- [Guile-commits] 22/87: Remove unused CPP defines naming <method> slots, Andy Wingo, 2015/01/22
- [Guile-commits] 19/87: Remove unreachable code in scm_setter, Andy Wingo, 2015/01/22
- [Guile-commits] 26/87: Remove scm_at_assert_bound_ref, Andy Wingo, 2015/01/22
- [Guile-commits] 25/87: Remove hashset slots from GOOPS classes,
Andy Wingo <=
- [Guile-commits] 29/87: More unused code removal in GOOPS, Andy Wingo, 2015/01/22
- [Guile-commits] 23/87: Generics with setters have <applicable-struct-with-setter> layout, Andy Wingo, 2015/01/22
- [Guile-commits] 30/87: Remove unused union scm_t_debug_info, Andy Wingo, 2015/01/22
- [Guile-commits] 27/87: Remove scm_assert_bound, Andy Wingo, 2015/01/22
- [Guile-commits] 32/87: Remove GOOPS random state, Andy Wingo, 2015/01/22
- [Guile-commits] 28/87: Remove private var_no_applicable_method capture, Andy Wingo, 2015/01/22
- [Guile-commits] 31/87: More goops.c cleanups, and fix a security issue, Andy Wingo, 2015/01/22
- [Guile-commits] 34/87: Statically compute offsets for slots of <class> in Scheme, Andy Wingo, 2015/01/22
- [Guile-commits] 33/87: Refactor to <class> slot computation, Andy Wingo, 2015/01/22
- [Guile-commits] 11/87: Move GOOPS boot to Scheme, Andy Wingo, 2015/01/22