bpt/guile.git
15 years agoguile-config rebased on top of pkg-config
Andy Wingo [Mon, 6 Apr 2009 18:07:22 +0000 (11:07 -0700)]
guile-config rebased on top of pkg-config

* configure.in:
* meta/Makefile.am (EXTRA_DIST): Remove guile-config.in bits.

* meta/guile-config: Reimplement to work on top of pkg-config. This lets
  guile-config not be substed by configure.

* meta/uninstalled-env.in: Remove the path to guile-config, belatedly.
  Set the pkg-config path correctly.

15 years agoAvoid uses of deprecated forms in the VM code.
Ludovic Courtès [Sun, 5 Apr 2009 18:15:11 +0000 (20:15 +0200)]
Avoid uses of deprecated forms in the VM code.

Reported by Daniel Kraft <d@domob.eu>.

* libguile/frames.c, libguile/vm.c: Include <stdlib.h>, use `size_t'
  instead of `scm_sizet'.

* libguile/objcodes.c, libguile/programs.c, libguile/vm-engine.c,
  libguile/vm-i-loader.c, libguile/vm-i-system.c: Use `scm_list_X ()'
  instead of the deprecated `SCM_LISTX ()'.

15 years agoMake `--disable-deprecated' work.
daniel [Fri, 13 Feb 2009 13:27:41 +0000 (14:27 +0100)]
Make `--disable-deprecated' work.

* configure.in (enable_deprecated): Set SCM_WARN_DEPRECATED_DEFAULT
  even when --disable-deprecated is passed.
* libguile/deprecation.h: Declare deprecation-issuing methods even
  if SCM_ENABLE_DEPRECATED is not set.
* libguile/deprecation.c: Ditto.
  (scm_init_deprecation): Include full body even for unset
  SCM_ENABLE_DEPRECATED.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
15 years agoImproved handling of callers cache in (system xref).
Jose A. Ortega Ruiz [Sat, 4 Apr 2009 09:59:57 +0000 (11:59 +0200)]
Improved handling of callers cache in (system xref).

  * We cache callees in each module, and keep a list of modified
    ('tainted') modules, which is used to reconstruct the callers
    database incrementally.
  * `procedure-callers' now returns an a-list, keyed by module name.

15 years agofix nondeterminism in vm-i-system.c
Andy Wingo [Sat, 4 Apr 2009 18:36:18 +0000 (11:36 -0700)]
fix nondeterminism in vm-i-system.c

* libguile/vm-i-system.c (br-if-eq, br-if-not-eq): Fix some
  nondeterminism caught by GCC 4.4.

15 years agono hard-coded stack limitations if the user has getrlimit
Andy Wingo [Fri, 3 Apr 2009 17:38:30 +0000 (10:38 -0700)]
no hard-coded stack limitations if the user has getrlimit

* libguile/debug.c (init_stack_limit): Instead of "1 MB or 80% of rlimit,
  whichever is lower", just use 80% of the rlimit, if set.

15 years agoadd test case for load-extension bug, fix gdb-uninstalled-guile
Andy Wingo [Tue, 31 Mar 2009 03:28:30 +0000 (20:28 -0700)]
add test case for load-extension bug, fix gdb-uninstalled-guile

* test-suite/standalone/test-extensions:
* test-suite/standalone/test-extensions-lib.c:
* test-suite/standalone/Makefile.am: Add a test case for the
  load-extension bug.

* meta/gdb-uninstalled-guile.in: Fix the path to include meta/.

15 years agoMerge branch 'wingo'
Andy Wingo [Sun, 29 Mar 2009 05:31:20 +0000 (22:31 -0700)]
Merge branch 'wingo'

15 years agofix duplicates in procedure-callers
Andy Wingo [Sun, 29 Mar 2009 05:21:00 +0000 (22:21 -0700)]
fix duplicates in procedure-callers

* module/system/xref.scm (ensure-callers-db): OK! Since we can see the
  same variable twice, e.g. in different modules, keep a unified hash of
  seen vars and modules. Prevents duplicates in procedure-callers.

15 years agofix spurious duplicates in procedure-callees and callers
Andy Wingo [Sun, 29 Mar 2009 04:57:26 +0000 (21:57 -0700)]
fix spurious duplicates in procedure-callees and callers

* module/system/xref.scm (program-callee-rev-vars): It's possible to get
  duplicates when combining callees of inner procedures, so ignore dups.
  Quadratic, boo.

15 years agobugfix: don't dynamic link if we found a registered extension
Andy Wingo [Sat, 28 Mar 2009 01:47:13 +0000 (18:47 -0700)]
bugfix: don't dynamic link if we found a registered extension

* libguile/extensions.c (load_extension): Don't do dynamic linking if we
  actually did find an extension in the list.

15 years agoframe, program, objcode, etc inits use load-extension
Andy Wingo [Sat, 28 Mar 2009 01:40:15 +0000 (18:40 -0700)]
frame, program, objcode, etc inits use load-extension

* libguile/extensions.h: Define a scm_t_extension_init_func.

* libguile/frames.c:
* libguile/instructions.c:
* libguile/objcodes.c:
* libguile/programs.c:
* libguile/vm.c: Register extension init funcs. Should play nicer with a
  static Guile, in addition to working on Darwin with non-default
  installation prefixes without munging DYLD_LIBRARY_PATH.

* module/system/vm/frame.scm:
* module/system/vm/instruction.scm:
* module/system/vm/objcode.scm:
* module/system/vm/program.scm:
* module/system/vm/vm.scm: Use load-extension.

15 years agofix distcheck hopefully, by cleaning the vm-i-*.i files
Andy Wingo [Fri, 27 Mar 2009 23:21:20 +0000 (16:21 -0700)]
fix distcheck hopefully, by cleaning the vm-i-*.i files

* libguile/Makefile.am (CLEANFILES): Clean vm-i-*.i.

15 years agofix "linking" of guile-config
Andy Wingo [Fri, 27 Mar 2009 23:11:43 +0000 (16:11 -0700)]
fix "linking" of guile-config

* meta/guile-config.in: Adjust "linking"; @bindir@ doesn't get fully
  expanded. So instead use a shell trampoline.

15 years agofix check for guile-tools running uninstalled
Andy Wingo [Fri, 27 Mar 2009 23:01:12 +0000 (16:01 -0700)]
fix check for guile-tools running uninstalled

* meta/guile-tools.in (mydir): Fix check for running uninstalled.

15 years agorely on getrlimit to DTRT, don't make stack calibration file
Andy Wingo [Fri, 27 Mar 2009 22:51:16 +0000 (15:51 -0700)]
rely on getrlimit to DTRT, don't make stack calibration file

* libguile/measure-hwm.scm: Remove.

* .gitignore: Update for removal.

* test-suite/standalone/test-fast-slot-ref.in:
* test-suite/standalone/test-use-srfi.in:
* am/guilec:
* check-guile.in: Revert back to normal guile invocation.

* libguile/Makefile.am: Don't make a stack calibration file, as the
  getrlimit-based limit setting should work fine.

15 years agogetrlimit-based stack limits
Andy Wingo [Fri, 27 Mar 2009 22:44:17 +0000 (15:44 -0700)]
getrlimit-based stack limits

* libguile/debug.c (init_stack_limit): Initialize the stack limit based
  on operating system limits (via getrlimit(2)), or 1 MB -- whichever is
  smaller.

15 years agoadd getrlimit and setrlimit wrappers
Andy Wingo [Fri, 27 Mar 2009 22:06:41 +0000 (15:06 -0700)]
add getrlimit and setrlimit wrappers

* README: Some rewording.

* configure.in: Check for getrlimit and setrlimit.

* libguile/posix.h:
* libguile/posix.c: Add some getrlimit and setrlimit wrappers. They're
  documented, but I suspect something else has to be done to get them
  into the manual.

15 years agoallow building against uninstalled guile; move some things to meta/
Andy Wingo [Fri, 27 Mar 2009 21:03:03 +0000 (14:03 -0700)]
allow building against uninstalled guile; move some things to meta/

* README: Add more info about building against an uninstalled Guile.

* meta/: New directory. The proximate cause of its creation is that I
  want to be able to build external packages against uninstalled Guile,
  and to do that I need guile-tools in the PATH, but I don't want
  $top_builddir/libtool in the path. But it seems like a good
  reorganization, for things that are /about/ Guile: pkg-config files, m4
  files, guile-config... then we also include uninstalled info: the
  environment, the pre-inst-guile script, etc.

* meta/guile-1.8-uninstalled.pc.in: New pkg-config template. pkg-config
  prefers -uninstalled pkg-config files, if they are in its path.

* meta/Makefile.am:
* meta/ChangeLog-2008:
* meta/gdb-uninstalled-guile.in:
* meta/guile-1.8.pc.in:
* meta/guile-config.in:
* meta/guile.m4:
* meta/guile-tools.in: Moved to meta/.

* meta/guile.in: This is the new name of pre-inst-guile.in.

* meta/uninstalled-env.in: And this, pre-inst-guile-env.in.

* Makefile.am:
* am/guilec:
* am/pre-inst-guile:
* check-guile.in:
* configure.in:
* doc/ref/Makefile.am:
* gc-benchmarks/run-benchmark.scm:
* test-suite/standalone/Makefile.am:
* test-suite/standalone/README:
* testsuite/Makefile.am: Adapt to meta/ change.

15 years agoImprove wording in `libguile/Makefile.am' regarding stack calibration.
Ludovic Courtès [Fri, 27 Mar 2009 08:50:06 +0000 (09:50 +0100)]
Improve wording in `libguile/Makefile.am' regarding stack calibration.

* libguile/Makefile.am (stack-limit-calibration.scm): Improve wording of
  the comment.  Suggested by Neil Jerram.

15 years agoRun the stack calibration script before running the compiler.
Ludovic Courtès [Thu, 26 Mar 2009 18:17:26 +0000 (19:17 +0100)]
Run the stack calibration script before running the compiler.

* am/guilec (.scm.go): Use `pre-inst-guile' and load
  `stack-limit-calibration.scm'.  This is particularly useful when
  building the first `.go' files where the compiler is run using the
  interpreter, which may end up using a lot of stack space.

* libguile/Makefile.am (BUILT_SOURCES): Add
  `stack-limit-calibration.scm'.
  (TESTS, TESTS_ENVIRONMENT): Remove.
  (stack-limit-calibration.scm): Prepend `-' so that any errors during
  the calibration are ignored.

15 years agoRemove multiple definition of `scm_i_marking'.
Ludovic Courtès [Thu, 26 Mar 2009 17:47:28 +0000 (18:47 +0100)]
Remove multiple definition of `scm_i_marking'.

* libguile/private-gc.h (scm_i_marking): Turn definition into a
  declaration.
  (scm_mark_all): Mark as `SCM_INTERNAL'.

* libguile/gc-mark.c (scm_i_marking): New definition.

15 years agoFix `testsuite/Makefile.am' for `distcheck'.
Ludovic Courtès [Tue, 24 Mar 2009 23:23:23 +0000 (00:23 +0100)]
Fix `testsuite/Makefile.am' for `distcheck'.

* testsuite/Makefile.am (check_SCRIPTS): Remove, renamed to `TESTS'.
  (EXTRA_DIST): Add $(TESTS).

15 years agoAggregate `Makefile.am' files under `examples/'.
Ludovic Courtès [Fri, 20 Mar 2009 00:11:16 +0000 (01:11 +0100)]
Aggregate `Makefile.am' files under `examples/'.

* configure.in: Don't produce `examples/*/Makefile'.

* examples/Makefile.am (SUBDIRS): Remove.
  (EXTRA_DIST, AM_CFLAGS, AM_LIBS): New.
  (box/box, box/box.o, box-module/box, box-module/box.o, libbox.la,
  box-dynamic/box.lo, libbox-module.la, box-dynamic-module/box.lo,
  installcheck, CLEANFILES, clean-local): New targets, aggregated from
  `Makefile.am' files formerly in sub-directories.

* examples/check.test: New file, aggregated from `check.test' files in
  sub-directories.

15 years agoInclude <alloca.h> in `gsubr.c'.
Ludovic Courtès [Tue, 24 Mar 2009 22:37:41 +0000 (23:37 +0100)]
Include <alloca.h> in `gsubr.c'.

* libguile/gsubr.c: Include <alloca.h>.  Reported by Carlo Bramini
  <carlo.bramix@libero.it>.

15 years agospeed up goops rehashing
Andy Wingo [Fri, 20 Mar 2009 12:20:28 +0000 (13:20 +0100)]
speed up goops rehashing

* module/oop/goops/dispatch.scm (cache-try-hash!): Speed up goops
  rehashing, in theory. I haven't measured, though.

15 years agofix interpreted methods with empty bodies
Andy Wingo [Fri, 20 Mar 2009 11:52:24 +0000 (12:52 +0100)]
fix interpreted methods with empty bodies

* module/oop/goops.scm (method): If a method has no body, subst in `(if
  #f #f)' instead of `(begin)', to please the memoizer.

15 years agoadd generic method-formals; fixes to method-source
Andy Wingo [Fri, 20 Mar 2009 11:06:10 +0000 (12:06 +0100)]
add generic method-formals; fixes to method-source

* module/oop/goops.scm (method-source): Don't throw an error if this
  method has no source.
  (method-formals): New generic function, the complement of
  method-specializers for introspection.

15 years agofix casts to unsigned long in objcodes.c
Andy Wingo [Thu, 19 Mar 2009 10:46:22 +0000 (11:46 +0100)]
fix casts to unsigned long in objcodes.c

* libguile/objcodes.c (scm_c_make_objcode_slice): Fix casts to unsigned
  long.

15 years agoHave `scm_take_locale_symbol ()' return an interned symbol (fixes bug #25865).
Ludovic Courtès [Wed, 18 Mar 2009 21:28:37 +0000 (22:28 +0100)]
Have `scm_take_locale_symbol ()' return an interned symbol (fixes bug #25865).

* libguile/symbols.c (intern_symbol): New function, with code formerly
  duplicated in `scm_i_c_mem2symbol ()' and `scm_i_mem2symbol ()'.
  (scm_i_c_mem2symbol, scm_i_mem2symbol): Use it.
  (scm_take_locale_symboln): Use `intern_symbol ()'.  This fixes
  bug #25865.

* test-suite/standalone/Makefile.am
  (test_scm_take_locale_symbol_SOURCES,
  test_scm_take_locale_symbol_CFLAGS,
  test_scm_take_locale_symbol_LDADD): New variables.
  (check_PROGRAMS, TESTS): Add `test-scm-take-locale-symbol'.

15 years agorework procedure-callers to stay correct as callees are redefined
Andy Wingo [Wed, 18 Mar 2009 00:49:28 +0000 (01:49 +0100)]
rework procedure-callers to stay correct as callees are redefined

* module/system/xref.scm (procedure-callers): Rework to calculate the
  callers of a *variable*, not of a value. This is because the
  module-observers only get fired when the module changes, not with the
  variables change values. Also accept either a variable, a symbol
  (resolved in the current module), or a modname . symname pair.

15 years agodoubly-weak callers db
Andy Wingo [Tue, 17 Mar 2009 23:46:16 +0000 (00:46 +0100)]
doubly-weak callers db

* module/system/xref.scm (ensure-callers-db): Store the callers db as a
  doubly-weak hash table.

15 years agoimplement procedure-callers
Andy Wingo [Tue, 17 Mar 2009 23:44:26 +0000 (00:44 +0100)]
implement procedure-callers

* module/system/xref.scm: Implement procedure-callers, as the inverse of
  procedure-callees, with a cache invalidated by changes in modules.

* module/ice-9/boot-9.scm (module-use!): Don't poke module observers when
  module-use! is called for an already-used module.

15 years agoadd xref stub for interpreted procedures
Andy Wingo [Tue, 17 Mar 2009 22:16:35 +0000 (23:16 +0100)]
add xref stub for interpreted procedures

* module/system/xref.scm (hacky-procedure-callees): Add a
  procedure-callees implementation for procedures with source, that
  currently does nothing. Not sure what to do, going into the future.

15 years agoadd xref.scm
Andy Wingo [Tue, 17 Mar 2009 22:11:56 +0000 (23:11 +0100)]
add xref.scm

* module/system/xref.scm: New module, will provide callers/callees info.

* module/Makefile.am (SOURCES): Add xref.scm.

15 years agotweaks to the un-integrated test cases
Andy Wingo [Mon, 16 Mar 2009 22:45:07 +0000 (23:45 +0100)]
tweaks to the un-integrated test cases

* testsuite/Makefile.am: Sortof turn these VM tests into more
  automake-like tests. Needs further work.

15 years agonon-srcdir build fixes
Andy Wingo [Mon, 16 Mar 2009 22:39:29 +0000 (23:39 +0100)]
non-srcdir build fixes

* guile-tools.in: Fix the checks to account for non-srcdir builds.

* libguile/frames.c:
* libguile/objcodes.c:
* libguile/programs.c:
* libguile/instructions.c:
* libguile/vm.c: Fix snarf-includes to cope with non-srcdir builds.

* libguile/instructions.h:
* libguile/instructions.c: Fix the stubs inclusion to be non-srcdir
  compatible.

* libguile/vm-expand.h (VM_DEFINE_INSTRUCTION): Fix some things so as not
  to require the instructions.h defintitions, since we have the codes
  already. Not important tho :)

* pre-inst-guile-env.in: Minor tweak that should have no effect.

* test-suite/standalone/Makefile.am (all-local): Remove a chmod +x step,
  the configure.ac rule should do that if necessary.

15 years agotry a new way of checking byte order
Andy Wingo [Mon, 16 Mar 2009 21:41:50 +0000 (22:41 +0100)]
try a new way of checking byte order

15 years agodecompile source info into <glil-source> annotations.
Andy Wingo [Sat, 14 Mar 2009 15:24:34 +0000 (16:24 +0100)]
decompile source info into <glil-source> annotations.

* module/language/glil/decompile-assembly.scm (decompile-load-program):
  Decompile source information into <glil-source> annotations.

15 years agofix bug serializing filenames in source locations
Andy Wingo [Sat, 14 Mar 2009 15:03:34 +0000 (16:03 +0100)]
fix bug serializing filenames in source locations

* module/language/glil/compile-assembly.scm (limn-sources): Fix bug
  whereby filename was serialized as a ("foo") instead of "foo".

15 years agotweaks to asm->glil decompiler, perhaps fix a (program-source p 0) bug
Andy Wingo [Sat, 14 Mar 2009 14:54:19 +0000 (15:54 +0100)]
tweaks to asm->glil decompiler, perhaps fix a (program-source p 0) bug

* module/language/ghil/compile-glil.scm (codegen): Push a program's
  source locations before copying external args to heap -- perhaps fixes
  (program-source p 0) for some programs.

* module/language/glil/decompile-assembly.scm (decompile-load-program):
  Take another arg, the object vector. Emit <glil-bind> and <glil-unbind>
  correctly. Properly unparse properties. Just have to deal with source
  locations now.

15 years agoadd assembly->glil decompiler
Andy Wingo [Sat, 14 Mar 2009 12:59:57 +0000 (13:59 +0100)]
add assembly->glil decompiler

* module/language/glil/decompile-assembly.scm: A first pass at an
  assembly->glil decompiler. Works for a small subset of programs.

* module/Makefile.am (GLIL_LANG_SOURCES):
* module/language/glil/spec.scm (glil): Add the decompiler.

15 years agoupdate disassembler for changes to decompiler
Andy Wingo [Sat, 14 Mar 2009 11:07:04 +0000 (12:07 +0100)]
update disassembler for changes to decompiler

* module/language/assembly/disassemble.scm (disassemble-load-program)
  (code-annotation): And update the disassembler for changes to
  decompiler.

15 years agoparse jumps as labels when decompiling bytecode->assembly
Andy Wingo [Sat, 14 Mar 2009 11:01:56 +0000 (12:01 +0100)]
parse jumps as labels when decompiling bytecode->assembly

* module/language/assembly/decompile-bytecode.scm (decode-load-program):
  Parse out jumps as labels.

15 years agoprocedure-arity on vm-compile apply: verily, unresolved.
Andy Wingo [Fri, 13 Mar 2009 22:55:51 +0000 (23:55 +0100)]
procedure-arity on vm-compile apply: verily, unresolved.

* test-suite/tests/procprop.test ("procedure-arity"): Procedure-property
  'arity on "apply" will fail if "apply" is a program. I suggest that
  procedure-property is actually the wrong interface for this; if we even
  want to preseve the old arity forms, we should have an accessor for
  arity directly that the VM can implement. But in the meantime throw
  this nasty error while we decide.

15 years agoMerge commit 'cb9d473112ac172a3d328bb029b5b550918d4262' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:41:01 +0000 (16:41 +0100)]
Merge commit 'cb9d473112ac172a3d328bb029b5b550918d4262' into vm-check

15 years agoMerge commit 'e20d7001c3f7150400169fecb0bf0eefdf122fe2' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:40:52 +0000 (16:40 +0100)]
Merge commit 'e20d7001c3f7150400169fecb0bf0eefdf122fe2' into vm-check

Conflicts:

libguile/stacks.c

15 years agofix marking of double-cell subrs
Andy Wingo [Tue, 17 Mar 2009 15:36:20 +0000 (16:36 +0100)]
fix marking of double-cell subrs

* libguile/gc-mark.c (scm_gc_mark_dependencies): Mark the name, generic,
  and properties of subrs.

15 years agoMerge commit 'e092357058850a6f998bf462bdc5504c6379c96f' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:10:14 +0000 (16:10 +0100)]
Merge commit 'e092357058850a6f998bf462bdc5504c6379c96f' into vm-check

15 years agoMerge commit 'feccd2d3100fd2964d4c2df58ab3da7ce4949a66' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:09:41 +0000 (16:09 +0100)]
Merge commit 'feccd2d3100fd2964d4c2df58ab3da7ce4949a66' into vm-check

15 years agoMerge commit 'cce8b2ce93703aff953750fb40cb53176ea66504' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:09:02 +0000 (16:09 +0100)]
Merge commit 'cce8b2ce93703aff953750fb40cb53176ea66504' into vm-check

15 years agoMerge commit '4c9e29ec38350a5206aa3e8e72ad4376512ada2b' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:06:52 +0000 (16:06 +0100)]
Merge commit '4c9e29ec38350a5206aa3e8e72ad4376512ada2b' into vm-check

15 years agoMerge commit 'ad5f5ada1d50ecdab634d60ffe3a13b9193156aa' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:06:44 +0000 (16:06 +0100)]
Merge commit 'ad5f5ada1d50ecdab634d60ffe3a13b9193156aa' into vm-check

15 years agoMerge commit '95a040cd2be7ad03bf197edbdb1fec2c52749ef6' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:05:47 +0000 (16:05 +0100)]
Merge commit '95a040cd2be7ad03bf197edbdb1fec2c52749ef6' into vm-check

15 years agoMerge commit '6290d3f10927f887102a164ccb1a7291cc62288d' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:05:41 +0000 (16:05 +0100)]
Merge commit '6290d3f10927f887102a164ccb1a7291cc62288d' into vm-check

15 years agoMerge commit '5bb2d903b9e54fdd5858a16ba11fa91a9dc0c692' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:05:37 +0000 (16:05 +0100)]
Merge commit '5bb2d903b9e54fdd5858a16ba11fa91a9dc0c692' into vm-check

15 years agoMerge commit '04795a1cb259c20896fb2edb50c58086027281b0' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:04:04 +0000 (16:04 +0100)]
Merge commit '04795a1cb259c20896fb2edb50c58086027281b0' into vm-check

15 years agoMerge commit '202271f291971cf14175f5a1a193955f72d43d79' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:01:35 +0000 (16:01 +0100)]
Merge commit '202271f291971cf14175f5a1a193955f72d43d79' into vm-check

15 years agoMerge commit 'c010924a71f942100dc7b4021d5ef1c6decf9c85' into vm-check
Andy Wingo [Tue, 17 Mar 2009 15:01:18 +0000 (16:01 +0100)]
Merge commit 'c010924a71f942100dc7b4021d5ef1c6decf9c85' into vm-check

15 years agoMerge commit '53d81399bef1d9396665e79fb6b9c25eb8e2a6ad' into vm-check
Andy Wingo [Tue, 17 Mar 2009 14:59:40 +0000 (15:59 +0100)]
Merge commit '53d81399bef1d9396665e79fb6b9c25eb8e2a6ad' into vm-check

Also cherry-picks the changes from 1405f1b60fa178303484cd428068ecd01ff6d322

Conflicts:

module/ice-9/session.scm

15 years agoMerge commit 'ab878b0f8e675a741a7dd56f52638a7cc0419907' into vm-check
Andy Wingo [Tue, 17 Mar 2009 14:57:07 +0000 (15:57 +0100)]
Merge commit 'ab878b0f8e675a741a7dd56f52638a7cc0419907' into vm-check

15 years agoMerge commit 'cbee5075d69cb057c4af4c5e24319da90367897f' into vm-check
Andy Wingo [Tue, 17 Mar 2009 14:56:31 +0000 (15:56 +0100)]
Merge commit 'cbee5075d69cb057c4af4c5e24319da90367897f' into vm-check

15 years agoMerge commit '32a2609de06af65341e6b4db6961557b788821e8' into vm-check
Andy Wingo [Tue, 17 Mar 2009 14:56:22 +0000 (15:56 +0100)]
Merge commit '32a2609de06af65341e6b4db6961557b788821e8' into vm-check

15 years agoMerge commit 'e95d11110b7af0f528404d28209c3a464ab7074d' into vm-check
Andy Wingo [Tue, 17 Mar 2009 14:54:42 +0000 (15:54 +0100)]
Merge commit 'e95d11110b7af0f528404d28209c3a464ab7074d' into vm-check

15 years agoMerge commit '752be95a475132506c35922d284884cf776149d0' into vm-check
Andy Wingo [Tue, 17 Mar 2009 14:54:34 +0000 (15:54 +0100)]
Merge commit '752be95a475132506c35922d284884cf776149d0' into vm-check

Conflicts:

INSTALL

15 years agoMerge commit '8b0174c879bf74981efe702a00471ed5b8e6912e' into vm-check
Andy Wingo [Tue, 17 Mar 2009 14:52:41 +0000 (15:52 +0100)]
Merge commit '8b0174c879bf74981efe702a00471ed5b8e6912e' into vm-check

15 years agorevert annotation support in syncase. another day perhaps.
Andy Wingo [Fri, 13 Mar 2009 22:45:24 +0000 (23:45 +0100)]
revert annotation support in syncase. another day perhaps.

* module/ice-9/syncase.scm: Revert support for annotations, as I'm seeing
  wierd problems whereby syntax-object->datum does not fully strip its
  input.

15 years agoUpdate `NEWS'.
Ludovic Courtès [Mon, 9 Mar 2009 17:59:04 +0000 (18:59 +0100)]
Update `NEWS'.

15 years agoFix errors when stripping annotations
Andy Wingo [Sun, 8 Mar 2009 22:51:12 +0000 (23:51 +0100)]
Fix errors when stripping annotations

* module/ice-9/annotate.scm (set-annotation-stripped!): Fix prototype to
  correspond to what syncase needs.

* module/ice-9/psyntax.scm (strip-annotation): Use `if', not `when', for
  portability.

* module/ice-9/psyntax-pp.scm: Regenerate.

15 years agoAggregate `Makefile.am' files under `lang/'.
Ludovic Courtès [Sun, 8 Mar 2009 21:16:37 +0000 (22:16 +0100)]
Aggregate `Makefile.am' files under `lang/'.

* lang/Makefile.am (SUBDIRS): Remove.
  (elisp_sources): Aggregate the value of `elisp_SOURCES' formerly found
  in sub-directories' `Makefile.am'.

15 years agoMove `guardians.test' to its own module.
Ludovic Courtès [Sat, 28 Feb 2009 15:59:05 +0000 (16:59 +0100)]
Move `guardians.test' to its own module.

* test-suite/tests/guardians.test: Add `define-module' clause.

15 years agoProvide a C vararg interface to gsubr invocation.
Ludovic Courtès [Sun, 8 Mar 2009 15:36:14 +0000 (16:36 +0100)]
Provide a C vararg interface to gsubr invocation.

* libguile/eval.i.c (CEVAL): Update calls to `scm_i_gsubr_apply ()' with
  a fixed number of arguments.  Use `scm_i_gsubr_apply_list ()' for
  calls with a list of arguments of unknown length.
  (SCM_APPLY): Use `scm_i_gsubr_apply_list ()' instead of
  `scm_i_gsubr_apply ()'.

* libguile/gsubr.c (gsubr_apply_raw): New.
  (scm_i_gsubr_apply): Change to take a C vararg list instead of a
  Scheme list.  Use `gsubr_apply_raw ()'.
  (scm_i_gsubr_apply_list): Use `gsubr_apply_raw ()'.

* libguile/gsubr.h (scm_i_gsubr_apply): Update prototype.
  (scm_i_gsubr_apply_list): New declaration.

15 years agoSlightly simplify gsubr invocation in the evaluator.
Ludovic Courtès [Sun, 8 Mar 2009 11:19:42 +0000 (12:19 +0100)]
Slightly simplify gsubr invocation in the evaluator.

* libguile/eval.i.c (CEVAL): Remove the `cclon' label; replace jumps to
  `cclon' with `RETURN (scm_i_gsubr_apply (...))'.

15 years agoAdd new subr invocation benchmarks.
Ludovic Courtès [Sun, 8 Mar 2009 15:38:51 +0000 (16:38 +0100)]
Add new subr invocation benchmarks.

* benchmark-suite/benchmarks/subr.bm (hook1, hook3): New variables.
  ("subr invocation")("generic subr with rest arg", "generic subr with
  rest arg and 3+ parameters"): New benchmarks.
  ("subr application")("generic subr with rest arg", "generic subr with
  rest arg and 3+ parameters"): New benchmarks.

15 years agoactually use syncase's source information tracking. rock!
Andy Wingo [Fri, 6 Mar 2009 18:50:11 +0000 (19:50 +0100)]
actually use syncase's source information tracking. rock!

* module/ice-9/annotate.scm (deannotate/source-properties): Version of
  deannotate that sets source properties on the resulting expressions.

* module/ice-9/syncase.scm (sc-macro, syncase): Annotate expressions
  before they go into syncase, and deannotate/source-properties when they
  come out. The upshot is that syncase now understands source
  information, yay!

15 years agomodify psyntax so it produced annotated source if given annotated source
Andy Wingo [Fri, 6 Mar 2009 18:37:44 +0000 (19:37 +0100)]
modify psyntax so it produced annotated source if given annotated source

* module/ice-9/psyntax.scm (build-annotated): New helper, used by the
  output constructors.
  (build-application, build-conditional, build-lexical-reference)
  (build-lexical-assignment, build-global-reference)
  (build-global-assignment, build-global-definition, build-lambda)
  (build-primref, build-data, build-sequence, build-let)
  (build-named-let, build-letrec, build-lexical-var): Use
  build-annotated, so we produce annotated source if we have source
  information.

* module/ice-9/psyntax-pp.scm: Regenerated.

15 years agosupport source-level annotations in syncase
Andy Wingo [Fri, 6 Mar 2009 16:01:47 +0000 (17:01 +0100)]
support source-level annotations in syncase

* module/ice-9/annotate.scm (<annotation>): Slightly more concise
  printing.
  (annotate): Don't create annotations if we have no source info.

* module/ice-9/psyntax.scm (annotation?): Remove this definition, as we
  now provide annotation support.

* module/ice-9/psyntax-pp.scm: Regenerated.

* module/ice-9/syncase.scm: Use (ice-9 annotate).

* module/language/scheme/expand.scm (eval-when): Define the eval-when
  transformer.

15 years agofix eval-when statements in boot-9
Andy Wingo [Fri, 6 Mar 2009 15:57:17 +0000 (16:57 +0100)]
fix eval-when statements in boot-9

* module/ice-9/boot-9.scm: Fix a couple eval-when statements.

15 years agoReplace eval-case with eval-when
Andy Wingo [Fri, 6 Mar 2009 12:29:13 +0000 (13:29 +0100)]
Replace eval-case with eval-when

* module/ice-9/boot-9.scm (eval-when): Replace eval-case with eval-when.
  Eval-when is *much* simpler, and more expressive to boot. Perhaps in
  the future we'll get 'visit and 'revisit too.

* module/ice-9/deprecated.scm (eval-case): Provide mostly-working
  deprecated version of eval-case.

* module/ice-9/boot-9.scm (defmacro, define-macro): Relax condition: we
  can make defmacros that are not at the toplevel now. But in the future
  we should replace this implementation of defmacros with one written in
  syntax-case.
  (define-module, use-modules, use-syntax): Allow at non-toplevel.
  (define-public, defmacro-public, export, re-export): Don't evaluate at
  compile-time, I can't see how that helps things. Allow `export' and
  `re-export' at non-toplevel.

* module/ice-9/getopt-long.scm:
* module/ice-9/i18n.scm:
* module/oop/goops.scm:
* module/oop/goops/compile.scm:
* module/oop/goops/dispatch.scm: Switch to use eval-when, not
  eval-case.

* module/language/scheme/compile-ghil.scm (eval-when): Replace eval-case
  transformer with eval-when transformer. Sooooo much simpler, and it
  will get better once we separate expansion from compilation.

* module/language/scheme/expand.scm (quasiquote): Hm, expand quasiquote
  properly. Not hygienic. Syncase needed.
  (lambda): Handle internal defines with docstrings propertly.

15 years agofixups to expand.scm
Andy Wingo [Mon, 2 Mar 2009 21:15:27 +0000 (22:15 +0100)]
fixups to expand.scm

* module/language/scheme/expand.scm: Some changes to avoid unnecessary
  begins or empty lets, and properly handle internal defines (finally).

15 years agoadd separate expansion phase, to detwingle things a bit
Andy Wingo [Mon, 2 Mar 2009 16:27:45 +0000 (17:27 +0100)]
add separate expansion phase, to detwingle things a bit

* module/language/scheme/expand.scm: New module, implements a separate
  expansion phase, not interleaved with compilation.

* module/language/scheme/amatch.scm: Helper for expand.scm, it's pmatch
  with support for annotated source.

* module/ice-9/Makefile.am (SOURCES): Add annotate.scm to build list --
  early on because it will be used in the compiler.

* module/ice-9/annotate.scm: Fix the printer, default to unstripped
  (whatever that is), and add a deannotator.

* module/system/base/compile.scm (call-with-compile-error-catch): Fix for
  new representation of source locations.

* module/Makefile.am (SCHEME_LANG_SOURCES): Add amatch and expand.

15 years agofix printer in struct docs
Andy Wingo [Mon, 2 Mar 2009 14:46:17 +0000 (15:46 +0100)]
fix printer in struct docs

* doc/ref/api-compound.texi (Vtables): Fix example printer.

15 years agoadd annotation module
Andy Wingo [Mon, 2 Mar 2009 10:23:03 +0000 (11:23 +0100)]
add annotation module

* module/ice-9/annotate.scm: Add annotation module, for source location
  tracking with syncase, and for internal use in the compiler.

15 years agoMark `scm_gsubr_apply ()' as internal.
Ludovic Courtès [Tue, 17 Feb 2009 22:29:44 +0000 (23:29 +0100)]
Mark `scm_gsubr_apply ()' as internal.

* libguile/gsubr.h (scm_gsubr_apply): Renamed to...
  (scm_i_gsubr_apply): this.  Marked as `SCM_INTERNAL'.  Callers
  updated.

15 years agoRemove "compiled closures" ("cclos") in favor of a simpler mechanism.
Ludovic Courtès [Sun, 15 Feb 2009 23:24:00 +0000 (00:24 +0100)]
Remove "compiled closures" ("cclos") in favor of a simpler mechanism.

The idea is to introduce `gsubrs' whose arity is encoded in their type
(more precisely in the sizeof (void *) - 8 MSBs).  This removes the
indirection introduced by cclos and simplifies the code.

* libguile/__scm.h (CCLO): Remove.

* libguile/debug.c (scm_procedure_source, scm_procedure_environment):
  Remove references to `scm_tc7_cclo'.

* libguile/eval.c (scm_trampoline_0, scm_trampoline_1,
  scm_trampoline_2): Replace `scm_tc7_cclo' with `scm_tc7_gsubr'.

* libguile/eval.i.c (CEVAL): Likewise.  No longer make PROC the first
  argument.  Directly invoke `scm_gsubr_apply ()' instead of jump to the
  `evap(N+1)' label or call to `SCM_APPLY ()'.

* libguile/evalext.c (scm_self_evaluating_p): Remove reference to
  `scm_tc7_cclo'.

* libguile/gc-card.c (scm_i_sweep_card, scm_i_tag_name): Likewise.

* libguile/gc-mark.c (scm_gc_mark_dependencies): Likewise.

* libguile/goops.c (scm_class_of): Likewise.

* libguile/print.c (iprin1): Likewise.

* libguile/gsubr.c (create_gsubr): Use `unsigned int's for REQ, OPT and
  RST.  Use `scm_tc7_gsubr' instead of `scm_makcclo ()' in the default
  case.
  (scm_gsubr_apply): Remove calls to `SCM_GSUBR_PROC ()'.
  (scm_f_gsubr_apply): Remove.

* libguile/gsubr.h (SCM_GSUBR_TYPE): New definition.
  (SCM_GSUBR_MAX): Changed to 33.
  (SCM_SET_GSUBR_TYPE, SCM_GSUBR_PROC, SCM_SET_GSUBR_PROC,
  scm_f_gsubr_apply): Remove.

* libguile/procprop.c (scm_i_procedure_arity): Remove reference to
  `scm_tc7_cclo'; add proper handling of `scm_tc7_gsubr'.

* libguile/procs.c (scm_makcclo, scm_make_cclo): Remove.
  (scm_procedure_p): Remove reference to `scm_tc7_cclo'.
  (scm_thunk_p): Likewise, plus add proper `scm_tc7_gsubr' handling.

* libguile/procs.h (SCM_CCLO_LENGTH, SCM_MAKE_CCLO_TAG,
  SCM_SET_CCLO_LENGTH, SCM_CCLO_BASE, SCM_SET_CCLO_BASE, SCM_CCLO_REF,
  SCM_CCLO_SET, SCM_CCLO_SUBR, SCM_SET_CCLO_SUBR, scm_makcclo,
  scm_make_cclo): Remove.

* libguile/stacks.c (read_frames): Remove reference to `scm_f_gsubr_apply'.

* libguile/tags.h (scm_tc7_cclo): Remove.
  (scm_tc7_gsubr): New.
  (scm_tcs_subrs): Add `scm_tc7_gsubr'.

15 years agoChange `scm_gsubr_apply ()' to take the gsubr as its first argument.
Ludovic Courtès [Mon, 16 Feb 2009 00:00:49 +0000 (01:00 +0100)]
Change `scm_gsubr_apply ()' to take the gsubr as its first argument.

* libguile/gsubr.c (scm_gsubr_apply): Make SELF the first argument
  instead of the first element of ARGS.

* libguile/gsubr.h: Update.

* libguile/eval.i.c (CEVAL): Update.

15 years agoAdd subr invocation benchmark.
Ludovic Courtès [Sun, 1 Mar 2009 23:18:34 +0000 (00:18 +0100)]
Add subr invocation benchmark.

* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add `subr.bm'.

15 years agomake the ES compiler more readable via use of ->
Andy Wingo [Fri, 27 Feb 2009 15:25:32 +0000 (16:25 +0100)]
make the ES compiler more readable via use of ->

* module/language/ecmascript/compile-ghil.scm: Use -> to make the ES
  compiler more readable. Fix bugs in do, while, and for, whereby we were
  missing ->boolean calls.

15 years agouse -> macro in scheme->ghil compiler
Andy Wingo [Fri, 27 Feb 2009 14:17:01 +0000 (15:17 +0100)]
use -> macro in scheme->ghil compiler

* module/language/scheme/compile-ghil.scm (->): New macro, makes GHIL
  generation a bit more palatable. Use it in all the transformers.

15 years agoslight optimization in transform-record, note in optimize*
Andy Wingo [Fri, 27 Feb 2009 12:37:35 +0000 (13:37 +0100)]
slight optimization in transform-record, note in optimize*

* module/language/ghil/compile-glil.scm (optimize*): Add a note.

* module/system/base/syntax.scm (transform-record): Access the common
  slots once at the beginning. Cuts down on the number of toplevel refs
  needed by the generated code.

15 years agointroduce -> binding inside transform-record body expressions
Andy Wingo [Fri, 27 Feb 2009 12:24:38 +0000 (13:24 +0100)]
introduce -> binding inside transform-record body expressions

* module/system/base/syntax.scm (transform-record): Introduce a ->
  binding inside the body, that produces records of the same type.

* module/language/ghil/compile-glil.scm (optimize*): Remove our ->ghil
  definition, as transform-record introduces a -> binding for us. Nice.

15 years agofirst stabs as s-expression-driven transformation of GHIL
Andy Wingo [Fri, 27 Feb 2009 11:36:58 +0000 (12:36 +0100)]
first stabs as s-expression-driven transformation of GHIL

* module/language/ghil/compile-glil.scm (optimize*): Rewritten optimizer
  -- not yet in use, but it's closer to the code that I'd like to write.

* module/system/base/syntax.scm (transform-record): New crazy macro,
  makes GHIL a little less painful to work with.

15 years agocommon slot accessors are procedures-with-setters
Andy Wingo [Fri, 27 Feb 2009 09:56:15 +0000 (10:56 +0100)]
common slot accessors are procedures-with-setters

* module/system/base/syntax.scm (define-type): Common slot accessors are
  also procedures-with-setters.

15 years agouse common slots mechanism in ghil
Andy Wingo [Fri, 27 Feb 2009 09:53:00 +0000 (10:53 +0100)]
use common slots mechanism in ghil

* module/system/base/syntax.scm (define-type): Fix getter for common
  slot.

* module/language/ghil.scm (<ghil>): Use the common slots mechanism.

15 years agodefine-type has #:common-slots
Andy Wingo [Fri, 27 Feb 2009 09:44:47 +0000 (10:44 +0100)]
define-type has #:common-slots

* module/system/base/syntax.scm (define-type): Accept a #:common-slots
  argument, defining slots that are in all instances of this type.

15 years agofix variable not initialized spurious warnings
Andy Wingo [Tue, 24 Feb 2009 23:21:03 +0000 (00:21 +0100)]
fix variable not initialized spurious warnings

* libguile/vm-i-system.c: Work around some spurious "variable not
  initialized" messages on Etch's gcc.

15 years agodon't crash etch's gcc
Andy Wingo [Tue, 24 Feb 2009 23:16:26 +0000 (00:16 +0100)]
don't crash etch's gcc

* libguile/vm-engine.h: Don't allocate registers in registers if we're on
  Etch's GCC.

15 years agoexport procedure-arguments from ice-9 session
Andy Wingo [Tue, 24 Feb 2009 23:06:58 +0000 (00:06 +0100)]
export procedure-arguments from ice-9 session

* module/system/vm/program.scm (program-arguments): New function, used by
  procedure-arguments.

* module/ice-9/session.scm (procedure-arguments): New exported function,
  returns an alist describing the given procedure.

15 years agoAggregate makefiles for `module/system' and `module/language'.
Ludovic Courtès [Tue, 24 Feb 2009 22:52:57 +0000 (23:52 +0100)]
Aggregate makefiles for `module/system' and `module/language'.

* am/guilec (.scm.go): Create the target's directory, in case
  $(builddir) != $(srcdir).

* configure.in: Don't output any makefile under `module/system' or
  `module/language'.

* module/Makefile.am (SUBDIRS): Remove `language' and `system'.  Add `.'
  to the front.
  (modpath, SOURCES, SCHEME_LANG_SOURCES, ECMASCRIPT_LANG_SOURCES,
  GHIL_LANG_SOURCES, GLIL_LANG_SOURCES, ASSEMBLY_LANG_SOURCES,
  BYTECODE_LANG_SOURCES, OBJCODE_LANG_SOURCES, VALUE_LANG_SOURCES): New
  variables, taken from former `Makefile.am' files in sub-directories.

15 years agounbork the repl
Andy Wingo [Tue, 24 Feb 2009 22:34:26 +0000 (23:34 +0100)]
unbork the repl

* module/system/repl/repl.scm (meta-reader): Whoops, unbork the repl.