mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2025-12-06 02:40:26 -08:00
cmpc: remove the safety-level qualifier :SAFE from the inliner
This inlining qualifier was commented to be applied only in the safe code, but in the code it was applied all the same as :always (as a second choice after the unsafe optimizer). Moreover there was only single sysfun that specified it.
This commit is contained in:
parent
e32b5d5e1f
commit
2d0ffd53b2
3 changed files with 13 additions and 17 deletions
|
|
@ -23,9 +23,9 @@
|
|||
;;; Here, ARG-TYPE is the list of argument types belonging to the lisp family,
|
||||
;;; while RETURN-REP-TYPE is a representation type, i.e. the C type of the
|
||||
;;; output expression. EXPANSION-STRING is a C/C++ expression template, like the
|
||||
;;; ones used by C-INLINE. Finally, KIND can be :ALWAYS, :SAFE or :UNSAFE,
|
||||
;;; depending on whether the inline expression should be applied always, in safe
|
||||
;;; or in unsafe compilation mode, respectively.
|
||||
;;; ones used by C-INLINE. Finally, KIND can be :ALWAYS or :UNSAFE, depending on
|
||||
;;; whether the inline expression should be applied always or only in the unsafe
|
||||
;;; compilation mode, respectively.
|
||||
;;;
|
||||
|
||||
(defun inline-information (name safety)
|
||||
|
|
@ -41,9 +41,8 @@
|
|||
(setf safety
|
||||
(case safety
|
||||
(:unsafe :inline-unsafe)
|
||||
(:safe :inline-safe)
|
||||
(:always :inline-always)
|
||||
(t (error "In DEF-INLINE, wrong value of SAFETY"))))
|
||||
(t (error "In DEF-INLINE, ~s is a wrong value of SAFETY." safety))))
|
||||
;; Ensure we can inline this form. We only inline when the features are
|
||||
;; there (checked above) and when the C types are part of this machine
|
||||
;; (checked here).
|
||||
|
|
@ -333,7 +332,7 @@
|
|||
|
||||
(def-inline cl:cons :always (t t) t "CONS(#0,#1)")
|
||||
|
||||
(def-inline cl:endp :safe (t) :bool "ecl_endp(#0)")
|
||||
(def-inline cl:endp :always (t) :bool "ecl_endp(#0)")
|
||||
(def-inline cl:endp :unsafe (t) :bool "#0==ECL_NIL")
|
||||
|
||||
(def-inline cl:nth :always (t t) t "ecl_nth(ecl_to_size(#0),#1)")
|
||||
|
|
|
|||
|
|
@ -96,10 +96,6 @@
|
|||
(let ((other (inline-type-matches x types return-type)))
|
||||
(when other
|
||||
(setf output (choose-inline-info output other return-type return-rep-type))))))
|
||||
(dolist (x (inline-information fname ':INLINE-SAFE))
|
||||
(let ((other (inline-type-matches x types return-type)))
|
||||
(when other
|
||||
(setf output (choose-inline-info output other return-type return-rep-type)))))
|
||||
(dolist (x (inline-information fname ':INLINE-ALWAYS))
|
||||
(let ((other (inline-type-matches x types return-type)))
|
||||
(when other
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
;;; Valid property names for open coded functions are:
|
||||
;;; :INLINE-ALWAYS
|
||||
;;; :INLINE-SAFE safe-compile only
|
||||
;;; :INLINE-UNSAFE non-safe-compile only
|
||||
;;;
|
||||
;;; Each property is a list of 'inline-info's, where each inline-info is:
|
||||
|
|
@ -22,12 +21,14 @@
|
|||
;;;
|
||||
;;; For each open-codable function, open coding will occur only if there exits
|
||||
;;; an appropriate property with the argument types equal to 'types' and with
|
||||
;;; the return-type equal to 'type'. The third element
|
||||
;;; is T if and only if side effects may occur by the call of the function.
|
||||
;;; Even if *DESTINATION* is TRASH, open code for such a function with side
|
||||
;;; effects must be included in the compiled code.
|
||||
;;; The forth element is T if and only if the result value is a new Lisp
|
||||
;;; object, i.e., it must be explicitly protected against GBC.
|
||||
;;; the return-type equal to 'type'.
|
||||
;;;
|
||||
;;; The third element is T if and only if side effects may occur by the call of
|
||||
;;; the function. Even if *DESTINATION* is TRASH, open code for such a function
|
||||
;;; with side effects must be included in the compiled code.
|
||||
;;;
|
||||
;;; The forth element is T if and only if the result value is a new Lisp object,
|
||||
;;; i.e., it must be explicitly protected against GBC.
|
||||
|
||||
(defun make-inline-temp-var (value-type &optional rep-type)
|
||||
(let ((out-rep-type (or rep-type (lisp-type->rep-type value-type))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue