Fixes the mutually-recursive toplevel definitions case. This could be
fixed by rewriting bodies as letrecs, as r6 does, but that's not really
repl-compatible.
* module/system/il/ghil.scm (ghil-lookup): Ok, if we can't locate a
variable, mark it as unresolved.
* module/system/il/compile.scm (make-glil-var): Compile unresolved
variables as <glil-late-bound> objects.
* module/system/il/glil.scm: Add <glil-late-bound> definition.
* module/system/vm/assemble.scm (codegen): And, finally, when we see a
<vlate-bound> object, allocate a slot for it in the object vector,
setting it to a symbol. Add a new pair of instructions to resolve that
symbol to a variable at the last minute.
* src/vm_loader.c (load-number): Bugfix: the radix argument should be
SCM_UNDEFINED in order to default to 10.
(late-bind): Add an unresolved symbol to the object vector. Could be
replaced with load-symbol I guess.
* src/vm_system.c (late-variable-ref, late-variable-set): New
instructions to do late symbol binding.
* testsuite/Makefile.am (vm_test_files):
* testsuite/t-mutual-toplevel-defines.scm: New test, failing for some
reason involving the core even? and odd? definitions.
* module/system/vm/assemble.scm (dump-object!): New sub-procedure
`too-long'. For `list' and `vector', encode the length on 2 octets
instead of 1 and report an error if a list/vector is longer than 65535.
* module/system/vm/disasm.scm (original-value): New sub-procedure
`list-or-vector?'; when true, return the number of elements for that
list/vector.
* src/vm_system.c (list): Fetch the length as a two-octet integer.
(vector): Likewise.
* testsuite/t-basic-contructs.scm: New.
* testsuite/Makefile.am (vm_test_files): Added the above file.
* module/system/vm/core.scm (load-compiled): Added a bit of
documentation.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-11
object file is too small.
* doc/guile-vm.texi: Documented `make-closure'. Improved the documentation
of `load-program'.
* testsuite: New directory.
* configure.in: Added `testsuite/Makefile' to `AC_OUTPUT'.
* Makefile.am (SUBDIRS): Added `testsuite'.
* src/vm_engine.h (VM_CHECK_OBJECT): New option.
(CHECK_OBJECT): New macro.
* src/vm_system.c (object-ref): Use VM_CHECK_OBJECT.
* module/system/vm/assemble.scm (preprocess): Commented out the debugging
code.
* benchmark/lib.scm (do-loop): New procedure.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-2