Fast generic function dispatch without calling `compile' at runtime
authorAndy Wingo <wingo@pobox.com>
Wed, 21 Jan 2015 14:16:56 +0000 (15:16 +0100)
committerAndy Wingo <wingo@pobox.com>
Fri, 23 Jan 2015 15:16:04 +0000 (16:16 +0100)
commit0d96acac33b867f45203e0a0c7b6e87a3a09cdad
treecbe985ff707b6cb2111bf39e3b496a5c86a32979
parent3f4829e082c2fdd0553a6ce97fe173f8df327e7b
Fast generic function dispatch without calling `compile' at runtime

* module/oop/goops.scm: Rewrite generic function dispatch to use chained
  closures instead of compiling specific dispatch procedures.  The big
  speed win before was not allocating rest arguments, which we gain by
  simply pre-generating dispatchers for arities of up to 20 arguments.
  Also now a tail call without reshuffling arguments -- which is what
  dispatch now is -- is just a (mov 0 new-procedure) and (tail-call),
  which is pretty cheap.

  (%invalidate-method-cache!): Use the new
  recompute-generic-function-dispatch-procedure!.
  (arity-case, multiple-arity-dispatcher, single-arity-dispatcher)
  (single-arity-cache-dispatch)
  (compute-generic-function-dispatch-procedure)
  (recompute-generic-function-dispatch-procedure!): New internal
  interfaces.
  (memoize-effective-method!): Update for new interfaces.
  (memoize-generic-function-application!): Rename from `memoize-method!'.
module/oop/goops.scm