cmp: cosmetic changes, elaborate in a comment

This commit is contained in:
Daniel Kochmański 2023-11-28 09:11:41 +01:00
parent b4da521398
commit 397dc995d4
2 changed files with 9 additions and 8 deletions

View file

@ -36,6 +36,9 @@
;;; FUN the function to be called
;;; ARGS is the list of arguments
;;; FUN-VAL depends on the particular call type
;;; :LOCAL structure FUN [see cmprefs.lsp]
;;; :GLOBAL function name [symbol or (SETF symbol)]
;;; :UNKNOWN the value NIL
;;; CALL-TYPE is (member :LOCAL :GLOBAL :UKNOWN)
;;;
(defun c2fcall (c1form fun args fun-val call-type)

View file

@ -238,14 +238,12 @@
:args (c1expr `(function ,fname)) (c1args* args) fun :local))
(defun c1call-global (fname args)
(let* ((forms (c1args* args)))
;; If all arguments are constants, try to precompute the function
;; value. We abort when the function signals an error or the value
;; is not printable.
(let ((value (c1call-constant-fold fname forms)))
(when value
(return-from c1call-global value)))
;; Otherwise emit a global function call
(let ((forms (c1args* args)))
;; If all arguments are constants, try to precompute the function value. We
;; abort when the function signals an error or the value is not printable.
(ext:when-let ((value (c1call-constant-fold fname forms)))
(return-from c1call-global value))
;; Otherwise emit a global function call.
(make-c1form* 'FCALL
:sp-change (function-may-change-sp fname)
:side-effects (function-may-have-side-effects fname)