mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-07 09:50:25 -08:00
Extend the location type LCL to include a representation type
This commit is contained in:
parent
21482f1c44
commit
16644c4382
2 changed files with 15 additions and 8 deletions
|
|
@ -55,12 +55,17 @@
|
|||
(t (error "Unknown representation type ~S" rep-type)))))
|
||||
|
||||
(defun lisp-type->rep-type (type)
|
||||
(if (getf +representation-types+ type)
|
||||
type
|
||||
(do ((l +representation-types+ (cddr l)))
|
||||
((endp l) :object)
|
||||
(when (subtypep type (first (second l)))
|
||||
(return-from lisp-type->rep-type (first l))))))
|
||||
(cond
|
||||
;; We expect type = NIL when we have no information. Should be fixed. FIXME!
|
||||
((null type)
|
||||
:object)
|
||||
((getf +representation-types+ type)
|
||||
type)
|
||||
(t
|
||||
(do ((l +representation-types+ (cddr l)))
|
||||
((endp l) :object)
|
||||
(when (subtypep type (first (second l)))
|
||||
(return-from lisp-type->rep-type (first l)))))))
|
||||
|
||||
(defun rep-type-name (type)
|
||||
(or (second (getf +representation-types+ type))
|
||||
|
|
@ -100,6 +105,7 @@
|
|||
(C-INLINE (let ((type (first (second loc))))
|
||||
(if (lisp-type-p type) type (rep-type->lisp-type type))))
|
||||
(BIND (var-type (second loc)))
|
||||
(LCL (or (third loc) T))
|
||||
(otherwise T)))))
|
||||
|
||||
(defun loc-representation-type (loc)
|
||||
|
|
@ -116,6 +122,7 @@
|
|||
(C-INLINE (let ((type (first (second loc))))
|
||||
(if (lisp-type-p type) (lisp-type->rep-type type) type)))
|
||||
(BIND (var-rep-type (second loc)))
|
||||
(LCL (lisp-type->rep-type (or (third loc) T)))
|
||||
(otherwise :object)))))
|
||||
|
||||
(defun wt-coerce-loc (dest-rep-type loc)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
;;; ( VALUE i ) VALUES(i)
|
||||
;;; ( VV vv-index )
|
||||
;;; ( VV-temp vv-index )
|
||||
;;; ( LCL lcl ) local variable, type unboxed
|
||||
;;; ( LCL lcl [representation-type]) local variable, type unboxed
|
||||
;;; ( TEMP temp ) local variable, type object
|
||||
;;; ( CALL c-fun-name args fname ) locs are locations containing the arguments
|
||||
;;; ( CALL-NORMAL fun locs) similar as CALL, but number of arguments is fixed
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
(wt "VVtemp[" vv "]")
|
||||
(wt vv)))
|
||||
|
||||
(defun wt-lcl-loc (lcl)
|
||||
(defun wt-lcl-loc (lcl &optional type)
|
||||
(wt-lcl lcl))
|
||||
|
||||
(defun wt-temp (temp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue