[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

iwmc-class-p bug again



For 3600 users only.

    Date: Mon, 11 Apr 88 20:19:08 -0400
    From: kanderso@WILMA.BBN.COM

    I think we patched this once, and someone else did too, and his patch
    got accepted:

    Patch to 3600-low.lisp
    (scl:defsubst iwmc-class-p (x)
      (and (arrayp x)
	   (eq (scl:named-structure-p x) 'iwmc-class)))

In the next release of PCL, this is going to be changed to use flavor's
instances instead of structures as the `header' for PCL instances.  This
changes resulted in a moderate performance improvement for method lookup
on the 3600.  Method lookup in the one argument case is now about 5.5
times the time of a corresponding function call.

People who would like to try this new, higher performance implementation
of instances should replace the defsubst of iwmc-class-p with the
following code.  Then you will need to recompile pcl with
(compile-pcl 'low) to make sure enough stuff gets recompiled.

;from 3600-low.lisp
(scl:defflavor iwmc-class
	((wrapper nil)
	 (static-slots nil)
	 (dynamic-slots ()))
	()
  (:constructor %%allocate-instance--class())
  :ordered-instance-variables)

(defvar *iwmc-class-flavor* (flavor:find-flavor 'iwmc-class))

(scl::defsubst iwmc-class-p (x)
  (and (sys:instancep x)
       (eq (sys:%instance-flavor x) *iwmc-class-flavor*)))

(scl:defmethod (:print-self iwmc-class) (stream depth slashify)
  (declare (ignore depth slashify))
  (print-object scl:self stream nil))

(defmacro %iwmc-class-class-wrapper (iwmc-class)
  `(sys:%instance-ref ,iwmc-class 1))

(defmacro %iwmc-class-static-slots (iwmc-class)
  `(sys:%instance-ref ,iwmc-class 2))

(defmacro %iwmc-class-dynamic-slots (iwmc-class)
  `(sys:%instance-ref ,iwmc-class 3))

(scl:compile-flavor-methods iwmc-class)
-------