- (compute-effective-method-body method codegen emf-target)
- (multiple-value-bind (vars insts) (codegen-pop codegen)
- (cond ((or (= n-entries 1)
- (<= (* n-entries (reduce #'+ insts :key #'inst-metric))
- *method-entry-inline-threshold*))
-
- ;; The effective method body is simple -- or there's only one
- ;; of them. We'll inline the method body into the entry
- ;; functions.
- (dolist (tail chain-tails)
- (setup-entry tail)
- (dolist (var vars)
- (ensure-var codegen (inst-name var)
- (inst-type var) (inst-init var)))
- (when parm-n (varargs-prologue))
- (emit-insts codegen insts)
- (when parm-n (varargs-epilogue))
- (deliver-expr codegen entry-target result)
- (finish-entry tail)))
-
- (t
-
- ;; The effective method body is complicated and we'd need more
- ;; than one copy. We'll generate an effective method function
- ;; and call it a lot.
- (codegen-build-function codegen emf-name emf-type vars
- (nconc insts (and result (list (make-return-inst result)))))
-
- (let ((call (make-call-inst emf-name
- (cons "sod__obj" (mapcar #'argument-name
- emf-arg-tail)))))
+ (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)
+ (multiple-value-bind (vars insts) (codegen-pop codegen)
+ (cond ((or (= n-entries 1)
+ (<= (* n-entries (reduce #'+ insts :key #'inst-metric))
+ *method-entry-inline-threshold*))
+
+ ;; The effective method body is simple -- or there's only
+ ;; one of them. We'll inline the method body into the entry
+ ;; functions.