X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/1622ed8e30b05ba9025520cde3e68d186c8c7e50..7b7947024fedb0bb7a0ea3ccb0029f6060de901b:/src/method-impl.lisp diff --git a/src/method-impl.lisp b/src/method-impl.lisp index 1256376..4bf3214 100644 --- a/src/method-impl.lisp +++ b/src/method-impl.lisp @@ -244,21 +244,28 @@ (define-on-demand-slot delegating-direct-method function-type (method) ;;;-------------------------------------------------------------------------- ;;; Effective method classes. +(defmethod method-keyword-argument-lists + ((method effective-method) direct-methods) + (with-slots (message) method + (and (keyword-message-p message) + (mapcar (lambda (m) + (let ((type (sod-method-type m))) + (cons (c-function-keywords type) + (format nil "method for ~A on ~A (at ~A)" + message + (sod-method-class m) + (file-location m))))) + direct-methods)))) + (defmethod shared-initialize :after ((method effective-method) slot-names &key direct-methods) (declare (ignore slot-names)) ;; Set the keyword argument list. (with-slots (message keywords) method - (setf keywords (and (keyword-message-p message) - (merge-keyword-lists - (mapcar (lambda (m) - (let ((type (sod-method-type m))) - (cons (c-function-keywords type) - (format nil "method for ~A on ~A" - message - (sod-method-class m))))) - direct-methods)))))) + (setf keywords + (merge-keyword-lists (method-keyword-argument-lists + method direct-methods))))) (export '(basic-effective-method effective-method-around-methods effective-method-before-methods @@ -654,7 +661,8 @@ (defmethod compute-method-entry-functions ((method basic-effective-method)) (codegen-push codegen) (ensure-var codegen "sod__obj" ilayout-type (make-convert-to-ilayout-inst class - head "me")))) + head "me")) + (deliver-call codegen :void "SOD__IGNORE" "sod__obj"))) (finish-entry (tail) (let* ((head (sod-class-chain-head tail)) (role (if parm-n :valist nil)) @@ -785,14 +793,24 @@ (defmethod compute-effective-method-body :around (*keyword-struct-disposition* :local)) (ensure-var codegen *sod-keywords* (c-type (struct tag))) (make-keyword-parser-function codegen method tag set keywords) + (emit-insts codegen + (mapcar (lambda (keyword) + (make-set-inst + (format nil "~A.~A__suppliedp" + *sod-keywords* + (argument-name keyword)) + 0)) + keywords)) (parse-keywords (lambda () (call :void name kw-addr ap-addr *null-pointer* 0))) (call-next-method))))))) -(defmethod compute-method-entry-functions - ((method simple-effective-method)) - (if (effective-method-primary-methods method) +(defmethod effective-method-live-p ((method simple-effective-method)) + (effective-method-primary-methods method)) + +(defmethod compute-method-entry-functions :around ((method effective-method)) + (if (effective-method-live-p method) (call-next-method) nil))