Changeset 12035


Ignore:
Timestamp:
May 12, 2009, 5:36:16 PM (10 years ago)
Author:
gb
Message:

FUNCALL, APPLY: do definedness checks, number-of-args checks where
possible in more cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/nx1.lisp

    r11630 r12035  
    11381138    (setq spread-p nil args (butlast args)))
    11391139  (let ((name (nx1-func-name fn))
    1140         (global nil))
     1140        (global nil)
     1141        (result-type t))
     1142    (when name
     1143      (setq global (eq (%car fn) 'quote)
     1144            result-type (nx1-call-result-type name args spread-p global)
     1145            name (nx1-form fn)))
    11411146    (if name
    1142       (if (eq (%car fn) 'quote)
    1143         (setq global t name (nx1-form fn))
     1147      (unless global
    11441148        (let*  ((afunc (nth-value 1 (nx-lexical-finfo name))))
    11451149          (when (and afunc (eq afunc *nx-call-next-method-function*))
     
    11501154                         args (cons (var-name *nx-next-method-var*) args)))))
    11511155      (setq name (nx1-form fn)))
    1152     (nx1-call name args spread-p global)))
     1156    (let* ((form (nx1-call name args spread-p global)))
     1157      (if (eq result-type t)
     1158        form
     1159        (make-acode (%nx1-operator typed-form) result-type form)))))
    11531160
    11541161(defnx1 nx1-%apply-lexpr ((%apply-lexpr)) (&whole call fn arg &rest args &aux (orig args))
     
    14781485                       (setq name (nx-need-function-name name))))))
    14791486      (nx1-form (cons name args))  ; This picks up call-next-method evil.
    1480       (nx1-call (nx1-form func) args nil t))))
     1487      (let* ((result-type t))
     1488        (when (and (quoted-form-p func)
     1489                   (or (typep (setq name (nx-unquote func)) 'symbol)
     1490                       (setq name (valid-function-name-p name))))
     1491          (setq result-type (nx1-call-result-type name args nil t)))
     1492        (let* ((form (nx1-call (nx1-form func) args nil t)))
     1493          (if (eq result-type t)
     1494            form
     1495            (make-acode (%nx1-operator typed-form) result-type form)))))))
    14811496
    14821497(defnx1 nx1-multiple-value-call multiple-value-call (value-form &rest args)
Note: See TracChangeset for help on using the changeset viewer.