mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
* eval.c: Removed ASRTSYNTAX macro. Removed function 'bodycheck'.
* stacks.c: Removed unused calculations, minimized variable scopes.
This commit is contained in:
parent
e2d1d99d7b
commit
ab66ae47f2
3 changed files with 22 additions and 28 deletions
|
@ -1,3 +1,17 @@
|
|||
2000-05-08 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* eval.c (ASRTSYNTAX, scm_m_body, scm_m_letrec1): Removed
|
||||
ASRTSYNTAX. Using SCM_ASSYNT instead.
|
||||
|
||||
(scm_m_body): Don't create a redundant cons cell.
|
||||
|
||||
(scm_m_do): Removed redundant test 'bodycheck'.
|
||||
|
||||
(bodycheck): Removed.
|
||||
|
||||
* stacks.c (stack_depth, read_frame, read_frames): Removed
|
||||
redundant calculation of size, minimized some variable scopes.
|
||||
|
||||
2000-05-05 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* pairs.c (scm_cons, scm_cons2): Use SCM{_SET}?_CELL_OBJECT as
|
||||
|
|
|
@ -459,17 +459,6 @@ SCM scm_sym_enter_frame, scm_sym_apply_frame, scm_sym_exit_frame;
|
|||
SCM scm_sym_trace;
|
||||
#endif
|
||||
|
||||
#define ASRTSYNTAX(cond_, msg_) if(!(cond_))scm_wta(xorig, (msg_), what);
|
||||
|
||||
|
||||
|
||||
static void bodycheck (SCM xorig, SCM *bodyloc, const char *what);
|
||||
|
||||
static void
|
||||
bodycheck (SCM xorig, SCM *bodyloc, const char *what)
|
||||
{
|
||||
ASRTSYNTAX (scm_ilength (*bodyloc) >= 1, scm_s_expression);
|
||||
}
|
||||
|
||||
/* Check that the body denoted by XORIG is valid and rewrite it into
|
||||
its internal form. The internal form of a body is just the body
|
||||
|
@ -487,7 +476,7 @@ bodycheck (SCM xorig, SCM *bodyloc, const char *what)
|
|||
static SCM
|
||||
scm_m_body (SCM op, SCM xorig, const char *what)
|
||||
{
|
||||
ASRTSYNTAX (scm_ilength (xorig) >= 1, scm_s_expression);
|
||||
SCM_ASSYNT (scm_ilength (xorig) >= 1, xorig, scm_s_expression, what);
|
||||
|
||||
/* Don't add another ISYM if one is present already. */
|
||||
if (SCM_ISYMP (SCM_CAR (xorig)))
|
||||
|
@ -502,7 +491,7 @@ scm_m_body (SCM op, SCM xorig, const char *what)
|
|||
return xorig;
|
||||
}
|
||||
|
||||
return scm_cons2 (op, SCM_CAR (xorig), SCM_CDR(xorig));
|
||||
return scm_cons (op, xorig);
|
||||
}
|
||||
|
||||
SCM_SYNTAX(s_quote,"quote", scm_makmmacro, scm_m_quote);
|
||||
|
@ -789,7 +778,6 @@ scm_m_do (SCM xorig, SCM env)
|
|||
SCM_ASSYNT (scm_ilength (SCM_CAR (x)) >= 1, xorig, scm_s_test, "do");
|
||||
x = scm_cons2 (SCM_CAR (x), SCM_CDR (x), steps);
|
||||
x = scm_cons2 (vars, inits, x);
|
||||
bodycheck (xorig, SCM_CARLOC (SCM_CDR (SCM_CDR (x))), "do");
|
||||
return scm_cons (SCM_IM_DO, x);
|
||||
}
|
||||
|
||||
|
@ -942,14 +930,13 @@ scm_m_letrec1 (SCM op, SCM imm, SCM xorig, SCM env)
|
|||
SCM vars = SCM_EOL, inits = SCM_EOL, *initloc = &inits;
|
||||
|
||||
proc = SCM_CAR (x);
|
||||
ASRTSYNTAX (scm_ilength (proc) >= 1, scm_s_bindings);
|
||||
SCM_ASSYNT (scm_ilength (proc) >= 1, xorig, scm_s_bindings, what);
|
||||
do
|
||||
{
|
||||
/* vars scm_list reversed here, inits reversed at evaluation */
|
||||
arg1 = SCM_CAR (proc);
|
||||
ASRTSYNTAX (2 == scm_ilength (arg1), scm_s_bindings);
|
||||
ASRTSYNTAX (SCM_SYMBOLP (SCM_CAR (arg1)),
|
||||
scm_s_variable);
|
||||
SCM_ASSYNT (2 == scm_ilength (arg1), xorig, scm_s_bindings, what);
|
||||
SCM_ASSYNT (SCM_SYMBOLP (SCM_CAR (arg1)), xorig, scm_s_variable, what);
|
||||
vars = scm_cons (SCM_CAR (arg1), vars);
|
||||
*initloc = scm_cons (SCM_CAR (SCM_CDR (arg1)), SCM_EOL);
|
||||
initloc = SCM_CDRLOC (*initloc);
|
||||
|
|
|
@ -156,17 +156,15 @@
|
|||
static int
|
||||
stack_depth (scm_debug_frame *dframe,long offset,SCM *id,int *maxp)
|
||||
{
|
||||
int n, size;
|
||||
int n;
|
||||
int max_depth = SCM_BACKTRACE_MAXDEPTH;
|
||||
scm_debug_info *info;
|
||||
for (n = 0;
|
||||
dframe && !SCM_VOIDFRAMEP (*dframe) && n < max_depth;
|
||||
dframe = RELOC_FRAME (dframe->prev, offset))
|
||||
{
|
||||
if (SCM_EVALFRAMEP (*dframe))
|
||||
{
|
||||
size = dframe->status & SCM_MAX_FRAME_SIZE;
|
||||
info = RELOC_INFO (dframe->info, offset);
|
||||
scm_debug_info * info = RELOC_INFO (dframe->info, offset);
|
||||
n += (info - dframe->vect) / 2 + 1;
|
||||
/* Data in the apply part of an eval info frame comes from previous
|
||||
stack frame if the scm_debug_info vector is overflowed. */
|
||||
|
@ -191,12 +189,9 @@ static void
|
|||
read_frame (scm_debug_frame *dframe,long offset,scm_info_frame *iframe)
|
||||
{
|
||||
scm_bits_t flags = SCM_UNPACK (SCM_INUM0); /* UGh. */
|
||||
int size;
|
||||
scm_debug_info *info;
|
||||
if (SCM_EVALFRAMEP (*dframe))
|
||||
{
|
||||
size = dframe->status & SCM_MAX_FRAME_SIZE;
|
||||
info = RELOC_INFO (dframe->info, offset);
|
||||
scm_debug_info * info = RELOC_INFO (dframe->info, offset);
|
||||
if ((info - dframe->vect) & 1)
|
||||
{
|
||||
/* Debug.vect ends with apply info. */
|
||||
|
@ -260,7 +255,6 @@ do { \
|
|||
static int
|
||||
read_frames (scm_debug_frame *dframe,long offset,int n,scm_info_frame *iframes)
|
||||
{
|
||||
int size;
|
||||
scm_info_frame *iframe = iframes;
|
||||
scm_debug_info *info;
|
||||
static SCM applybody = SCM_UNDEFINED;
|
||||
|
@ -283,7 +277,6 @@ read_frames (scm_debug_frame *dframe,long offset,int n,scm_info_frame *iframes)
|
|||
*(iframe - 1) = *iframe;
|
||||
--iframe;
|
||||
}
|
||||
size = dframe->status & SCM_MAX_FRAME_SIZE;
|
||||
info = RELOC_INFO (dframe->info, offset);
|
||||
if ((info - dframe->vect) & 1)
|
||||
--info;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue