1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-31 17:30:24 +02:00

* tags.h (scm_tags, scm_tc8_tags, scm_tc9_flag, scm_tc8_flag,

scm_tc8_isym): Renamed scm_tags to scm_tc8_tags.  Renamed
	scm_tc9_flag to scm_tc8_flag.  Introduced new identifier
	scm_tc8_isym.  Defined tc8-tags relative to scm_tc3_imm24.
	Defined the tc8-tag for flags to be 0x04, which will mean that
	SCM_BOOL_F will also have the value 0x04 instead of 0x013c.  Due
	to the reduced number of bits and the simpler bit pattern for
	SCM_BOOL_F, certain machines may be able to use more efficient
	processor instructions to deal with SCM_BOOL_F.

	(SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA): Removed.  These have
	never been defined in a released version, thus no need to
	deprecate them.

	(SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Flags now use tc8
	instead of tc9 tags.

	(SCM_ISYMP, SCM_MAKISYM, SCM_ISYMNUM): Isyms now use tc8 instead
	of tc9 tags.

	(SCM_MAKSPCSYM): Removed.  It is almost impossible that user code
	could have used this definition.

	(SCM_IM_AND, SCM_IM_BEGIN, SCM_IM_CASE, SCM_IM_COND, SCM_IM_DO,
	SCM_IM_IF, SCM_IM_LAMBDA, SCM_IM_LET, SCM_IM_LETSTAR,
	SCM_IM_LETREC, SCM_IM_OR, SCM_IM_QUOTE, SCM_IM_SET_X): Now encoded
	as isyms, as special isyms don't exist any more.
This commit is contained in:
Dirk Herrmann 2004-04-18 08:56:27 +00:00
parent e08d2eee17
commit 5065b40d60
3 changed files with 77 additions and 73 deletions

5
NEWS
View file

@ -1088,6 +1088,11 @@ SCM_GLOC_VAL_LOC, scm_make_gloc, scm_gloc_p, scm_tc16_variable
These functions were used in the implementation of the evaluator. It's These functions were used in the implementation of the evaluator. It's
unlikely that they have been used by user code. unlikely that they have been used by user code.
** Removed macro SCM_MAKSPCSYM
This macro was used for defining byte codes of the evaluator. It is almost
impossible that user code has used this macro.
Changes since Guile 1.4: Changes since Guile 1.4:

View file

@ -1,3 +1,33 @@
2004-04-18 Dirk Herrmann <dirk@dirk-herrmanns-seiten.de>
* tags.h (scm_tags, scm_tc8_tags, scm_tc9_flag, scm_tc8_flag,
scm_tc8_isym): Renamed scm_tags to scm_tc8_tags. Renamed
scm_tc9_flag to scm_tc8_flag. Introduced new identifier
scm_tc8_isym. Defined tc8-tags relative to scm_tc3_imm24.
Defined the tc8-tag for flags to be 0x04, which will mean that
SCM_BOOL_F will also have the value 0x04 instead of 0x013c. Due
to the reduced number of bits and the simpler bit pattern for
SCM_BOOL_F, certain machines may be able to use more efficient
processor instructions to deal with SCM_BOOL_F.
(SCM_ITAG9, SCM_MAKE_ITAG9, SCM_ITAG9_DATA): Removed. These have
never been defined in a released version, thus no need to
deprecate them.
(SCM_IFLAGP, SCM_MAKIFLAG, SCM_IFLAGNUM): Flags now use tc8
instead of tc9 tags.
(SCM_ISYMP, SCM_MAKISYM, SCM_ISYMNUM): Isyms now use tc8 instead
of tc9 tags.
(SCM_MAKSPCSYM): Removed. It is almost impossible that user code
could have used this definition.
(SCM_IM_AND, SCM_IM_BEGIN, SCM_IM_CASE, SCM_IM_COND, SCM_IM_DO,
SCM_IM_IF, SCM_IM_LAMBDA, SCM_IM_LET, SCM_IM_LETSTAR,
SCM_IM_LETREC, SCM_IM_OR, SCM_IM_QUOTE, SCM_IM_SET_X): Now encoded
as isyms, as special isyms don't exist any more.
2004-04-18 Kevin Ryde <user42@zip.com.au> 2004-04-18 Kevin Ryde <user42@zip.com.au>
* filesys.c (scm_readdir): Use readdir_r when available, for thread * filesys.c (scm_readdir): Use readdir_r when available, for thread

View file

@ -3,7 +3,8 @@
#ifndef SCM_TAGS_H #ifndef SCM_TAGS_H
#define SCM_TAGS_H #define SCM_TAGS_H
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
* Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -321,18 +322,11 @@ typedef unsigned long scm_t_bits;
* value and sign. Thus, the only scheme objects for which a further * value and sign. Thus, the only scheme objects for which a further
* subdivision is of interest are the ones with tc3==100. * subdivision is of interest are the ones with tc3==100.
* *
* tc7, tc8, tc9 (for objects with tc3==100): * tc8 (for objects with tc3==100):
* 00-0000-100: \ evaluator byte codes ('short instructions'). The byte * 00000-100: special objects ('flags')
* ... } code interpreter can dispatch on them in one step based * 00001-100: characters
* 00-1100-100: / on their tc7 value. * 00010-100: evaluator byte codes ('ilocs')
* 00-1101-100: evaluator byte codes ('long instructions'). The byte code * 00011-100: evaluator byte codes ('isyms')
* interpreter needs to dispatch on them in two steps: The
* first dispatch is based on the tc7-code. The second
* dispatch is based on the actual byte code that is extracted
* from the upper bits.
* x1-1110-100: evaluator byte codes ('ilocs')
* x1-1111-100: characters with x as their least significant bit
* 10-1111-100: various constants ('flags')
* *
* *
* Summary of type codes on the heap * Summary of type codes on the heap
@ -491,32 +485,30 @@ typedef unsigned long scm_t_bits;
#define scm_tc_free_cell (scm_tc7_smob + 0 * 256L) #define scm_tc_free_cell (scm_tc7_smob + 0 * 256L)
/* {Immediate Values} /* {Immediate Values}
*/ */
enum scm_tags enum scm_tc8_tags
{ {
scm_tc8_iloc = 0xf4, scm_tc8_flag = scm_tc3_imm24 + 0x00, /* special objects ('flags') */
scm_tc8_char = 0xfc, scm_tc8_char = scm_tc3_imm24 + 0x08, /* characters */
scm_tc9_flag = 0x17c scm_tc8_isym = scm_tc3_imm24 + 0x10, /* evaluator byte codes ('isyms') */
scm_tc8_iloc = scm_tc3_imm24 + 0x18 /* evaluator byte codes ('ilocs') */
}; };
#define SCM_ITAG8(X) (SCM_UNPACK (X) & 0xff) #define SCM_ITAG8(X) (SCM_UNPACK (X) & 0xff)
#define SCM_MAKE_ITAG8(X, TAG) SCM_PACK (((X) << 8) + TAG) #define SCM_MAKE_ITAG8(X, TAG) SCM_PACK (((X) << 8) + TAG)
#define SCM_ITAG8_DATA(X) (SCM_UNPACK (X) >> 8) #define SCM_ITAG8_DATA(X) (SCM_UNPACK (X) >> 8)
#define SCM_ITAG9(X) (SCM_UNPACK (X) & 0x1ff)
#define SCM_MAKE_ITAG9(X, TAG) SCM_PACK (((X) << 9) + TAG)
#define SCM_ITAG9_DATA(X) (SCM_UNPACK (X) >> 9)
/* Flags (various constants and special objects). The indices of the flags
* must agree with the declarations in print.c: iflagnames. */
#define SCM_IFLAGP(n) (SCM_ITAG9 (n) == scm_tc9_flag) /* Flags (special objects). The indices of the flags must agree with the
#define SCM_MAKIFLAG(n) SCM_MAKE_ITAG9 ((n), scm_tc9_flag) * declarations in print.c: iflagnames. */
#define SCM_IFLAGNUM(n) (SCM_ITAG9_DATA (n))
#define SCM_IFLAGP(n) (SCM_ITAG8 (n) == scm_tc8_flag)
#define SCM_MAKIFLAG(n) SCM_MAKE_ITAG8 ((n), scm_tc8_flag)
#define SCM_IFLAGNUM(n) (SCM_ITAG8_DATA (n))
#define SCM_BOOL_F SCM_MAKIFLAG (0) #define SCM_BOOL_F SCM_MAKIFLAG (0)
#define SCM_BOOL_T SCM_MAKIFLAG (1) #define SCM_BOOL_T SCM_MAKIFLAG (1)
@ -541,54 +533,34 @@ enum scm_tags
#define SCM_UNBNDP(x) (SCM_EQ_P ((x), SCM_UNDEFINED)) #define SCM_UNBNDP(x) (SCM_EQ_P ((x), SCM_UNDEFINED))
/* Short instructions ('special symbols'), long instructions ('immediate /* Evaluator byte codes ('immediate symbols'). These constants are used only
* symbols'). The indices of the SCM_IM_ symbols must agree with the * in eval but their values have to be allocated here. The indices of the
* declarations in print.c: scm_isymnames. */ * SCM_IM_ symbols must agree with the declarations in print.c:
* scm_isymnames. */
#define SCM_MAKSPCSYM(n) SCM_PACK (((n) << 9) + ((n) << 3) + 4L) #define SCM_ISYMP(n) (SCM_ITAG8 (n) == scm_tc8_isym)
#define SCM_MAKISYM(n) SCM_PACK (((n) << 9) + 0x6cL) #define SCM_MAKISYM(n) SCM_MAKE_ITAG8 ((n), scm_tc8_isym)
#define SCM_ISYMNUM(n) (SCM_ITAG8_DATA (n))
/* SCM_ISYMP tests for ISPCSYM and ISYM */
#define SCM_ISYMP(n) ((0x187 & SCM_UNPACK (n)) == 4)
#define SCM_ISYMNUM(n) (SCM_UNPACK (n) >> 9)
SCM_API char *scm_isymnames[]; /* defined in print.c */ SCM_API char *scm_isymnames[]; /* defined in print.c */
#define SCM_ISYMCHARS(n) (scm_isymnames[SCM_ISYMNUM (n)]) #define SCM_ISYMCHARS(n) (scm_isymnames[SCM_ISYMNUM (n)])
/* Evaluator bytecodes (short instructions): These are uniquely identified by #define SCM_IM_AND SCM_MAKISYM (0)
* their tc7 value. This makes it possible for the evaluator to dispatch on #define SCM_IM_BEGIN SCM_MAKISYM (1)
* them in one step. However, the type system allows for at most 13 short #define SCM_IM_CASE SCM_MAKISYM (2)
* instructions. Consequently, the most frequent instructions are chosen to #define SCM_IM_COND SCM_MAKISYM (3)
* be represented as short instructions. These constants are used only in #define SCM_IM_DO SCM_MAKISYM (4)
* eval but their values have to be allocated here. */ #define SCM_IM_IF SCM_MAKISYM (5)
#define SCM_IM_LAMBDA SCM_MAKISYM (6)
#define SCM_IM_AND SCM_MAKSPCSYM (0) #define SCM_IM_LET SCM_MAKISYM (7)
#define SCM_IM_BEGIN SCM_MAKSPCSYM (1) #define SCM_IM_LETSTAR SCM_MAKISYM (8)
#define SCM_IM_CASE SCM_MAKSPCSYM (2) #define SCM_IM_LETREC SCM_MAKISYM (9)
#define SCM_IM_COND SCM_MAKSPCSYM (3) #define SCM_IM_OR SCM_MAKISYM (10)
#define SCM_IM_DO SCM_MAKSPCSYM (4) #define SCM_IM_QUOTE SCM_MAKISYM (11)
#define SCM_IM_IF SCM_MAKSPCSYM (5) #define SCM_IM_SET_X SCM_MAKISYM (12)
#define SCM_IM_LAMBDA SCM_MAKSPCSYM (6)
#define SCM_IM_LET SCM_MAKSPCSYM (7)
#define SCM_IM_LETSTAR SCM_MAKSPCSYM (8)
#define SCM_IM_LETREC SCM_MAKSPCSYM (9)
#define SCM_IM_OR SCM_MAKSPCSYM (10)
#define SCM_IM_QUOTE SCM_MAKSPCSYM (11)
#define SCM_IM_SET_X SCM_MAKSPCSYM (12)
/* Evaluator bytecodes (long instructions): All these share a common tc7
* value. Thus, the evaluator needs to dispatch on them in two steps. These
* constants are used only in eval but their values have to be allocated
* here. */
/* Evaluator bytecode for (define ...) statements. We make it a long
* instruction since the evaluator will see this bytecode only for a very
* limited number of times, namely once for every top-level and internal
* definition: Top-level definitions are only executed once and internal
* definitions are converted to letrec expressions. */
#define SCM_IM_DEFINE SCM_MAKISYM (13) #define SCM_IM_DEFINE SCM_MAKISYM (13)
#define SCM_IM_APPLY SCM_MAKISYM (14) #define SCM_IM_APPLY SCM_MAKISYM (14)
#define SCM_IM_CONT SCM_MAKISYM (15) #define SCM_IM_CONT SCM_MAKISYM (15)
#define SCM_IM_DISPATCH SCM_MAKISYM (16) #define SCM_IM_DISPATCH SCM_MAKISYM (16)
@ -599,11 +571,8 @@ SCM_API char *scm_isymnames[]; /* defined in print.c */
#define SCM_IM_CALL_WITH_VALUES SCM_MAKISYM (21) #define SCM_IM_CALL_WITH_VALUES SCM_MAKISYM (21)
#define SCM_IM_ELSE SCM_MAKISYM (22) #define SCM_IM_ELSE SCM_MAKISYM (22)
#define SCM_IM_ARROW SCM_MAKISYM (23) #define SCM_IM_ARROW SCM_MAKISYM (23)
#define SCM_IM_NIL_COND SCM_MAKISYM (24) /* Multi-language support */
/* Multi-language support */ #define SCM_IM_BIND SCM_MAKISYM (25) /* Multi-language support */
#define SCM_IM_NIL_COND SCM_MAKISYM (24)
#define SCM_IM_BIND SCM_MAKISYM (25)