summaryrefslogtreecommitdiff
path: root/libguile/goops.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-12-05 10:52:18 +0100
committerAndy Wingo <wingo@pobox.com>2009-12-05 10:52:18 +0100
commit9ea31741dad29ae123e468a203b72df6d190f6e1 (patch)
treebc1424d37a358b5f4fcfa756492134517ad07b32 /libguile/goops.c
parentc99de5aa275b15af207c0dba9717d6b865684fc4 (diff)
downloadguile-9ea31741dad29ae123e468a203b72df6d190f6e1.tar.gz
fluids are tc7 objects
If you're wondering what I'm doing, I'm trying to eventually reimplement smobs in terms of structs, so that applicable smobs can just follow the applicable struct dispatch path. But to do that I have to get structs initialized before things that use smobs, which means transforming a bunch of smobby things to tc7 things. But this transformation is good for performance anyway, and we currently have a glut of unused tc7s, so here we go... * libguile/tags.h (scm_tc7_fluid, scm_tc7_dynamic_state): Fluids (and dynamic states) now have tc7s. * libguile/fluids.h: Remove scm_fluids_prehistory, and add internal scm_i_fluid_print. Update a comment. * libguile/fluids.c: Update for tc7 representation. Also remove the next pointers while we're at it, as they aren't used in the new BDW GC. * libguile/eq.c (scm_equal_p): Remove the hashtable case. Hashtables could never be equal? before, I don't see why to add stubs doing the same thing now. * libguile/print.c (iprin1): * libguile/gc.c (scm_i_tag_name): * libguile/evalext.c (scm_self_evaluating_p): Add fluid and dynamic_state cases. * libguile/goops.h: Remove scm_class_hashtable; it will be static. * libguile/goops.c: Make <hashtable> static, and add <fluid> and <dynamic-state> classes. * libguile/hashtab.h: * libguile/hashtab.c: Remove scm_i_hashtable_equal_p. * libguile/init.c (scm_i_init_guile): Remove call to fluids_prehistory.
Diffstat (limited to 'libguile/goops.c')
-rw-r--r--libguile/goops.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/libguile/goops.c b/libguile/goops.c
index d02257bbc..18332168f 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -133,7 +133,7 @@ static scm_t_rstate *goops_rstate;
SCM scm_class_boolean, scm_class_char, scm_class_pair;
SCM scm_class_procedure, scm_class_string, scm_class_symbol;
SCM scm_class_procedure_with_setter, scm_class_primitive_generic;
-SCM scm_class_vector, scm_class_hashtable, scm_class_null;
+SCM scm_class_vector, scm_class_null;
SCM scm_class_integer, scm_class_real, scm_class_complex, scm_class_fraction;
SCM scm_class_unknown;
SCM scm_class_top, scm_class_object, scm_class_class;
@@ -158,6 +158,10 @@ SCM scm_class_protected_hidden, scm_class_protected_opaque, scm_class_protected_
SCM scm_class_scm;
SCM scm_class_int, scm_class_float, scm_class_double;
+static SCM class_hashtable;
+static SCM class_fluid;
+static SCM class_dynamic_state;
+
/* Port classes. Allocate 3 times the maximum number of port types so that
input ports, output ports, and in/out ports can be stored at different
offsets. See `SCM_IN_PCLASS_INDEX' et al. */
@@ -211,7 +215,11 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0,
case scm_tc7_wvect:
return scm_class_vector;
case scm_tc7_hashtable:
- return scm_class_hashtable;
+ return class_hashtable;
+ case scm_tc7_fluid:
+ return class_fluid;
+ case scm_tc7_dynamic_state:
+ return class_dynamic_state;
case scm_tc7_string:
return scm_class_string;
case scm_tc7_number:
@@ -2402,7 +2410,11 @@ create_standard_classes (void)
scm_class_class, scm_class_top, SCM_EOL);
make_stdcls (&scm_class_vector, "<vector>",
scm_class_class, scm_class_top, SCM_EOL);
- make_stdcls (&scm_class_hashtable, "<hashtable>",
+ make_stdcls (&class_hashtable, "<hashtable>",
+ scm_class_class, scm_class_top, SCM_EOL);
+ make_stdcls (&class_fluid, "<fluid>",
+ scm_class_class, scm_class_top, SCM_EOL);
+ make_stdcls (&class_dynamic_state, "<dynamic-state>",
scm_class_class, scm_class_top, SCM_EOL);
make_stdcls (&scm_class_number, "<number>",
scm_class_class, scm_class_top, SCM_EOL);