Fix accessor struct inlining in GOOPS
authorAndy Wingo <wingo@pobox.com>
Sat, 24 Jan 2015 17:59:15 +0000 (18:59 +0100)
committerAndy Wingo <wingo@pobox.com>
Sat, 24 Jan 2015 17:59:15 +0000 (18:59 +0100)
commite7097386cb28f04cfeedc11415b06623ee2ac70c
tree12de59b8f72b935d06e9537db9359665774c0368
parent4bde3f04ea2c573a871b5f377b5f41d970dc8ebe
Fix accessor struct inlining in GOOPS

Fixes bug #17355.

* module/oop/goops.scm (memoize-effective-method!): Adapt to
  compute-effective-method change.
  (compute-effective-method, %compute-effective-method): Renamed from
  compute-cmethod; now a generic protocol.
  (compute-specialized-effective-method)
  (%compute-specialized-effective-method): New sub-protocol.
  (memoize-generic-function-application!): Adapt to call the hard-wired
  compute-applicable-methods based on the concrete arguments types --
  the semantics is that %compute-applicable-methods is the
  implementation for <generic> functions.  Perhaps we should do the same
  for sort-applicable-methods and method-more-specific?.
  (compute-getter-method, compute-setter-method): The standard
  #:procedure is now a generic slot-ref.  It wasn't valid to inline
  field access here, because subtypes could have different field
  layouts.
  (compute-applicable-methods): Refactor generic definition to use
  lexical scoping.
  (compute-specialized-effective-method): New method for
  <accessor-method>, which does field access inlining based on the
  concrete types being applied.

* test-suite/tests/goops.test ("accessor slots"): New test.
module/oop/goops.scm
test-suite/tests/goops.test