Renumber IFLAGSs so the first 8 are reserved for lisp booleans.
authorMark H Weaver <mhw@netris.org>
Sat, 27 Mar 2010 21:35:46 +0000 (17:35 -0400)
committerAndy Wingo <wingo@pobox.com>
Sun, 28 Mar 2010 12:34:19 +0000 (14:34 +0200)
This enables more efficient implementations of several operations,
e.g. scm_is_lisp_bool, canonicalize_boolean, fast_boolean_not,
converting SCM booleans to C booleans, etc.

* libguile/tags.h: Renumber IFLAGs.

* libguile/print.c: Renumber iflagnames to match.

* libguile/boolean.c:
* libguile/boolean.h:
  SCM_XXX_ANOTHER_BOOLEAN_DONT_USE --> SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0

libguile/boolean.c
libguile/boolean.h
libguile/print.c
libguile/tags.h

index 1ca0d78531fde103cdc4c21018d42b65925b18df..3391d6ce526a52353b8b342a364fbcb116e4053a 100644 (file)
@@ -49,7 +49,7 @@ verify (SCM_VALUES_DIFFER_IN_EXACTLY_ONE_BIT_POSITION         \
                (SCM_ELISP_NIL, SCM_EOL));
 verify (SCM_VALUES_DIFFER_IN_EXACTLY_TWO_BIT_POSITIONS         \
                (SCM_ELISP_NIL, SCM_BOOL_F, SCM_BOOL_T,         \
-                SCM_XXX_ANOTHER_BOOLEAN_DONT_USE));
+                SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0));
 verify (SCM_VALUES_DIFFER_IN_EXACTLY_TWO_BIT_POSITIONS         \
                (SCM_ELISP_NIL, SCM_BOOL_F, SCM_EOL,            \
                 SCM_XXX_ANOTHER_LISP_FALSE_DONT_USE));
index ba5313ca46c8ca318a2ea10ef36fe12ec6aeb3cb..bc108f5c33dc3a34122b8a9c7f3dbcee3b8f7ad0 100644 (file)
@@ -75,7 +75,7 @@
  *
  * If SCM_ENABLE_ELISP is true, then scm_is_bool_or_nil(x)
  * returns 1 if and only if x is one of the following: SCM_BOOL_F,
- * SCM_BOOL_T, SCM_ELISP_NIL, or SCM_XXX_ANOTHER_BOOLEAN_DONT_USE.
+ * SCM_BOOL_T, SCM_ELISP_NIL, or SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0.
  * Otherwise, it returns 0.
  */
 #if SCM_ENABLE_ELISP
index 8867e6b0342acd61bd40f99b9ea26f50f6830215..ca38d42d595eee0cf9deed23d36d53d42a1800a8 100644 (file)
@@ -68,7 +68,9 @@ static const char *iflagnames[] =
   "#<XXX UNUSED LISP FALSE -- DO NOT USE -- SHOULD NEVER BE SEEN XXX>",
   "()",
   "#t",
-  "#<XXX UNUSED BOOLEAN -- DO NOT USE -- SHOULD NEVER BE SEEN XXX>",
+  "#<XXX UNUSED BOOLEAN 0 -- DO NOT USE -- SHOULD NEVER BE SEEN XXX>",
+  "#<XXX UNUSED BOOLEAN 1 -- DO NOT USE -- SHOULD NEVER BE SEEN XXX>",
+  "#<XXX UNUSED BOOLEAN 2 -- DO NOT USE -- SHOULD NEVER BE SEEN XXX>",
   "#<unspecified>",
   "#<undefined>",
   "#<eof>",
index 2e6dea22ef18937da74290785f7562c3ecff5e71..d11bf6864d4b7ae9f236dd112f3edfaf21ae49ef 100644 (file)
@@ -498,7 +498,7 @@ enum scm_tc8_tags
  *   must all be equal except for two bit positions.
  *   (used to implement scm_is_lisp_false)
  *
- * - SCM_ELISP_NIL, SCM_BOOL_F, SCM_BOOL_T, SCM_XXX_ANOTHER_BOOLEAN_DONT_USE
+ * - SCM_ELISP_NIL, SCM_BOOL_F, SCM_BOOL_T, SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0
  *   must all be equal except for two bit positions.
  *   (used to implement scm_is_bool_or_nil)
  *
@@ -519,12 +519,14 @@ enum scm_tc8_tags
 #define SCM_BOOL_T             SCM_MAKIFLAG (4)
 
 #ifdef BUILDING_LIBGUILE
-#define SCM_XXX_ANOTHER_BOOLEAN_DONT_USE       SCM_MAKIFLAG (5)
+#define SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0     SCM_MAKIFLAG (5)
+#define SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_1     SCM_MAKIFLAG (6)
+#define SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_2     SCM_MAKIFLAG (7)
 #endif
 
-#define SCM_UNSPECIFIED                SCM_MAKIFLAG (6)
-#define SCM_UNDEFINED          SCM_MAKIFLAG (7)
-#define SCM_EOF_VAL            SCM_MAKIFLAG (8)
+#define SCM_UNSPECIFIED                SCM_MAKIFLAG (8)
+#define SCM_UNDEFINED          SCM_MAKIFLAG (9)
+#define SCM_EOF_VAL            SCM_MAKIFLAG (10)
 
 /* When a variable is unbound this is marked by the SCM_UNDEFINED
  * value.  The following is an unbound value which can be handled on
@@ -534,7 +536,7 @@ enum scm_tc8_tags
  * the code which handles this value in C so that SCM_UNDEFINED can be
  * used instead.  It is not ideal to let this kind of unique and
  * strange values loose on the Scheme level.  */
-#define SCM_UNBOUND            SCM_MAKIFLAG (9)
+#define SCM_UNBOUND            SCM_MAKIFLAG (11)
 
 #define SCM_UNBNDP(x)          (scm_is_eq ((x), SCM_UNDEFINED))