~mdw
/
sod
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/method-impl.lisp: Argument name list should only contain names.
[sod]
/
src
/
method-impl.lisp
diff --git
a/src/method-impl.lisp
b/src/method-impl.lisp
index
09dbb2b
..
86fd4cd
100644
(file)
--- a/
src/method-impl.lisp
+++ b/
src/method-impl.lisp
@@
-98,6
+98,9
@@
(call-next-method)
(primary-method-class message)))
(call-next-method)
(primary-method-class message)))
+(defmethod primary-method-class ((message simple-message))
+ 'basic-direct-method)
+
;;;--------------------------------------------------------------------------
;;; Direct method classes.
;;;--------------------------------------------------------------------------
;;; Direct method classes.
@@
-189,12
+192,17
@@
(slot-name (eql 'next-method-type)))
(declare (ignore class))
(let* ((message (sod-method-message method))
(slot-name (eql 'next-method-type)))
(declare (ignore class))
(let* ((message (sod-method-message method))
- (type (sod-message-type message)))
+ (return-type (c-type-subtype (sod-message-type message)))
+ (msgargs (sod-message-argument-tail message))
+ (arguments (if (varargs-message-p message)
+ (cons (make-argument *sod-master-ap*
+ (c-type va-list))
+ (butlast msgargs))
+ msgargs)))
(setf (slot-value method 'next-method-type)
(setf (slot-value method 'next-method-type)
- (c-type (fun (lisp
(c-type-subtype type)
)
+ (c-type (fun (lisp
return-type
)
("me" (* (class (sod-method-class method))))
("me" (* (class (sod-method-class method))))
- .
- (c-function-arguments type))))))
+ . arguments)))))
(defmethod slot-unbound (class
(method delegating-direct-method)
(defmethod slot-unbound (class
(method delegating-direct-method)
@@
-320,19
+328,18
@@
method
(let* ((message-type (sod-message-type message))
(return-type (c-type-subtype message-type))
method
(let* ((message-type (sod-message-type message))
(return-type (c-type-subtype message-type))
- (voidp (eq return-type (c-type void)))
(basic-tail (effective-method-basic-argument-names method)))
(flet ((method-kernel (target)
(dolist (before before-methods)
(invoke-method codegen :void basic-tail before))
(basic-tail (effective-method-basic-argument-names method)))
(flet ((method-kernel (target)
(dolist (before before-methods)
(invoke-method codegen :void basic-tail before))
- (if (
or voidp (null after-methods)
)
+ (if (
null after-methods
)
(funcall body target)
(convert-stmts codegen target return-type
(lambda (target)
(funcall body target)
(dolist (after (reverse after-methods))
(invoke-method codegen :void
(funcall body target)
(convert-stmts codegen target return-type
(lambda (target)
(funcall body target)
(dolist (after (reverse after-methods))
(invoke-method codegen :void
-
after basic-tail
)))))))
+
basic-tail after
)))))))
(invoke-delegation-chain codegen target basic-tail
around-methods #'method-kernel)))))
(invoke-delegation-chain codegen target basic-tail
around-methods #'method-kernel)))))
@@
-446,7
+453,8
@@
(varargs-prologue ()
(ensure-var codegen *sod-master-ap* (c-type va-list))
(emit-inst codegen
(varargs-prologue ()
(ensure-var codegen *sod-master-ap* (c-type va-list))
(emit-inst codegen
- (make-va-start-inst *sod-master-ap* parm-n)))
+ (make-va-start-inst *sod-master-ap*
+ (argument-name parm-n))))
(varargs-epilogue ()
(emit-inst codegen (make-va-end-inst *sod-master-ap*)))
(finish-entry (tail)
(varargs-epilogue ()
(emit-inst codegen (make-va-end-inst *sod-master-ap*)))
(finish-entry (tail)
@@
-459,7
+467,7
@@
;; Generate the method body. We'll work out what to do with it later.
(codegen-push codegen)
;; Generate the method body. We'll work out what to do with it later.
(codegen-push codegen)
- (let* ((result (if (eq return-type
(c-type void)
) nil
+ (let* ((result (if (eq return-type
c-type-void
) nil
(temporary-var codegen return-type)))
(emf-target (or result :void)))
(compute-effective-method-body method codegen emf-target)
(temporary-var codegen return-type)))
(emf-target (or result :void)))
(compute-effective-method-body method codegen emf-target)
@@
-474,8
+482,10
@@
(dolist (tail chain-tails)
(setup-entry tail)
(dolist (var vars)
(dolist (tail chain-tails)
(setup-entry tail)
(dolist (var vars)
- (ensure-var codegen (inst-name var)
- (inst-type var) (inst-init var)))
+ (if (typep var 'var-inst)
+ (ensure-var codegen (inst-name var)
+ (inst-type var) (inst-init var))
+ (emit-decl codegen var)))
(when parm-n (varargs-prologue))
(emit-insts codegen insts)
(when parm-n (varargs-epilogue))
(when parm-n (varargs-prologue))
(emit-insts codegen insts)
(when parm-n (varargs-epilogue))
@@
-517,12
+527,11
@@
(defmethod compute-effective-method-body
((method simple-effective-method) codegen target)
(defmethod compute-effective-method-body
((method simple-effective-method) codegen target)
- (with-slots (message basic-argument-names primary-methods) method
- (basic-effective-method-body codegen target method
- (lambda (target)
- (simple-method-body method
- codegen
- target)))))
+ (basic-effective-method-body codegen target method
+ (lambda (target)
+ (simple-method-body method
+ codegen
+ target))))
;;;--------------------------------------------------------------------------
;;; Standard method combination.
;;;--------------------------------------------------------------------------
;;; Standard method combination.
@@
-531,7
+540,7
@@
(defclass standard-message (simple-message)
()
(:documentation
(defclass standard-message (simple-message)
()
(:documentation
- "Message class for standard method combination.
+ "Message class for standard method combination
s
.
Standard method combination is a simple method combination where the
primary methods are invoked as a delegation chain, from most- to
Standard method combination is a simple method combination where the
primary methods are invoked as a delegation chain, from most- to