guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 27/88: Remove hashset slots from GOOPS classes


From: Andy Wingo
Subject: [Guile-commits] 27/88: Remove hashset slots from GOOPS classes
Date: Fri, 23 Jan 2015 15:25:32 +0000

wingo pushed a commit to branch master
in repository guile.

commit e03e31012635102e7296faaa797248823423685b
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 6d8043f..b0266c9 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]