3.7 CLOS optimizations

3.7.2 Optimization of SLOT-VALUE

Calls to slot-value within adefmethod form will generally be optimized at compile time, either by open-coded access or by direct dispatch to an effective method function (arising from, for example, the user's methods onslot-value-using-class). In general, this will apply only to objects of metaclassstandard-class (or at least only to objects whose metaclass is a subclass ofstandard-class). The constraints under which the compiler will emit the optimized code are:

The open-coded access is supported by run-time "permutation-vector" caches, which may occasionally have to be rebuilt when the class and/or method topology changes. However, the optimized code does not have to be recompiled.

Note that sincewith-slots is purely a syntactic macro that expands into calls toslot-value, the optimization for it reverts to just the optimizations mentioned forslot-value.


The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker