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

Compiler: Support cyclic literal data.

* libguile/vm-i-scheme.c (array-contents): New VM instruction.

* module/language/glil/compile-assembly.scm (vhash-fold-right3,
  fold3, fold2-3): New procedures.
  (add-to-store): Accept new argument 'ancestors'.  Use it to prevent
  infinite loops.  Augment it when traversing into lists, pairs,
  vectors, or arrays.
  (build-constant-store): Adapt to new argument to 'add-to-store'.
  (ref-or-dump): Accept new arguments 'post' and 'f'.  If the referenced
  object has not yet been serialized, augment 'post' to add code that will
  mutate it to the correct value after all initializations.
  (dump1): Accept new argument 'post'.  Return a third value: the new
  'post'.  Pass new arguments to 'ref-or-dump'.
  (dump-constants): Adapt to new argument and return value of 'dump1'.
  Apply post-procs to mutate fields of constants as needed to handle
  cyclic data.
This commit is contained in:
Mark H Weaver 2014-01-12 04:47:19 -05:00
parent 92408ac20e
commit 07b820a804
2 changed files with 215 additions and 91 deletions

View file

@ -1040,6 +1040,12 @@ BV_FLOAT_SET (f64, ieee_double, double, 8)
#undef BV_INT_SET
#undef BV_FLOAT_SET
VM_DEFINE_FUNCTION (210, array_contents, "array-contents", 1)
{
ARGS1 (x);
RETURN (scm_array_contents (x, SCM_BOOL_F));
}
/*
(defun renumber-ops ()
"start from top of buffer and renumber 'VM_DEFINE_FOO (\n' sequences"