mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
*** empty log message ***
This commit is contained in:
parent
f21dfea659
commit
24aa2715f6
4 changed files with 24 additions and 25 deletions
|
@ -171,10 +171,9 @@ List/show/set options."
|
|||
(repl-option-set! repl key val)
|
||||
(case key
|
||||
((trace)
|
||||
(let ((opts (repl-option-ref repl 'trace-options)))
|
||||
(if val
|
||||
(apply vm-trace-on repl.env.vm opts)
|
||||
(vm-trace-off repl.env.vm))))))))
|
||||
(if val
|
||||
(apply vm-trace-on repl.env.vm val)
|
||||
(vm-trace-off repl.env.vm)))))))
|
||||
|
||||
(define (quit repl)
|
||||
"quit
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
(define-vm-class <repl> () env options tm-stats gc-stats vm-stats)
|
||||
|
||||
(define repl-default-options
|
||||
'((trace . #f)
|
||||
(trace-options . (:s))))
|
||||
'((trace . #f)))
|
||||
|
||||
(define-public (make-repl lang)
|
||||
(let ((cenv (make-cenv :vm (the-vm)
|
||||
|
|
|
@ -287,15 +287,29 @@ do { \
|
|||
|
||||
#define NEW_FRAME() \
|
||||
{ \
|
||||
int i; \
|
||||
SCM ra = SCM_VM_MAKE_BYTE_ADDRESS (ip); \
|
||||
SCM dl = SCM_VM_MAKE_STACK_ADDRESS (fp); \
|
||||
SCM *p = sp + 1; \
|
||||
SCM *q = p + bp->nlocs; \
|
||||
\
|
||||
/* New pointers */ \
|
||||
ip = bp->base; \
|
||||
fp = sp - bp->nargs + 1; \
|
||||
sp = sp + bp->nlocs + 3; \
|
||||
fp = p - bp->nargs; \
|
||||
sp = q + 2; \
|
||||
CHECK_OVERFLOW (); \
|
||||
sp[0] = ra; \
|
||||
sp[-1] = dl; \
|
||||
sp[-2] = external; \
|
||||
\
|
||||
/* Init local variables */ \
|
||||
for (; p < q; p++) \
|
||||
*p = SCM_UNDEFINED; \
|
||||
\
|
||||
/* Create external variables */ \
|
||||
external = bp->external; \
|
||||
for (i = 0; i < bp->nexts; i++) \
|
||||
CONS (external, SCM_UNDEFINED, external); \
|
||||
p[0] = external; \
|
||||
p[1] = dl; \
|
||||
p[2] = ra; \
|
||||
}
|
||||
|
||||
#define FREE_FRAME() \
|
||||
|
@ -304,7 +318,6 @@ do { \
|
|||
sp = fp - 2; \
|
||||
ip = SCM_VM_BYTE_ADDRESS (p[2]); \
|
||||
fp = SCM_VM_STACK_ADDRESS (p[1]); \
|
||||
external = p[0]; \
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -337,24 +337,11 @@ VM_DEFINE_INSTRUCTION (call, "call", 1, -1, 1)
|
|||
*/
|
||||
if (SCM_PROGRAM_P (x))
|
||||
{
|
||||
int i, last;
|
||||
|
||||
program = x;
|
||||
vm_call_program:
|
||||
CACHE_PROGRAM ();
|
||||
INIT_ARGS ();
|
||||
NEW_FRAME ();
|
||||
|
||||
/* Init local variables */
|
||||
last = bp->nargs + bp->nlocs;
|
||||
for (i = bp->nargs; i < last; i++)
|
||||
LOCAL_SET (i, SCM_UNDEFINED);
|
||||
|
||||
/* Create external variables */
|
||||
external = bp->external;
|
||||
for (i = 0; i < bp->nexts; i++)
|
||||
CONS (external, SCM_UNDEFINED, external);
|
||||
|
||||
ENTER_HOOK ();
|
||||
APPLY_HOOK ();
|
||||
NEXT;
|
||||
|
@ -501,6 +488,7 @@ VM_DEFINE_INSTRUCTION (return, "return", 0, 0, 1)
|
|||
FREE_FRAME ();
|
||||
|
||||
/* Restore the last program */
|
||||
external = fp[bp->nargs + bp->nlocs];
|
||||
program = SCM_VM_FRAME_PROGRAM (fp);
|
||||
CACHE_PROGRAM ();
|
||||
PUSH (ret);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue