diff options
author | Andy Wingo <wingo@pobox.com> | 2012-05-17 11:39:35 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-05-23 14:27:17 +0200 |
commit | 52182d5280cefe18e605b6c40f690badb174ec27 (patch) | |
tree | 895f4eb134062fcd6d9fe099d3fda0b347557b0e /libguile/vm-engine.c | |
parent | eac12024830736409112634d3b16ddaaa2bff05b (diff) | |
download | guile-52182d5280cefe18e605b6c40f690badb174ec27.tar.gz |
remove CONS macro in VM; use scm_cons instead
* libguile/vm-engine.c (CONS): Remove. Callers should use scm_cons
instead, syncing registers beforehand.
(POP_LIST): Adapt, only synchronizing once.
(POP_LIST_MARK, POP_CONS_MARK): Remove unused macros.
* libguile/vm-i-scheme.c (cons):
* libguile/vm-i-system.c (push-rest, bind-rest): Adapt.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r-- | libguile/vm-engine.c | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index d950f126d..cb92fc7d8 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -315,17 +315,6 @@ #define POP2(x,y) do { PRE_CHECK_UNDERFLOW (2); x = *sp--; y = *sp--; NULLSTACK (2); } while (0) #define POP3(x,y,z) do { PRE_CHECK_UNDERFLOW (3); x = *sp--; y = *sp--; z = *sp--; NULLSTACK (3); } while (0) -/* A fast CONS. This has to be fast since its used, for instance, by - POP_LIST when fetching a function's argument list. Note: `scm_cell' is an - inlined function in Guile 1.7. Unfortunately, it calls - `scm_gc_for_newcell ()' which is _not_ inlined and allocated cells on the - heap. XXX */ -#define CONS(x,y,z) \ -{ \ - SYNC_BEFORE_GC (); \ - x = scm_cell (SCM_UNPACK (y), SCM_UNPACK (z)); \ -} - /* Pop the N objects on top of the stack and push a list that contains them. */ #define POP_LIST(n) \ @@ -333,10 +322,11 @@ do \ { \ int i; \ SCM l = SCM_EOL, x; \ + SYNC_BEFORE_GC (); \ for (i = n; i; i--) \ { \ POP (x); \ - CONS (l, x, l); \ + l = scm_cons (x, l); \ } \ PUSH (l); \ } while (0) @@ -351,33 +341,6 @@ do \ } while (0) -#define POP_LIST_MARK() \ -do { \ - SCM o; \ - SCM l = SCM_EOL; \ - POP (o); \ - while (!SCM_UNBNDP (o)) \ - { \ - CONS (l, o, l); \ - POP (o); \ - } \ - PUSH (l); \ -} while (0) - -#define POP_CONS_MARK() \ -do { \ - SCM o, l; \ - POP (l); \ - POP (o); \ - while (!SCM_UNBNDP (o)) \ - { \ - CONS (l, o, l); \ - POP (o); \ - } \ - PUSH (l); \ -} while (0) - - /* * Instruction operation */ |