runtime byte compilation of goops methods, whooooo
authorAndy Wingo <wingo@pobox.com>
Thu, 30 Oct 2008 12:42:40 +0000 (13:42 +0100)
committerAndy Wingo <wingo@pobox.com>
Thu, 30 Oct 2008 12:42:40 +0000 (13:42 +0100)
commit5487977b1bf4a120cc3604f649cc51ea39b533d9
tree818b6f8f4cf50fd5e4e340eac003a9b37fa49041
parent3de80ed52f7482faee2ce883d3df21eb8a38ee7a
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.
ice-9/boot-9.scm
libguile/eval.i.c
libguile/goops.c
libguile/objects.c
oop/goops/compile.scm