Skip to content

Commit

Permalink
kernel: move EXEC_STAT implementation into stats.c
Browse files Browse the repository at this point in the history
While we want to be able to inline EXEC_STAT, almost all its invocations are
in stats.c anyway. Only two more are in funcs.c

This will make further refactoring easier.
  • Loading branch information
fingolfin authored and ChrisJefferson committed Feb 5, 2018
1 parent ea95324 commit 3f38999
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
1 change: 0 additions & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ VoidFunc debug_func_pointers[] = {
(VoidFunc)ELMV0_LIST,
(VoidFunc)ELMW_LIST,
(VoidFunc)ENVI_FUNC,
(VoidFunc)EXEC_STAT,
(VoidFunc)FEXS_FUNC,
(VoidFunc)FibHash,
(VoidFunc)FillInVersion,
Expand Down
26 changes: 5 additions & 21 deletions src/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,11 @@
#include <assert.h>


/****************************************************************************
**
*F EXEC_STAT(<stat>) . . . . . . . . . . . . . . . . . . execute a statement
**
** 'EXEC_STAT' executes the statement <stat>.
**
** If this causes the execution of a return-value-statement, then
** 'EXEC_STAT' returns 1, and the return value is stored in 'ReturnObjStat'.
** If this causes the execution of a return-void-statement, then 'EXEC_STAT'
** returns 2. If this causes execution of a break-statement (which cannot
** happen if <stat> is the body of a function), then 'EXEC_STAT' returns 4.
** Similarly, for a continue-statement, EXEC_STAT returns 8
** Otherwise 'EXEC_STAT' returns 0.
**
** 'EXEC_STAT' causes the execution of <stat> by dispatching to the
** executor, i.e., to the function that executes statements of the type of
** <stat>.
**
** 'EXEC_STAT' is defined in the declaration part of this package as follows:
**
*/
inline UInt EXEC_STAT(Stat stat)
{
UInt tnum = TNUM_STAT(stat);
return (*STATE(CurrExecStatFuncs)[ tnum ]) ( stat );
}


/****************************************************************************
Expand Down
6 changes: 1 addition & 5 deletions src/stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ extern UInt (* ExecStatFuncs[256]) ( Stat stat );
** executor, i.e., to the function that executes statements of the type of
** <stat>.
*/
static inline UInt EXEC_STAT(Stat stat)
{
UInt tnum = TNUM_STAT(stat);
return (*STATE(CurrExecStatFuncs)[ tnum ]) ( stat );
}
extern UInt EXEC_STAT(Stat stat);


/****************************************************************************
Expand Down

0 comments on commit 3f38999

Please sign in to comment.