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

15 commits

Author SHA1 Message Date
Andy Wingo
ce471ab8b0 rename SCM_SNAME to SCM_SUBR_NAME
* libguile/procs.h: Rename SCM_SNAME to SCM_SUBR_NAME.

* libguile/debug.c:
* libguile/eval.c:
* libguile/eval.i.c:
* libguile/goops.c:
* libguile/gsubr.c:
* libguile/print.c:
* libguile/procs.c: Update callers.
2009-06-19 11:20:34 +02:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Andy Wingo
bb06fceef0 Merge commit 'cb9d473112' into vm-check 2009-03-17 16:41:01 +01:00
Andy Wingo
3b91e017e3 Merge commit 'e20d7001c3' into vm-check
Conflicts:

	libguile/stacks.c
2009-03-17 16:40:52 +01:00
Ludovic Courtès
8321ed20f6 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.
2009-03-08 16:40:49 +01:00
Ludovic Courtès
d18f4d805e 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 (...))'.
2009-03-08 16:40:49 +01:00
Ludovic Courtès
a5f83fd21d 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.
2009-03-02 00:20:44 +01:00
Ludovic Courtès
e20d7001c3 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'.
2009-03-02 00:20:43 +01:00
Ludovic Courtès
54d14084e2 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.
2009-03-02 00:20:43 +01:00
Andy Wingo
05b37c17ff fix up some assumptions that cmethods were lists
* libguile/eval.i.c (type_dispatch, apply_vm_cmethod)
  (apply_memoized_cmethod): Tweak the nastiness a bit more so as to deal
  with the '(no-method) empty entries. I would like to stop the search if
  the cdr isn't a pair, but currently with the inlined memoized bits, the
  cdr is a pair. The fix would be to make the memoizer return a procedure
  and not the already-inlined bits -- slightly slower but the vm will be
  faster anyway.

* libguile/objects.c (scm_mcache_lookup_cmethod): Same fixes here.

* oop/goops/dispatch.scm (cache-hashval, cache-try-hash!): Allow non-list
  cmethod tails.
2008-10-30 15:50:48 +01:00
Andy Wingo
5487977b1b runtime byte compilation of goops methods, whooooo
* ice-9/boot-9.scm (make-modules-in): Change to make sure that we are
  making modules in modules; that is, that a global binding of `compile'
  doesn't prevent a module from importing a submodule named `compile'.
  (resolve-module): Clean up a bit, and serialize the logic.

* libguile/objects.c (scm_mcache_lookup_cmethod, scm_apply_generic):
* libguile/eval.i.c (CEVAL): Now that cmethod entries can have a program
  as their tail instead of a memoized proc, we have to change the halting
  condition on the method cache search, in both places: the one that's
  inlined into eval.i.c and the one in objects.c. If the cmethod isn't a
  pair, apply it.

* libguile/goops.c (make): In the `make' procedure that's used before
  GOOPS is booted, bind #:formals, #:body, and #:compile-env on methods.

* oop/goops/compile.scm (compute-entry-with-cmethod): There was a
  terrible trick here that involved putting a dummy pair in the cache,
  then modifying it in place with the result of memoization. The note
  claimed that this was to cut recursion short, or something. I can't see
  how it could recurse, given that `methods' is changing each time. Also,
  the pair trick doesn't work with byte-compiled methods. So, remove it.
  (compile-method): Dispatch to the appropriate method compiler, based on
  whether the method was defined with the interpreter or with the
  compiler.
  (make-next-method): New function, generically computes a `next-method'
  procedure, though the caller has to supply the arguments.
  (compile-method/vm): Exciting method byte compiler!
  (make-make-next-method/memoizer, compile-method/memoizer): Add the
  /memoizer suffix, and move all this code to the bottom of the file.
2008-10-30 13:42:40 +01:00
Andy Wingo
7c455996e8 export `make-promise' to scheme
* libguile/eval.h:
* libguile/eval.c (scm_make_promise): Rename from `scm_makprom', and
  export as the scheme procedure, `make-promise'.

* libguile/eval.i.c (CEVAL): s/makprom/make_promise/.
2008-09-25 16:16:35 +02:00
Ludovic Courtès
9cc37597af Changes from arch/CVS synchronization 2007-12-08 16:00:56 +00:00
Han-Wen Nienhuys
243ebb6113 * private-options.h: idem.
* eval.i.c: copyright nitpicking.

* eval.c: distangle. move duplicate code to eval.i.c and include
twice.

* eval.i.c: new file.

* backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
read.h, stacks.c, symbols.c, throw.c: use private-options.h

* private-options.h: new file: contain hardcoded option
definitions.
2007-01-22 15:20:35 +00:00
Han-Wen Nienhuys
0ee05b85ee * eval.c: distangle. move duplicate code to eval.i.c and include
twice.

* eval.i.c: new file.

* backtrace.c, debug.c, debug.h, deprecation.c, eq.c, eval.c
eval.h, gsubr.c, init.c, macros.c, print.c, print.h, read.c,
read.h, stacks.c, symbols.c, throw.c: use private-options.h
2007-01-22 15:16:44 +00:00