Skip to content

Commit 3bfbc44

Browse files
committed
Add PROGV instruction
1 parent 42114b1 commit 3bfbc44

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

BIR-builder/builder.lisp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,5 @@
160160
(setf (bir:dynamic-environment (first (bir:next inst))) inst))
161161
(defmethod post ((inst bir:unwind-protect))
162162
(setf (bir:dynamic-environment (first (bir:next inst))) inst))
163+
(defmethod post ((inst bir:progvi))
164+
(setf (bir:dynamic-environment (first (bir:next inst))) inst))

BIR/instructions.lisp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ See LETI"))
198198
()
199199
(:documentation "Terminator and dynamic environment representing the binding of a dynamic variable. Within this dynamic environment, the symbol has this value (unless there is a more recent binding, of course). The first input is the VARIABLE-CELL being bound, and the second input its new value. No outputs."))
200200

201+
(defclass progvi (dynamic-environment no-output terminator1)
202+
()
203+
(:documentation "Terminator and dynamic environment representing the binding of several dynamic variables determined at runtime, as by CL:PROGV. Within this dynamic environment, the symbols have the values or lack thereof (unless there is a more recent binding, of course.) The first input is the list of symbols, and the second input is the list of values. No outputs."))
204+
201205
(defclass unwind (terminator0)
202206
((%come-from :initarg :come-from :reader come-from
203207
:type come-from)

BIR/packages.lisp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
#:abstract-call #:callee #:call #:local-call
5353
#:abstract-local-call #:mv-call #:mv-local-call
5454
#:attributes
55-
#:leti #:dynamic-leti #:constant-bind #:enclose #:code
55+
#:leti #:dynamic-leti #:constant-bind #:progvi #:enclose #:code
5656
#:thei #:asserted-type #:type-check-function #:delete-thei)
5757
(:export #:primop #:info)
5858
(:export #:do-functions #:map-functions)

BIR/verify.lisp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ If there are problems, a VERIFICATION-FAILED is signaled. If the verification pr
242242
(let* ((inputs (inputs instruction))
243243
(constant (first inputs))
244244
(val (second inputs)))
245+
(test (= (length inputs) 2)
246+
"has more or less than two inputs ~a" instruction inputs)
245247
(test (typep constant 'variable-cell)
246248
"has non-variable-cell input ~a"
247249
instruction constant)
@@ -254,6 +256,13 @@ If there are problems, a VERIFICATION-FAILED is signaled. If the verification pr
254256
(check-ubd instruction (list val))
255257
(check-usedness instruction (list val))))
256258

259+
(defmethod verify-inputs ((instruction progvi))
260+
(let ((inputs (inputs instruction)))
261+
(test (= (length inputs) 2)
262+
"has more or less than two inputs ~a" instruction inputs)
263+
(check-ubd instruction inputs)
264+
(check-usedness instruction inputs)))
265+
257266
(defmethod verify-inputs ((instruction load-time-value-reference))
258267
(let* ((inputs (inputs instruction))
259268
(ltv (first inputs)))

0 commit comments

Comments
 (0)