mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 04:10:18 +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)
|
(repl-option-set! repl key val)
|
||||||
(case key
|
(case key
|
||||||
((trace)
|
((trace)
|
||||||
(let ((opts (repl-option-ref repl 'trace-options)))
|
|
||||||
(if val
|
(if val
|
||||||
(apply vm-trace-on repl.env.vm opts)
|
(apply vm-trace-on repl.env.vm val)
|
||||||
(vm-trace-off repl.env.vm))))))))
|
(vm-trace-off repl.env.vm)))))))
|
||||||
|
|
||||||
(define (quit repl)
|
(define (quit repl)
|
||||||
"quit
|
"quit
|
||||||
|
|
|
@ -35,8 +35,7 @@
|
||||||
(define-vm-class <repl> () env options tm-stats gc-stats vm-stats)
|
(define-vm-class <repl> () env options tm-stats gc-stats vm-stats)
|
||||||
|
|
||||||
(define repl-default-options
|
(define repl-default-options
|
||||||
'((trace . #f)
|
'((trace . #f)))
|
||||||
(trace-options . (:s))))
|
|
||||||
|
|
||||||
(define-public (make-repl lang)
|
(define-public (make-repl lang)
|
||||||
(let ((cenv (make-cenv :vm (the-vm)
|
(let ((cenv (make-cenv :vm (the-vm)
|
||||||
|
|
|
@ -287,15 +287,29 @@ do { \
|
||||||
|
|
||||||
#define NEW_FRAME() \
|
#define NEW_FRAME() \
|
||||||
{ \
|
{ \
|
||||||
|
int i; \
|
||||||
SCM ra = SCM_VM_MAKE_BYTE_ADDRESS (ip); \
|
SCM ra = SCM_VM_MAKE_BYTE_ADDRESS (ip); \
|
||||||
SCM dl = SCM_VM_MAKE_STACK_ADDRESS (fp); \
|
SCM dl = SCM_VM_MAKE_STACK_ADDRESS (fp); \
|
||||||
|
SCM *p = sp + 1; \
|
||||||
|
SCM *q = p + bp->nlocs; \
|
||||||
|
\
|
||||||
|
/* New pointers */ \
|
||||||
ip = bp->base; \
|
ip = bp->base; \
|
||||||
fp = sp - bp->nargs + 1; \
|
fp = p - bp->nargs; \
|
||||||
sp = sp + bp->nlocs + 3; \
|
sp = q + 2; \
|
||||||
CHECK_OVERFLOW (); \
|
CHECK_OVERFLOW (); \
|
||||||
sp[0] = ra; \
|
\
|
||||||
sp[-1] = dl; \
|
/* Init local variables */ \
|
||||||
sp[-2] = external; \
|
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() \
|
#define FREE_FRAME() \
|
||||||
|
@ -304,7 +318,6 @@ do { \
|
||||||
sp = fp - 2; \
|
sp = fp - 2; \
|
||||||
ip = SCM_VM_BYTE_ADDRESS (p[2]); \
|
ip = SCM_VM_BYTE_ADDRESS (p[2]); \
|
||||||
fp = SCM_VM_STACK_ADDRESS (p[1]); \
|
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))
|
if (SCM_PROGRAM_P (x))
|
||||||
{
|
{
|
||||||
int i, last;
|
|
||||||
|
|
||||||
program = x;
|
program = x;
|
||||||
vm_call_program:
|
vm_call_program:
|
||||||
CACHE_PROGRAM ();
|
CACHE_PROGRAM ();
|
||||||
INIT_ARGS ();
|
INIT_ARGS ();
|
||||||
NEW_FRAME ();
|
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 ();
|
ENTER_HOOK ();
|
||||||
APPLY_HOOK ();
|
APPLY_HOOK ();
|
||||||
NEXT;
|
NEXT;
|
||||||
|
@ -501,6 +488,7 @@ VM_DEFINE_INSTRUCTION (return, "return", 0, 0, 1)
|
||||||
FREE_FRAME ();
|
FREE_FRAME ();
|
||||||
|
|
||||||
/* Restore the last program */
|
/* Restore the last program */
|
||||||
|
external = fp[bp->nargs + bp->nlocs];
|
||||||
program = SCM_VM_FRAME_PROGRAM (fp);
|
program = SCM_VM_FRAME_PROGRAM (fp);
|
||||||
CACHE_PROGRAM ();
|
CACHE_PROGRAM ();
|
||||||
PUSH (ret);
|
PUSH (ret);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue