mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-18 23:32:17 -08:00
cmp: add a comment that explains the purpose of OPTIMIZE-CXX-DATA
This commit is contained in:
parent
1b8d1041dd
commit
edfaec9a6b
1 changed files with 16 additions and 0 deletions
|
|
@ -345,6 +345,22 @@
|
|||
(and errorp
|
||||
(cmperr "Unable to find object ~s." object))))
|
||||
|
||||
;;; The vector *REFERENCED-OBJECTS* contains all referenced objects collected in
|
||||
;;; the first pass. The function OPTIMIZE-CXX-DATA is responsible for inlining
|
||||
;;; them when possible, and putting them in a temporary/permanent data segments
|
||||
;;; otherwise. Objects in data segment require an explicit initialization when
|
||||
;;; the the module is loaded. The following inline strategies are tried:
|
||||
;;;
|
||||
;;; - using a symbol from the core :: ECL_SYM(\"*BREAK-ON-SIGNALS*\",27)
|
||||
;;; - using a cvalue inline value :: cl_core.single_float_zero, FLT_MAX
|
||||
;;; - using a static constructor :: ecl_def_ct_single_float -> _ecl_static_7
|
||||
;;; - coercing an immediate value :: ecl_make_fixnum(42)
|
||||
;;;
|
||||
;;; Otherwise the object is put in VV or VVtemp vector, and is created when the
|
||||
;;; module is loaded. Then the code refers to such objects as VV[13].
|
||||
;;;
|
||||
;;; TODO we could further optimize immediate values by duplicating some entries
|
||||
;;; depending on the expected rep-type, to avoid unnecessary coercions.
|
||||
(defun optimize-cxx-data (objects)
|
||||
(flet ((optimize-vv (object)
|
||||
(let ((value (vv-value object)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue