X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftype-class.lisp;h=d493d41f62776d3d2c9bef4271778114efde8352;hb=22c1de0a40df83bb5628974010a879cb2c17ff53;hp=be23b945cd24412f48e40b8cbb58e370a3c532fa;hpb=148e3820ad314a9b59d0133c1d60eaac4af9118b;p=sbcl.git diff --git a/src/code/type-class.lisp b/src/code/type-class.lisp index be23b94..d493d41 100644 --- a/src/code/type-class.lisp +++ b/src/code/type-class.lisp @@ -122,8 +122,8 @@ (:complex-= . type-class-complex-=) (:unparse . type-class-unparse)))) -(eval-when (:compile-toplevel :load-toplevel :execute) - +(declaim (ftype (function (type-class) type-class) copy-type-class-coldly)) +(eval-when (#-sb-xc :compile-toplevel :load-toplevel :execute) ;;; Copy TYPE-CLASS object X, using only operations which will work ;;; early in cold load. (COPY-STRUCTURE won't work early in cold load, ;;; because it needs RAW-INDEX and RAW-LENGTH information from @@ -147,7 +147,6 @@ ;;; the positive effect of removing indirection could be cancelled by ;;; the negative effect of imposing an unnecessary GC write barrier on ;;; raw data which doesn't actually affect GC.) -(declaim (ftype (function (type-class) type-class) copy-type-class-coldly)) (defun copy-type-class-coldly (x) ;; KLUDGE: If the slots of TYPE-CLASS ever change in a way not ;; reflected in *TYPE-CLASS-FUN-SLOTS*, the slots here will @@ -280,11 +279,21 @@ ;;; when no next method exists. -- WHN 2002-04-07 ;;; ;;; (We miss CLOS! -- CSR and WHN) -(defun invoke-complex-subtypep-arg1-method (type1 type2) +(defun invoke-complex-subtypep-arg1-method (type1 type2 &optional subtypep win) (let* ((type-class (type-class-info type1)) (method-fun (type-class-complex-subtypep-arg1 type-class))) (if method-fun (funcall (the function method-fun) type1 type2) - (values nil nil)))) + (values subtypep win)))) + +;;; KLUDGE: This function is dangerous, as its overuse could easily +;;; cause stack exhaustion through unbounded recursion. We only use +;;; it in one place; maybe it ought not to be a function at all? +(defun invoke-complex-=-other-method (type1 type2) + (let* ((type-class (type-class-info type1)) + (method-fun (type-class-complex-= type-class))) + (if method-fun + (funcall (the function method-fun) type2 type1) + (values nil t)))) (!defun-from-collected-cold-init-forms !type-class-cold-init)