Allow the user to impose that all slot accesses go through SLOT-VALUE, etc.

This commit is contained in:
jjgarcia 2006-03-20 09:04:10 +00:00
parent 4083b63b08
commit 8bbebf02e8
3 changed files with 8 additions and 1 deletions

View file

@ -88,6 +88,11 @@ ECL 0.9i
COMPUTE-SLOTS assign a location to each slot definition that has allocation
:INSTANCE or :CLASS.
- A new defclass option, :optimize-slot-access, which defaults to T, controls
whether the slots accessors should address directly the values in the class
or use SLOT-VALUE. It should be set to NIL when one intends to redefine the
SLOT-*-USING-CLASS methods.
* Errors fixed:
- The intermediate output of the compiler is written in the directory in which

View file

@ -74,6 +74,7 @@
(defparameter +standard-class-slots+
(append +class-slots+
'((slot-table :accessor slot-table)
(optimize-slot-access :initarg :optimize-slot-access :initform t)
(forward)))))
#.(create-accessors +standard-class-slots+ 'standard-class)

View file

@ -397,7 +397,8 @@ because it contains a reference to the undefined class~% ~A"
reader setter)
(declare (fixnum index))
(if (and (eql (slot-definition-allocation slotd) :instance)
(si:fixnump index))
(si:fixnump index)
(slot-value standard-class 'optimize-slot-access))
(setf reader #'(lambda (self)
(let ((value (si:instance-ref self index)))
(if (si:sl-boundp value)