* module/system/il/inline.scm: New module, implements generic inlining of
scheme functions. It even does the right thing regarding (define
arity:nopt caddr) and such. So now there are many more inlines: the
arithmetics, `apply', the caddr family, etc. This makes the benchmarks
*much* faster.
* module/language/scheme/translate.scm (trans): Remove the
%scheme-primitives code in favor of the generic (scheme il inline)
code. Adds inlining for +, -, =, etc.
* src/vm.c (vm_puts): Fix to work.
* module/system/base/compile.scm (system): Export load/compile also.
* module/system/il/compile.scm (optimize): Further debitrotting, but I
haven't tried this function yet. It seems that <ghil-inst> was what
<ghil-inline> is.
* module/system/il/ghil.scm (*core-primitives*, *macro-module*)
(ghil-primitive-macro?, ghil-macro-expander, ghil-primitive?): Remove
these unused things.
* module/system/il/macros.scm: Removed, replaced with inline.scm.
* module/system/vm/assemble.scm (stack->bytes): Before, the final
serialization code did an (apply u8vector (apply append (map
u8vector->list ...))). Aside from the misspelling of append-map, this
ends up pushing all elements of the u8vector on the stack -- assuredly
not what you want. But besides even that, I think that pushing more
than 32k arguments on the stack brings out some other bug that I think
was hidden before, because now we actually use the `apply' VM
instruction. Further testing is needed here, I think. Fixed the code to
be more efficient, which fixes the manifestation of this particular
bug: a failure to self-compile after inlining was enabled.
* module/system/vm/bootstrap.scm: New module, serves to bootstrap
boot-9's `load-compiled'. That way when we load (system vm core), we're
loading compiled code already.
* module/system/vm/core.scm: Use (system vm bootstrap).
* src/guilec.in: Use the bootstrap code, so that we really are compiling
with an entirely compiled compiler.
* module/system/repl/repl.scm (default-catch-handler): An attempt at
making the repl print a backtrace; more work needed here.
* module/system/vm/frame.scm (make-frame-chain): Fix some misspellings --
I think, anyway.
* guilec.mk: New file, to be included when building .go files.
* module/language/scheme/Makefile.am:
* module/system/base/Makefile.am:
* module/system/il/Makefile.am:
* module/system/repl/Makefile.am:
* module/system/vm/Makefile.am: Use guilec.mk.
* module/system/base/compile.scm (compiled-file-name): Work on the
basename of a file, so that we always create files in the directory
where we run. Perhaps should add a -o option to guilec in the future.
* Makefile.am: Actually recurse into module/ in a normal build.
* module/language/scheme/translate.scm (*the-compile-toplevel-symbol*):
Reset to compile-toplevel, which requires a patch to guile.
* module/system/base/compile.scm (compile-file): Some foo so that we load
up the scheme language before call-with-output-file. Fixes compilation
of (language scheme) modules.
* module/system/base/language.scm (define-language): Don't unquote in
make-language; refer to it by name instead, and export it.
* module/system/repl/Makefile.am (vm_DATA): Don't compile describe.scm,
because we really can't deal with goops yet.
* module/system/repl/repl.scm (compile-toplevel): If we're compiling, put
in a stub definition of start-stack, which is closely tied to the
interpreter.
* src/vm_loader.c (load-program): Fix a very tricky corruption bug!
* module/language/scheme/translate.scm (lookup-transformer): When
expanding syncase macros, use the eval closure from the ghil-env.
Probably doesn't make any difference whatsoever.
* module/system/base/Makefile.am (SOURCES): Compile pmatch.scm, now that
it works :-))
* module/system/base/compile.scm (compile-in): Compile inside a
save-module-excursion, so that side effects of evaluation don't leak
out.
* module/system/base/pmatch.scm: Change from :use-syntax/:export-syntax
to simply :use-modules/:export. Also probably has no effect.
* module/system/il/ghil.scm (fix-ghil-mod!): Suppress warnings resulting
from compilation of define-module.
* src/vm_loader.c (link): So, referencing variables defined but not
exported from the current module didn't work. Fixed that, but it's
hacky. There are still some uncaught cases.
* module/system/base/compile.scm: Also import load-objcode from (system
vm core).
* module/language/scheme/translate.scm (lookup-transformer): Use
sc-expand3 in compilation mode when compiling macros. Yay, syncase
macros compile!
* module/language/scheme/translate.scm (eval-at-compile-time)
(&compile-time-module, expand-macro): Remove this attempt at dealing
with macros. Instead, we're going to rely on macros being first-class,
and just catch eval-case at the bottom.
(lookup-transformer): Lookup all syntax transformers in the module's
eval closure. We catch the primitive-macros, compiling them to ghil,
and expand the rest.
(lookup-transformer): Fold in trans-pair here. Add a hacky case for the
unspecified value; the problem shows up when compiling e.g.
(define-macro (plus! x) `(set! ,x (1+ x))), as a fallout from
eval-case.
(make-pmatch-transformers, primitive-syntax-table): Define the
primitive syntax transformers as a data-driven table instead of a
function. There's a bit of syntax, too. Eval-case was rewritten to use
pmatch.
* module/system/base/compile.scm (scheme): Define as a thunk instead
of a value, so as to allow (language scheme translate) to be imported
in the repl. Still, a hack.
* module/system/base/compile.scm (<cenv>): No more cenv, it was a useless
data structure.
* module/system/repl/command.scm (*command-table*): Remove `use', it's
the same as `import'. Otherwise in this file, adapt to the repl having
direct pointers to the vm and the language, and to the module being in
the current-module fluid.
* module/system/repl/repl.scm (prompting-meta-read):
* module/system/repl/common.scm (<repl>): The repl now has a direct
pointer to the vm and language. Adapt accordingly.
* module/system/base/compile.scm:
* module/system/il/ghil.scm:
* module/system/repl/describe.scm:
* module/system/vm/core.scm:
* module/system/vm/frame.scm:
* module/system/vm/trace.scm: Explicitly list exports in the module
declaration instead of using define-public.
* module/system/base/compile.scm: Export cenv? also.
* module/system/base/syntax.scm: Clean up vestiges of the old structure
code. Make accessors defined as foo? instead of <foo>?.
* module/system/il/glil.scm:
* module/system/il/ghil.scm: Remove <foo>-1 accessors, since we have
named accessors.
* module/language/scheme/translate.scm (trans): Catch exceptions thrown
by `macroexpand' and throw a syntax error.
(trans-pair): Catch calls to `procedure->memoizing-macro' and raise a
syntax error.
* module/system/base/compile.scm (call-with-compile-error-catch): Made a
macro (a procedure doesn't do the job).
(compile-file): Uncommented call to `call-with-compile-error-catch'.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-7
* module/language/Makefile.am: New.
* module/language/scheme/Makefile.am: New.
* configure.in: Produce these two new Makefiles.
* doc/guile-vm.texi: Documented `compile-file', `compiled-file-name', and
`compile-in'.
* module/system/base/compile.scm: Cosmetic changes.
* module/system/base/language.scm: Likewise.
* module/system/il/Makefile.am: Tried (and failed) to compile more
things.
* module/system/vm/Makefile.am: All source files in here can now be
compiled without harming further compilation.
* module/system/vm/assemble.scm: Select only specific bindings from
`(system vm core)'.
(dump-object!): Show a more meaningful error message.
* module/system/vm/conv.scm: Select only specific bindings from `(system
vm core)'.
* module/system/vm/debug.scm: Likewise.
* module/system/vm/frame.scm: Changed the header. Use a renamer for
`(system vm core)'.
* src/guilec.in: Added options, via `getopt-long'.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-6
* module/language/scheme/translate.scm (trans-pair): In the `set!' case,
when a procedure-with-setter is passed, call `trans:pair' with an
actual pair. This fixes a long-lasting bug which prevented compilation
of `set!' statements with procedures-with-setter (this showed up when
compiling `(system vm assemble)').
* module/system/base/compile.scm: Added `objcode->u8vector' to the
`#:select' clause.
* module/system/base/syntax.scm: Cosmetic changes.
* module/system/vm/assemble.scm (preprocess): Removed debugging
statements.
* src/frames.c: Cosmetic changes.
* src/frames.h (SCM_FRAME_SET_DYNAMIC_LINK): New.
* src/objcodes.c: Use `scm_t_uint8' instead of `char' when relevant.
* src/vm.c (vm_heapify_frames_1): Use `SCM_FRAME_SET_DYNAMIC_LINK ()'.
* src/vm_loader.c: Added casts to mute GCC 4 warnings.
* testsuite/run-vm-tests.scm (*scheme*): Renamed to `%scheme'.
(run-test-from-file): Renamed to `compile/run-test-from-file'.
(run-vm-tests): Run each test using both the VM and the interpreter;
compare the results.
* testsuite/t-proc-with-setter.scm: Try out `get/set'.
* doc/Makefile.am (info_TEXINFOS): New.
* doc/guile-vm.texi: Added index entries and indices.
* doc/texinfo.tex: New file.
git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-5
* module/system/base/compile.scm: Only import `the-vm' and `vm-load' from
`(system vm core)'.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-10
* src/*.c: Removed calls to `scm_must_malloc', `SCM_MUST_MALLOC' and
`scm_must_free'. Same for `SCM_INUMP', `SCM_INUM', `SCM_STRING_CHARS',
and the likes.
* module/system/base/syntax.scm: Do not import `(ice-9 match)' and do
not re-export `match', do not export `syntax-error' which was not
defined here.
* module/system/base/compile.scm (call-with-compile-error-catch): Use
the `catch' form instead of `try'.
* src/instructions.c: Use `scm_from_char ()' instead of the deprecated
macro `SCM_MAKINUM ()'.
* src/instructions.h (scm_instruction): Made `npop' a signed char.
git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-2