1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

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.
This commit is contained in:
Andy Wingo 2012-05-17 11:39:35 +02:00
parent eac1202483
commit 52182d5280
3 changed files with 8 additions and 42 deletions

View file

@ -715,9 +715,10 @@ VM_DEFINE_INSTRUCTION (51, push_rest, "push-rest", 2, -1, -1)
SCM rest = SCM_EOL;
n = FETCH () << 8;
n += FETCH ();
SYNC_BEFORE_GC ();
while (sp - (fp - 1) > n)
/* No need to check for underflow. */
CONS (rest, *sp--, rest);
rest = scm_cons (*sp--, rest);
PUSH (rest);
NEXT;
}
@ -731,9 +732,10 @@ VM_DEFINE_INSTRUCTION (52, bind_rest, "bind-rest", 4, -1, -1)
n += FETCH ();
i = FETCH () << 8;
i += FETCH ();
SYNC_BEFORE_GC ();
while (sp - (fp - 1) > n)
/* No need to check for underflow. */
CONS (rest, *sp--, rest);
rest = scm_cons (*sp--, rest);
LOCAL_SET (i, rest);
NEXT;
}