1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
Commit graph

11 commits

Author SHA1 Message Date
Ludovic Courtes
9dbbe4bb83 Improved macro handling; started documenting the issue.
* doc/guile-vm.texi (Compiling Scheme Code): New node.

* module/language/scheme/translate.scm (&current-macro-module): New.
  (translate): Evaluate macros in `&current-macro-module'.
  (trans-pair): Likewise.

git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-13
2008-04-25 19:09:30 +02:00
Ludovic Courtes
884d46de23 Tried compiling more code; augmented the doc.
* 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
2008-04-25 19:09:30 +02:00
Ludovic Courtes
b6368dbbb9 Fixed a Scheme translation bug; cleaned compilation with GCC 4.
* 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
2008-04-25 19:09:30 +02:00
Ludovic Courtes
a52b2d3d55 Started documenting the compiler.
* doc/guile-vm.texi:  Documented the compiler (node `The Compiler').
  Removed a number of things that might have been relevant to Guile-VM 0.0.

* module/system/il/compile.scm (optimize):  Commented out the case
  using `<ghil-inst?>'.

* src/vm_engine.c (vm_run)[objects_handle]:  New variable.
  Before leaving the function, release OBJECTS_HANDLE.

* src/vm_engine.h (CACHE_PROGRAM):  Use `scm_vector_writable_elements'
  instead of `scm_vector_elements';  don't release the handle right away.

* src/vm_loader.c (load-program):  New commented out piece of code
  dealing with simple vectors.

* src/vm_system.c (object-ref):  Added the type of OBJNUM.

git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-3
2008-04-25 19:09:30 +02:00
Ludovic Courtes
0b5f0e49a8 * src/objcodes.c (make_objcode_by_mmap): Fixed the error type when the
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
2008-04-25 19:09:30 +02:00
Ludovic Courtes
6208295910 Removed a few more deprecated function calls; documented closures.
* src/Makefile.am (.c.x):  Fixed the rule.

* src/envs.c:  Use `scm_hash_get_handle ()' instead of
  `scm_sym2ovcell_soft ()' and `scm_hash_create_handle_x ()' instead of
  `scm_intern_symbol ()'.

* src/objcodes.c (bytecode->objcode):  Don't use `SCM_VALIDATE_INUM', use
  `SCM_VALIDATE_NUMBER' instead.
  (make_objcode_by_mmap):  Check whether the file is smaller than the
  magic cookies; check whether the magic cookies are there.

* src/frames.c (frame-local-ref):  Likewise, but use `SCM_MAKE_VALIDATE'.
  (frame-local-set!):  Likewise.

* src/instructions.c (opcode->instruction):  Likewise.

* src/programs.c (program-external-set!):  New function.

* src/guile-disasm.in:  New file.

* src/Makefile.am:  Produce `guile-disasm'.

* doc/guile-vm.texi:  Documented `external-ref', `external-set', `local-ref'
  and `local-set'.

* module/system/vm/disasm.scm (disassemble-bytecode):  Fixed the way
  `load-program' is represented.

git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-1
2008-04-25 19:09:30 +02:00
Ludovic Court`es
f41cb00ce2 Fixed a stack leak. Now observing actual performance.
* src/*.[ch]:  Replaced `scm_mem2symbol' by `scm_from_locale_symboln' and
  `scm_ulong2num' by `scm_from_ulong'.
* src/vm_system.c (tail-call):  Fixed stack leak (SP lacked decrement by
  one more Scheme object in the tail-recursive case).
* benchmark/measure.scm (measure):  Make sure we are using the compiled
  procedure (i.e. a program object) when measuring.  This yields better
  results than before.  :-)
* doc/guile-vm.texi:  Augmented the instruction set documentation with
  branch instructions, `call' and `tail-call'.

git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-7
2008-04-25 19:09:30 +02:00
Ludovic Court`es
2d80426a3e Improved the VM's efficiency. The VM is as fast as the interpreter. :-(
* benchmark/lib.scm:  New file.
* benchmark/measure.scm:  New file.
* README:  Added useful pointers to various threads.
* doc/guile-vm.texi:  Fixed the description of `load-program' (it now expects
  _immediate_ integers).
* src/*.[ch]:  Use immediate integers whereever possible, as in the original
  code.  For `CONS', use `scm_cell' rather than `scm_cons'.

git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-6
2008-04-25 19:09:30 +02:00
Ludovic Court`es
238e7a11a8 Got the VM up and running! Augmented the documentation.
* src/*.[ch]:  Replaced the remaining `SCM_MAKINUM', and changed `SCM_VELTS'
  into `scm_vector_elements ()'.
* src/vm_loader.c (link):  Fixed so that it pushed a variable object on
  the stack.
* src/vm_system.c (variable-ref):  Fixed so that it uses `scm_variable_ref ()'
  and friends.
* module/system/vm/assemble.scm (dump-object!):  Fixed the string case.
* src/vm_engine.h (CONS):  Use `scm_cons' instead of `SCM_NEWCELL'.
* doc/guile-vm.texi:  Added actual instruction definitions, explanations of
  the program invocation mechanism, programs' object tables, etc., in the
  `Instruction Set' chapter.

git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-5
2008-04-25 19:09:30 +02:00
Ludovic Court`es
fa19602c28 Fixed the compiler, got the disassembler working.
* doc/guile-vm.texi:  Texified and cleaned up.
* src/vm.c:  Use `scm_from_locale_string ()' instead of `scm_makfrom0str ()'.
* src/vm_engine.c:  Likewise.
* src/programs.c (scm_program_bytecode):  Return a u8vector instead of a string.
* module/system/vm/conv.scm (make-byte-decoder):  Fixed a few things wrt. to
  the string to u8vector transition.
* src/objcodes.c (bytecode->objcode):  Fixed a bug where the last 10 bytes of
  the bytecode where ignored.
* module/system/vm/assemble.scm (dump-object!):  Don't convert everything
  to a u8vector, keep strings where it makes sense.
* module/system/vm/conv.scm (code->bytes):  Accordingly, convert strings to
  u8vectors when needed.
  (make-byte-decoder):  Accordingly too, when decoding instructions, return
  variable-length instructions' argument as strings except for `load-program'.
* module/system/vm/disasm.scm:  Export `disassemble-bytecode'.

git-archimport-id: lcourtes@laas.fr--2004-libre/guile-vm--revival--0.6--patch-4
2008-04-25 19:09:30 +02:00
Keisuke Nishida
015959cb4a ChangeLog 2000-09-22 17:38:49 +00:00
Renamed from doc/vm-spec.txt (Browse further)