Commit graph

47 commits

Author SHA1 Message Date
Andy Wingo
3b91e017e3 Merge commit 'e20d7001c3' into vm-check
Conflicts:

	libguile/stacks.c
2009-03-17 16:40:52 +01:00
Ludovic Courtès
e47096d965 Add test for `procedure-properties'.
* test-suite/Makefile.am (SCM_TESTS): Add `tests/procprop.test'.
2009-02-16 00:35:34 +01:00
Andy Wingo
53e28ed9b2 static opcodes; refactor program/objcode division; use new assembly pipeline
* gdbinit: Untested attempts to get the stack fondling macros to deal
  with the new program representation.

* libguile/frames.c (scm_vm_frame_arguments, scm_vm_frame_source)
  (scm_vm_frame_local_ref, scm_vm_frame_local_set_x): SCM_PROGRAM_DATA is
  a struct scm_objcode*.

* libguile/instructions.h:
* libguile/instructions.c: Hide the instruction table and the struct
  scm_instruction structure; all access to instructions now goes through
  procedures. This is because instructions are no longer in a packed
  array indexed by opcode. Also, declare a mask that all instructions
  should fit in.

* libguile/objcodes.h:
* libguile/objcodes.c: Rewrite so that object code directly maps its
  arity and length from its bytecode. This makes it unnecessary to keep
  this information in programs, allowing programs to be simple conses
  between the code (objcodes) and data (the object table and the closure
  variables).

* libguile/programs.c (scm_make_program): Rework so that make-program
  takes objcode, an object table, and externals as arguments. It's much
  clearer this way, and we avoid malloc().

* libguile/stacks.c (is_vm_bootstrap_frame): Update for program/objcode
  changes.

* libguile/vm-engine.c (vm_run): Initialize the jump table on the first
  run, with the opcodes declared in the instruction sources, and with bad
  instructions raising an error instead of wandering off into the
  Unknown.

* libguile/vm-engine.h (FETCH_LENGTH): Always represent lengths as 3
  bytes. The old code was too error-prone.
  (NEXT_JUMP): Mask the instruction with SCM_VM_INSTRUCTION_MASK.
  (NEW_FRAME): Update for program/objcode changes.

* libguile/vm-expand.h (VM_DEFINE_FUNCTION, VM_DEFINE_INSTRUCTION)
  (VM_DEFINE_LOADER): Update so that we explicitly specify opcodes, so
  that we have a stable bytecode API.

* libguile/vm-i-loader.c: Update license to LGPLv2+. Explicitly declare
  opcodes.
  (load-integer): Use an int instead of a long as the accumulator; still
  need to revisit this code at some point, I think.
  (load-program): Simplify, thankfully!! Just creates the objcode slice
  and rolls with it.

* libguile/vm-i-scheme.c: Number the opcodes explicitly.

* libguile/vm-i-system.c: Update license to LGPLv2+. Explicitly declare
  opcodes.
  (make-closure): Update for new program API.

* libguile/vm.c (vm_make_boot_program): Update for new program/objcode
  API. Still a bit ugly.
  (scm_load_compiled_with_vm): Update for new program/objcode API.

* module/language/assembly.scm (byte-length): Fix byte-length calculation
  for loaders, and load-program.
  (code-pack, code-unpack): Start to move things from (system vm conv)
  here.
  (object->code, code->object): More things from conv.scm.

* module/language/glil.scm (<glil-program>): Add a new field,
  closure-level.
  (make-glil-program, compute-closure-level): Calculate the "closure
  level" when making a glil program. This is the maximum depth of
  external binding refs in this closure.
  (unparse-glil): Fix label serialization.

* module/language/glil/compile-assembly.scm (make-meta): Prepend #f for
  the meta's object table, though maybe in the future we can avoid
  creating assembly in the first place.
  (assoc-ref-or-acons, object-index-and-alist): GRRR! Caught again by the
  different sets of arguments to assoc and assoc-ref!
  (glil->assembly): Attempt to make the <glil-program> case more
  readable, and fix the bugs. Sorry I don't know how to comment this
  change any more than this.
  (glil->assembly): For <glil-module> serialize the whole key, not just
  the name.
  (dump-object): subprogram-code is already a list. Serialize integers as
  strings, not u8vectors. Fix the order of lists and vectors.

* module/language/glil/spec.scm (glil): Switch orders, so we prefer glil
  -> assembly -> objcode. Actually glil->objcode doesn't work any more,
  needs to be removed I think.

* module/language/objcode/spec.scm (objcode->value):
  s/objcode->program/make-program/.

* module/language/scheme/inline.scm: Add acons inline.

* module/system/vm/conv.scm (make-byte-decoder): Skip the first 8 bytes,
  they are header. Handle subprograms properly. Still needs help though.
  (decode-length): Lengths are always 3 bytes now.

* module/system/vm/disasm.scm: Superficial changes to keep things
  working. I'd like to fix this better in the future.

* module/system/vm/frame.scm (bootstrap-frame?): Fixes for
  program-bytecode.

* module/system/vm/program.scm: Export make-program. It's program-objcode
  now, no more program-bytecode.

* module/system/vm/vm.scm (vm-load): Use make-program.

* test-suite/tests/asm-to-bytecode.test: New test, very minimal.

* module/system/vm/objcode.scm: Export word-size, byte-order, and
  write-objcode.
2009-01-29 21:12:00 +01:00
Ludovic Courtès
61db429e25 Add `ChangeLog-2008' files to the distribution. 2008-09-12 21:57:52 +02:00
Ludovic Courtès
189681f55b Add `(srfi srfi-88)'. 2008-04-26 19:34:37 +02:00
Ludovic Courtès
1317062f0b Changes from arch/CVS synchronization 2007-12-03 12:36:12 +00:00
Ludovic Courtès
f50ca8da5b Changes from arch/CVS synchronization 2007-08-11 10:08:10 +00:00
Ludovic Courtès
d4c382218d Revision: lcourtes@laas.fr--2006-libre/guile-core--cvs-head--0--patch-81
Creator:  Ludovic Courtes <ludovic.courtes@laas.fr>

Added SRFI-37, by Stephen Compall.

(See ChangeLogs.)
2007-07-18 20:40:09 +00:00
Ludovic Courtès
b89c494395 Changes from arch/CVS synchronization 2006-11-18 18:14:55 +00:00
Kevin Ryde
8ab3d8a068 merge from 1.8 branch 2006-10-09 23:40:48 +00:00
Ludovic Courtès
d15ad007c9 Changes from arch/CVS synchronization 2006-06-13 07:48:42 +00:00
Kevin Ryde
6e7d5622ee merge from 1.8 branch 2006-04-16 23:37:40 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Kevin Ryde
bf04b1a384 * tests/srfi-60.test: New file.
* Makefile.am (SCM_TESTS): Add it.
2005-03-13 00:52:01 +00:00
Kevin Ryde
2c0ddf445a * tests/ramap.test: New file, test array-map!.
* Makefile.am (SCM_TESTS): Add it.
2005-01-04 00:45:13 +00:00
Kevin Ryde
2b78075b31 (SCM_TESTS): Add srfi-39.test. 2005-01-01 22:45:32 +00:00
Kevin Ryde
16e0c623d9 * tests/and-let-star.test, tests/arbiters.test, tests/receive.test:
New files.
	* Makefile.am (SCM_TESTS): Add them.
2004-08-18 00:30:29 +00:00
Kevin Ryde
4f21b9e83f * tests/arbiters.test: New file
* Makefile.am (SCM_TESTS): Add it.
2004-08-17 23:17:06 +00:00
Kevin Ryde
a015df9b8d * tests/slib.test: New file.
* Makefile.am (SCM_TESTS): Add it.
2004-08-09 01:28:23 +00:00
Kevin Ryde
5e9456e306 * tests/filesys.test: New file, exercising copy-file.
* Makefile.am (SCM_TESTS): Add it.
2004-07-31 01:25:26 +00:00
Kevin Ryde
08ee6abd86 * tests/hash.test: New file.
* Makefile.am (SCM_TESTS): Add it.
2004-07-09 22:16:04 +00:00
Rob Browning
dfedf226e6 (SCM_TESTS): add tests/srfi-31.scm. 2004-06-20 14:21:07 +00:00
Kevin Ryde
32938e4dec * tests/socket.test: New file.
* Makefile.am (SCM_TESTS): Add it.
2004-04-24 21:17:13 +00:00
Kevin Ryde
cd858a314c * tests/srfi-11.test: New file.
* Makefile.am (SCM_TESTS): Add it.
2004-04-23 21:19:26 +00:00
Marius Vollmer
7b93c2e5b1 (SCM_TESTS): Added test/fractions.test. 2004-02-17 21:39:10 +00:00
Marius Vollmer
012a3a7537 * tests/srfi-26.test: New.
* Makefile.am (SCM_TESTS): Added it.
2004-01-21 00:45:48 +00:00
Marius Vollmer
c18140cf6e * tests/r5rs_pitfall.scm: New.
* Makefile.am (SCM_TESTS): Added it.
2004-01-11 00:58:38 +00:00
Marius Vollmer
a316356834 (SCM_TESTS): Added continuations.test. 2004-01-07 18:17:04 +00:00
Kevin Ryde
aa52913700 * Makefile.am (SCM_TESTS): Add unif.test. 2004-01-06 22:20:19 +00:00
Kevin Ryde
f14d16ed3a Add copyright and license notice. 2004-01-06 21:47:09 +00:00
Kevin Ryde
e130b09ffa (SCM_TESTS): Add q.test. 2004-01-06 21:45:48 +00:00
Kevin Ryde
c42605e954 * tests/poe.test: New file.
* Makefile.am: Add it.
2003-10-08 23:05:12 +00:00
Kevin Ryde
3bdc8f4d17 * tests/popen.test: New file.
* Makefile.am (SCM_TESTS): Add it.
2003-09-19 01:06:14 +00:00
Kevin Ryde
eb6c635af6 * tests/srcprop.test: New file.
* Makefile.am (SCM_TESTS): Add it.
2003-08-08 23:05:30 +00:00
Kevin Ryde
72a3671e33 * tests/posix.test: New file, exercising putenv, setenv, unsetenv.
* tests/threads.test: New file, exercising parallel.
	* Makefile.am (SCM_TESTS): Add them.
2003-06-19 01:43:22 +00:00
Kevin Ryde
ab32320df4 * tests/srfi-6.test: New file.
* Makefile.am (SCM_TESTS): Add it.
2003-06-11 23:44:01 +00:00
Kevin Ryde
d31350ff35 * tests/srfi-1.test: New file, exercising take and drop.
* Makefile.am (SCM_TESTS): Add it.
2003-05-09 22:42:00 +00:00
Neil Jerram
a1a5dfa888 SRFI 34 2003-04-30 00:06:33 +00:00
Rob Browning
b4559de7a8 * standalone/Makefile.am: new file. 2003-04-07 17:50:48 +00:00
Rob Browning
c62fdb8ee0 *** empty log message *** 2003-03-25 02:14:06 +00:00
Neil Jerram
d2864c8adb New file for tests related to options interface. 2002-11-06 00:38:44 +00:00
Marius Vollmer
d9f352d468 (dist-hook): Do not distribute CVS directories. Thanks to Greg
Troxel!
2002-09-09 20:58:26 +00:00
Marius Vollmer
3c540af468 (SCM_TESTS_DIRS, dist-hook): New, distribute directories manually. 2002-04-17 17:45:05 +00:00
Neil Jerram
3d1a89b9ee * Add non-libguile Elisp support files to CVS trunk. (NB work in progress.) 2002-01-22 23:46:01 +00:00
Marius Vollmer
682542634b (TESTS): Do not call the variable "TESTS", call it "SCM_TESTS". This
has special meaning to automake.  How many tries left to get this
right, mvo?
2001-08-09 17:33:31 +00:00
Marius Vollmer
83060bc4e7 (TESTS): List tests explicitely instead of using a wildcard.
Wildcards don't seem to work for VPATH "make dist"s.
2001-08-08 16:41:28 +00:00
Marius Vollmer
067dd9c61c New file, to control distribution of the test-suite. 2001-08-07 18:18:40 +00:00