mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 09:10:22 +02:00
* tags.h: Reduced the number of short instructions from 14 to 13.
The typecode of the former 14th short instruction is now used to represent long instructions. Changed some comments to reflect this fact. (SCM_MAKISYM): ISYMs get a new tc7 code, namely the one that was previously used by SCM_IM_DEFINE. (SCM_IM_DEFINE): Turned into a long instruction. * eval.c (unmemocopy, SCM_CEVAL): Treat SCM_IM_DEFINE as a long instruction. * eval.c (SCM_CEVAL): Since characters and iflags have now a tc7 code that is separate from all instructions, one level of dispatch for long instructions can be eliminated. * print.c (scm_isymnames): Removed some commented code.
This commit is contained in:
parent
89990cc656
commit
22f2cf2d9a
4 changed files with 71 additions and 39 deletions
|
@ -1618,25 +1618,23 @@ unmemocopy (SCM x, SCM env)
|
|||
case SCM_BIT7 (SCM_IM_SET_X):
|
||||
ls = z = scm_cons (scm_sym_set_x, SCM_UNSPECIFIED);
|
||||
break;
|
||||
case SCM_BIT7 (SCM_IM_DEFINE):
|
||||
{
|
||||
SCM n;
|
||||
x = SCM_CDR (x);
|
||||
n = SCM_CAR (x);
|
||||
z = scm_cons (n, SCM_UNSPECIFIED);
|
||||
ls = scm_cons (scm_sym_define, z);
|
||||
if (!SCM_NULLP (env))
|
||||
env = scm_cons (scm_cons (scm_cons (n, SCM_CAAR (env)),
|
||||
SCM_CDAR (env)),
|
||||
SCM_CDR (env));
|
||||
break;
|
||||
}
|
||||
case SCM_BIT7 (SCM_MAKISYM (0)):
|
||||
z = SCM_CAR (x);
|
||||
if (!SCM_ISYMP (z))
|
||||
goto unmemo;
|
||||
switch (SCM_ISYMNUM (z))
|
||||
{
|
||||
case (SCM_ISYMNUM (SCM_IM_DEFINE)):
|
||||
{
|
||||
SCM n;
|
||||
x = SCM_CDR (x);
|
||||
n = SCM_CAR (x);
|
||||
z = scm_cons (n, SCM_UNSPECIFIED);
|
||||
ls = scm_cons (scm_sym_define, z);
|
||||
if (!SCM_NULLP (env))
|
||||
env = scm_cons (scm_cons (scm_cons (n, SCM_CAAR (env)),
|
||||
SCM_CDAR (env)),
|
||||
SCM_CDR (env));
|
||||
break;
|
||||
}
|
||||
case (SCM_ISYMNUM (SCM_IM_APPLY)):
|
||||
ls = z = scm_cons (scm_sym_atapply, SCM_UNSPECIFIED);
|
||||
goto loop;
|
||||
|
@ -1657,7 +1655,6 @@ unmemocopy (SCM x, SCM env)
|
|||
default:
|
||||
/* appease the Sun compiler god: */ ;
|
||||
}
|
||||
unmemo:
|
||||
default:
|
||||
ls = z = unmemocar (scm_cons (unmemocopy (SCM_CAR (x), env),
|
||||
SCM_UNSPECIFIED),
|
||||
|
@ -2441,20 +2438,23 @@ dispatch:
|
|||
RETURN (SCM_UNSPECIFIED);
|
||||
|
||||
|
||||
case SCM_BIT7 (SCM_IM_DEFINE): /* only for internal defines */
|
||||
scm_misc_error (NULL, "Bad define placement", SCM_EOL);
|
||||
|
||||
|
||||
/* new syntactic forms go here. */
|
||||
case SCM_BIT7 (SCM_MAKISYM (0)):
|
||||
proc = SCM_CAR (x);
|
||||
if (!SCM_ISYMP (proc))
|
||||
goto evapply;
|
||||
|
||||
switch (SCM_ISYMNUM (proc))
|
||||
{
|
||||
|
||||
|
||||
case (SCM_ISYMNUM (SCM_IM_DEFINE)):
|
||||
/* Top level defines are handled directly by the memoizer and thus
|
||||
* will never generate memoized code with SCM_IM_DEFINE. Internal
|
||||
* defines which occur at valid positions will be transformed into
|
||||
* letrec expressions. Thus, whenever the executor detects
|
||||
* SCM_IM_DEFINE, this must come from an internal definition at an
|
||||
* illegal position. */
|
||||
scm_misc_error (NULL, "Bad define placement", SCM_EOL);
|
||||
|
||||
|
||||
case (SCM_ISYMNUM (SCM_IM_APPLY)):
|
||||
x = SCM_CDR (x);
|
||||
proc = EVALCAR (x, env);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue