/[cmucl]/src/compiler/checkgen.lisp
ViewVC logotype

Contents of /src/compiler/checkgen.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.30 - (show annotations)
Sun Jul 9 13:59:58 2000 UTC (13 years, 9 months ago) by dtc
Branch: MAIN
CVS Tags: release-18e-base, LINKAGE_TABLE, PRE_LINKAGE_TABLE, release-18e-pre2, cold-pcl-base, UNICODE-BASE, release-18e, release-18e-pre1
Branch point for: UNICODE-BRANCH, release-18e-branch, cold-pcl
Changes since 1.29: +8 -2 lines
Enhancement to continuation-check-types: even when the proven type
represents an unknown number of values, if Cont's destination receives
only a single value, generate a :hairy type check for the
single-values-type of the asserted type.
1 ;;; -*- Package: C; Log: C.Log -*-
2 ;;;
3 ;;; **********************************************************************
4 ;;; This code was written as part of the CMU Common Lisp project at
5 ;;; Carnegie Mellon University, and has been placed in the public domain.
6 ;;;
7 (ext:file-comment
8 "$Header: /tiger/var/lib/cvsroots/cmucl/src/compiler/checkgen.lisp,v 1.30 2000/07/09 13:59:58 dtc Exp $")
9 ;;;
10 ;;; **********************************************************************
11 ;;;
12 ;;; This file implements type check generation. This is a phase that runs
13 ;;; at the very end of IR1. If a type check is too complex for the back end to
14 ;;; directly emit in-line, then we transform the check into an explicit
15 ;;; conditional using TYPEP.
16 ;;;
17 ;;; Written by Rob MacLachlan
18 ;;;
19 (in-package "C")
20
21
22 ;;;; Cost estimation:
23
24
25 ;;; Function-Cost -- Internal
26 ;;;
27 ;;; Return some sort of guess about the cost of a call to a function. If
28 ;;; the function has some templates, we return the cost of the cheapest one,
29 ;;; otherwise we return the cost of CALL-NAMED. Calling this with functions
30 ;;; that have transforms can result in relatively meaningless results
31 ;;; (exaggerated costs.)
32 ;;;
33 ;;; We randomly special-case NULL, since it does have a source tranform and is
34 ;;; interesting to us.
35 ;;;
36 (defun function-cost (name)
37 (declare (symbol name))
38 (let ((info (info function info name))
39 (call-cost (template-cost (template-or-lose 'call-named *backend*))))
40 (if info
41 (let ((templates (function-info-templates info)))
42 (if templates
43 (template-cost (first templates))
44 (case name
45 (null (template-cost (template-or-lose 'if-eq *backend*)))
46 (t call-cost))))
47 call-cost)))
48
49
50 ;;; Type-Test-Cost -- Internal
51 ;;;
52 ;;; Return some sort of guess for the cost of doing a test against TYPE.
53 ;;; The result need not be precise as long as it isn't way out in space. The
54 ;;; units are based on the costs specified for various templates in the VM
55 ;;; definition.
56 ;;;
57 (defun type-test-cost (type)
58 (declare (type ctype type))
59 (or (let ((check (type-check-template type)))
60 (if check
61 (template-cost check)
62 (let ((found (cdr (assoc type (backend-type-predicates *backend*)
63 :test #'type=))))
64 (if found
65 (+ (function-cost found) (function-cost 'eq))
66 nil))))
67 (typecase type
68 (union-type
69 (collect ((res 0 +))
70 (dolist (mem (union-type-types type))
71 (res (type-test-cost mem)))
72 (res)))
73 (member-type
74 (* (length (member-type-members type))
75 (function-cost 'eq)))
76 (numeric-type
77 (* (if (numeric-type-complexp type) 2 1)
78 (function-cost
79 (if (csubtypep type (specifier-type 'fixnum)) 'fixnump 'numberp))
80 (+ 1
81 (if (numeric-type-low type) 1 0)
82 (if (numeric-type-high type) 1 0))))
83 (cons-type
84 (+ (type-test-cost (specifier-type 'cons))
85 (function-cost 'car)
86 (type-test-cost (cons-type-car-type type))
87 (function-cost 'cdr)
88 (type-test-cost (cons-type-cdr-type type))))
89 (t
90 (function-cost 'typep)))))
91
92
93 ;;;; Checking strategy determination:
94
95
96 ;;; MAYBE-WEAKEN-CHECK -- Internal
97 ;;;
98 ;;; Return the type we should test for when we really want to check for
99 ;;; Type. If speed, space or compilation speed is more important than safety,
100 ;;; then we return a weaker type if it is easier to check. First we try the
101 ;;; defined type weakenings, then look for any predicate that is cheaper.
102 ;;;
103 ;;; If the supertype is equal in cost to the type, we prefer the supertype.
104 ;;; This produces a closer approximation of the right thing in the presence of
105 ;;; poor cost info.
106 ;;;
107 (defun maybe-weaken-check (type cont)
108 (declare (type ctype type) (type continuation cont))
109 (cond ((policy (continuation-dest cont)
110 (<= speed safety) (<= space safety) (<= cspeed safety))
111 type)
112 (t
113 (let ((min-cost (type-test-cost type))
114 (min-type type)
115 (found-super nil))
116 (dolist (x (backend-type-predicates *backend*))
117 (let ((stype (car x)))
118 (when (and (csubtypep type stype)
119 (not (union-type-p stype))) ;Not #!% COMMON type.
120 (let ((stype-cost (type-test-cost stype)))
121 (when (or (< stype-cost min-cost)
122 (type= stype type))
123 (setq found-super t)
124 (setq min-type stype min-cost stype-cost))))))
125 (if found-super
126 min-type
127 *universal-type*)))))
128
129
130 ;;; NO-FUNCTION-TYPES -- Internal
131 ;;;
132 ;;; Mash any complex function types to FUNCTION.
133 ;;;
134 (defun no-function-types (types)
135 (declare (type list types))
136 (mapcar #'(lambda (type)
137 (if (function-type-p type)
138 (specifier-type 'function)
139 type))
140 types))
141
142
143 ;;; Values-types-asserted -- Internal
144 ;;;
145 ;;; Like values-types, but when an argument is proven to be delivered,
146 ;;; convert asserted optional and rest arguments to required arguments. This
147 ;;; makes it clear that these required arguments may all be type checked.
148 ;;;
149 (defun values-types-asserted (atype ptype)
150 (declare (type ctype atype ptype))
151 (cond ((eq atype *wild-type*)
152 (values nil :unknown))
153 ((not (values-type-p atype))
154 (values (list atype) 1))
155 ((or (args-type-keyp atype)
156 (args-type-allowp atype))
157 (values nil :unknown))
158 (t
159 (let* ((ptype (kernel::coerce-to-values ptype))
160 (preq (args-type-required ptype))
161 (popt (args-type-optional ptype))
162 (prest (args-type-rest ptype)))
163 (collect ((types))
164 (do ((args (args-type-required atype) (rest args)))
165 ((endp args))
166 (if (or (pop preq) (pop popt) prest)
167 (types (single-value-type (first args)))
168 (return-from values-types-asserted (values nil :unknown))))
169 (do ((args (args-type-optional atype) (rest args)))
170 ((endp args))
171 (if (pop preq)
172 (types (single-value-type (first args)))
173 (return-from values-types-asserted (values nil :unknown))))
174 (let ((arest (args-type-rest atype)))
175 (when arest
176 (do ((arg (pop preq) (pop preq)))
177 ((null arg))
178 (types (single-value-type arest)))
179 (when (or popt prest)
180 (return-from values-types-asserted (values nil :unknown)))))
181 (values (types) (length (types))))))))
182
183
184 ;;; Switch to disable check complementing, for evaluation.
185 ;;;
186 (defvar *complement-type-checks* t)
187
188 ;;; MAYBE-NEGATE-CHECK -- Internal
189 ;;;
190 ;;; Cont is a continuation we are doing a type check on and Types is a list
191 ;;; of types that we are checking its values against. If we have proven
192 ;;; that Cont generates a fixed number of values, then for each value, we check
193 ;;; whether it is cheaper to then difference between the proven type and
194 ;;; the corresponding type in Types. If so, we opt for a :HAIRY check with
195 ;;; that test negated. Otherwise, we try to do a simple test, and if that is
196 ;;; impossible, we do a hairy test with non-negated types. If true,
197 ;;; Force-Hairy forces a hairy type check.
198 ;;;
199 ;;; When doing a non-negated check, we call MAYBE-WEAKEN-CHECK to weaken the
200 ;;; test to a convenient supertype (conditional on policy.) If debug-info is
201 ;;; not particularly important (debug <= 1) or speed is 3, then we allow
202 ;;; weakened checks to be simple, resulting in less informative error messages,
203 ;;; but saving space and possibly time.
204 ;;;
205 (defun maybe-negate-check (cont types force-hairy)
206 (declare (type continuation cont) (list types))
207 (multiple-value-bind
208 (ptypes count)
209 (values-types (continuation-proven-type cont))
210 (if (eq count :unknown)
211 (if (and (every #'type-check-template types) (not force-hairy))
212 (values :simple types)
213 (values :hairy
214 (mapcar #'(lambda (x)
215 (list nil (maybe-weaken-check x cont) x))
216 types)))
217 (let ((res (mapcar #'(lambda (p c)
218 (if (csubtypep p c)
219 (list nil *universal-type* c)
220 (let ((diff (type-difference p c))
221 (weak (maybe-weaken-check c cont)))
222 (if (and diff
223 (< (type-test-cost diff)
224 (type-test-cost weak))
225 *complement-type-checks*)
226 (list t diff c)
227 (list nil weak c)))))
228 (no-function-types ptypes) types)))
229 (cond ((or force-hairy (find-if #'first res))
230 (values :hairy res))
231 ((every #'type-check-template types)
232 (values :simple types))
233 ((policy (continuation-dest cont)
234 (or (<= debug 1) (and (= speed 3) (/= debug 3))))
235 (let ((weakened (mapcar #'second res)))
236 (if (every #'type-check-template weakened)
237 (values :simple weakened)
238 (values :hairy res))))
239 (t
240 (values :hairy res)))))))
241
242
243 ;;; CONTINUATION-CHECK-TYPES -- Interface
244 ;;;
245 ;;; Determines whether Cont's assertion is:
246 ;;; -- Checkable by the back end (:SIMPLE), or
247 ;;; -- Not checkable by the back end, but checkable via an explicit test in
248 ;;; type check conversion (:HAIRY), or
249 ;;; -- not reasonably checkable at all (:TOO-HAIRY).
250 ;;;
251 ;;; A type is checkable if it either represents a fixed number of values (as
252 ;;; determined by VALUES-TYPES), or it is the assertion for an MV-Bind. A type
253 ;;; is simply checkable if all the type assertions have a TYPE-CHECK-TEMPLATE.
254 ;;; In this :SIMPLE case, the second value is a list of the type restrictions
255 ;;; specified for the leading positional values.
256 ;;;
257 ;;; We force a check to be hairy even when there are fixed values if we are in
258 ;;; a context where we may be forced to use the unknown values convention
259 ;;; anyway. This is because IR2tran can't generate type checks for unknown
260 ;;; values continuations but people could still be depending on the check being
261 ;;; done. We only care about EXIT and RETURN (not MV-COMBINATION) since these
262 ;;; are the only contexts where the ultimate values receiver
263 ;;;
264 ;;; In the :HAIRY case, the second value is a list of triples of the form:
265 ;;; (Not-P Type Original-Type)
266 ;;;
267 ;;; If true, the Not-P flag indicates a test that the corresponding value is
268 ;;; *not* of the specified Type. Original-Type is the type asserted on this
269 ;;; value in the continuation, for use in error messages. When Not-P is true,
270 ;;; this will be different from Type.
271 ;;;
272 ;;; This allows us to take what has been proven about Cont's type into
273 ;;; consideration. If it is cheaper to test for the difference between the
274 ;;; derived type and the asserted type, then we check for the negation of this
275 ;;; type instead.
276 ;;;
277 ;;; When the proven type represents an unknown number of values, but Cont's
278 ;;; destination receives only a single value, a :hairy type check is
279 ;;; generated for the single-values-type of the asserted type.
280 ;;;
281 (defun continuation-check-types (cont)
282 (declare (type continuation cont))
283 (let ((atype (continuation-asserted-type cont))
284 (dest (continuation-dest cont)))
285 (assert (not (eq atype *wild-type*)))
286 (multiple-value-bind (types count)
287 (values-types-asserted atype (continuation-proven-type cont))
288 (cond ((not (eq count :unknown))
289 (let ((types (no-function-types types)))
290 (if (or (exit-p dest)
291 (and (return-p dest)
292 (multiple-value-bind
293 (ignore count)
294 (values-types (return-result-type dest))
295 (declare (ignore ignore))
296 (eq count :unknown))))
297 (maybe-negate-check cont types t)
298 (maybe-negate-check cont types nil))))
299 ((and (mv-combination-p dest)
300 (eq (basic-combination-kind dest) :local))
301 (assert (values-type-p atype))
302 (assert (null (args-type-required atype)))
303 (maybe-negate-check cont (args-type-optional atype) nil))
304 ((or (exit-p dest) (return-p dest) (mv-combination-p dest))
305 (values :too-hairy nil))
306 (t
307 (maybe-negate-check cont (list (single-value-type atype)) t))))))
308
309
310 ;;; Probable-Type-Check-P -- Internal
311 ;;;
312 ;;; Return true if Cont is a continuation whose type the back end is likely
313 ;;; to want to check. Since we don't know what template the back end is going
314 ;;; to choose to implement the continuation's DEST, we use a heuristic. We
315 ;;; always return T unless:
316 ;;; -- Nobody uses the value, or
317 ;;; -- Safety is totally unimportant, or
318 ;;; -- the continuation is an argument to an unknown function, or
319 ;;; -- the continuation is an argument to a known function that has no
320 ;;; IR2-Convert method or :fast-safe templates that are compatible with the
321 ;;; call's type.
322 ;;;
323 ;;; We must only return nil when it is *certain* that a check will not be done,
324 ;;; since if we pass up this chance to do the check, it will be too late. The
325 ;;; penalty for being too conservative is duplicated type checks.
326 ;;;
327 ;;; If there is a compile-time type error, then we always return true unless
328 ;;; the DEST is a full call. With a full call, the theory is that the type
329 ;;; error is probably from a declaration in (or on) the callee, so the callee
330 ;;; should be able to do the check. We want to let the callee do the check,
331 ;;; because it is possible that the error is really in the callee, not the
332 ;;; caller. We don't want to make people recompile all calls to a function
333 ;;; when they were originally compiled with a bad declaration (or an old type
334 ;;; assertion derived from a definition appearing after the call.)
335 ;;;
336 (defun probable-type-check-p (cont)
337 (declare (type continuation cont))
338 (let ((dest (continuation-dest cont)))
339 (cond ((eq (continuation-type-check cont) :error)
340 (if (and (combination-p dest) (eq (combination-kind dest) :error))
341 nil
342 t))
343 ((or (not dest)
344 (policy dest (zerop safety)))
345 nil)
346 ((basic-combination-p dest)
347 (let ((kind (basic-combination-kind dest)))
348 (cond ((eq cont (basic-combination-fun dest)) t)
349 ((eq kind :local) t)
350 ((member kind '(:full :error)) nil)
351 ((function-info-ir2-convert kind) t)
352 (t
353 (dolist (template (function-info-templates kind) nil)
354 (when (eq (template-policy template) :fast-safe)
355 (multiple-value-bind
356 (val win)
357 (valid-function-use dest (template-type template))
358 (when (or val (not win)) (return t)))))))))
359 (t t))))
360
361
362 ;;; Make-Type-Check-Form -- Internal
363 ;;;
364 ;;; Return a form that we can convert to do a hairy type check of the
365 ;;; specified Types. Types is a list of the format returned by
366 ;;; Continuation-Check-Types in the :HAIRY case. In place of the actual
367 ;;; value(s) we are to check, we use 'Dummy. This constant reference is later
368 ;;; replaced with the actual values continuation.
369 ;;;
370 ;;; Note that we don't attempt to check for required values being unsupplied.
371 ;;; Such checking is impossible to efficiently do at the source level because
372 ;;; our fixed-values conventions are optimized for the common MV-Bind case.
373 ;;;
374 ;;; We can always use Multiple-Value-Bind, since the macro is clever about
375 ;;; binding a single variable.
376 ;;;
377 (defun make-type-check-form (types)
378 (collect ((temps))
379 (dotimes (i (length types))
380 (temps (gensym)))
381
382 `(multiple-value-bind ,(temps)
383 'dummy
384 ,@(mapcar #'(lambda (temp type)
385 (let* ((spec
386 (let ((*unparse-function-type-simplify* t))
387 (type-specifier (second type))))
388 (test (if (first type) `(not ,spec) spec)))
389 `(unless (typep ,temp ',test)
390 (%type-check-error
391 ,temp
392 ',(type-specifier (third type))))))
393 (temps) types)
394 (values ,@(temps)))))
395
396
397 ;;; Convert-Type-Check -- Internal
398 ;;;
399 ;;; Splice in explicit type check code immediately before the node that its
400 ;;; Cont's Dest. This code receives the value(s) that were being passed to
401 ;;; Cont, checks the type(s) of the value(s), then passes them on to Cont.
402 ;;; We:
403 ;;; -- Ensure that Cont starts a block, so that we can freely manipulate its
404 ;;; uses.
405 ;;; -- Make a new continuation and move Cont's uses to it. Set type set
406 ;;; Type-Check in Cont to :DELETED to indicate that the check has been
407 ;;; done.
408 ;;; -- Make the Dest node start its block so that we can splice in the type
409 ;;; check code.
410 ;;; -- Splice in a new block before the Dest block, giving it all the Dest's
411 ;;; predecessors.
412 ;;; -- Convert the check form, using the new block start as Start and a dummy
413 ;;; continuation as Cont.
414 ;;; -- Set the new block's start and end cleanups to the *start* cleanup of
415 ;;; Prev's block. This overrides the incorrect default from
416 ;;; With-IR1-Environment.
417 ;;; -- Finish off the dummy continuation's block, and change the use to a use
418 ;;; of Cont. (we need to use the dummy continuation to get the control
419 ;;; transfer right, since we want to go to Prev's block, not Cont's.)
420 ;;; Link the new block to Prev's block.
421 ;;; -- Substitute the new continuation for the dummy placeholder argument.
422 ;;; Since no let conversion has been done yet, we can find the placeholder.
423 ;;; The [mv-]combination node from the mv-bind in the check form will be
424 ;;; the Use of the new check continuation. We substitute for the first
425 ;;; argument of this node.
426 ;;; -- Invoke local call analysis to convert the call to a let.
427 ;;;
428 (defun convert-type-check (cont types)
429 (declare (type continuation cont) (list types))
430 (with-ir1-environment (continuation-dest cont)
431 (ensure-block-start cont)
432 (let* ((new-start (make-continuation))
433 (dest (continuation-dest cont))
434 (prev (node-prev dest)))
435 (continuation-starts-block new-start)
436 (substitute-continuation-uses new-start cont)
437 (setf (continuation-%type-check cont) :deleted)
438
439 (when (continuation-use prev)
440 (node-ends-block (continuation-use prev)))
441
442 (let* ((prev-block (continuation-block prev))
443 (new-block (continuation-block new-start))
444 (dummy (make-continuation)))
445 (dolist (block (block-pred prev-block))
446 (change-block-successor block prev-block new-block))
447 (ir1-convert new-start dummy (make-type-check-form types))
448 (assert (eq (continuation-block dummy) new-block))
449
450 (let ((node (continuation-use dummy)))
451 (setf (block-last new-block) node)
452 (delete-continuation-use node)
453 (add-continuation-use node cont))
454 (link-blocks new-block prev-block))
455
456 (let* ((node (continuation-use cont))
457 (args (basic-combination-args node))
458 (victim (first args)))
459 (assert (and (= (length args) 1)
460 (eq (constant-value
461 (ref-leaf
462 (continuation-use victim)))
463 'dummy)))
464 (substitute-continuation new-start victim)))
465
466 (local-call-analyze *current-component*))
467
468 (undefined-value))
469
470
471 ;;; DO-TYPE-WARNING -- Internal
472 ;;;
473 ;;; Emit a type warning for Node. If the value of node is being used for a
474 ;;; variable binding, we figure out which one for source context. If the value
475 ;;; is a constant, we print it specially. We ignore nodes whose type is NIL,
476 ;;; since they are supposed to never return.
477 ;;;
478 (defun do-type-warning (node)
479 (declare (type node node))
480 (let* ((*compiler-error-context* node)
481 (cont (node-cont node))
482 (atype-spec (type-specifier (continuation-asserted-type cont)))
483 (dtype (node-derived-type node))
484 (dest (continuation-dest cont))
485 (what (when (and (combination-p dest)
486 (eq (combination-kind dest) :local))
487 (let ((lambda (combination-lambda dest))
488 (pos (eposition cont (combination-args dest))))
489 (format nil "~:[A possible~;The~] binding of ~S"
490 (and (continuation-use cont)
491 (eq (functional-kind lambda) :let))
492 (leaf-name (elt (lambda-vars lambda) pos)))))))
493 (cond ((eq dtype *empty-type*))
494 ((and (ref-p node) (constant-p (ref-leaf node)))
495 (compiler-warning "~:[This~;~:*~A~] is not a ~<~%~9T~:;~S:~>~% ~S"
496 what atype-spec (constant-value (ref-leaf node))))
497 (t
498 (compiler-warning
499 "~:[Result~;~:*~A~] is a ~S, ~<~%~9T~:;not a ~S.~>"
500 what (type-specifier dtype) atype-spec))))
501 (undefined-value))
502
503
504 ;;; MARK-ERROR-CONTINUATION -- Internal
505 ;;;
506 ;;; Mark Cont as being a continuation with a manifest type error. We set
507 ;;; the kind to :ERROR, and clear any FUNCTION-INFO if the continuation is an
508 ;;; argument to a known call. The last is done so that the back end doesn't
509 ;;; have to worry about type errors in arguments to known functions. This
510 ;;; clearing is inhibited for things with IR2-CONVERT methods, since we can't
511 ;;; do a full call to funny functions.
512 ;;;
513 (defun mark-error-continuation (cont)
514 (declare (type continuation cont))
515 (setf (continuation-%type-check cont) :error)
516 (let ((dest (continuation-dest cont)))
517 (when (and (combination-p dest)
518 (let ((kind (basic-combination-kind dest)))
519 (or (eq kind :full)
520 (and (function-info-p kind)
521 (not (function-info-ir2-convert kind))))))
522 (setf (basic-combination-kind dest) :error)))
523 (undefined-value))
524
525
526 ;;; Generate-Type-Checks -- Interface
527 ;;;
528 ;;; Loop over all blocks in Component that have TYPE-CHECK set, looking for
529 ;;; continuations with TYPE-CHECK T. We do two mostly unrelated things: detect
530 ;;; compile-time type errors and determine if and how to do run-time type
531 ;;; checks.
532 ;;;
533 ;;; If there is a compile-time type error, then we mark the continuation and
534 ;;; emit a warning if appropriate. This part loops over all the uses of the
535 ;;; continuation, since after we convert the check, the :DELETED kind will
536 ;;; inhibit warnings about the types of other uses.
537 ;;;
538 ;;; If a continuation is too complex to be checked by the back end, or is
539 ;;; better checked with explicit code, then convert to an explicit test.
540 ;;; Assertions that can checked by the back end are passed through. Assertions
541 ;;; that can't be tested are flamed about and marked as not needing to be
542 ;;; checked.
543 ;;;
544 ;;; If we determine that a type check won't be done, then we set TYPE-CHECK
545 ;;; to :NO-CHECK. In the non-hairy cases, this is just to prevent us from
546 ;;; wasting time coming to the same conclusion again on a later iteration. In
547 ;;; the hairy case, we must indicate to LTN that it must choose a safe
548 ;;; implementation, since IR2 conversion will choke on the check.
549 ;;;
550 ;;; The generation of the type checks is delayed until all the type
551 ;;; check decisions have been made because the generation of the type
552 ;;; checks creates new nodes who's derived types aren't always updated
553 ;;; which may lead to inappropriate template choices due to the
554 ;;; modification of argument types.
555 ;;;
556 (defun generate-type-checks (component)
557 (collect ((conts))
558 (do-blocks (block component)
559 (when (block-type-check block)
560 (do-nodes (node cont block)
561 (let ((type-check (continuation-type-check cont)))
562 (unless (member type-check '(nil :error :deleted))
563 (let ((atype (continuation-asserted-type cont)))
564 (do-uses (use cont)
565 (unless (values-types-intersect (node-derived-type use)
566 atype)
567 (mark-error-continuation cont)
568 (unless (policy node (= brevity 3))
569 (do-type-warning use))))))
570 (when (and (eq type-check t)
571 (not *byte-compiling*))
572 (if (probable-type-check-p cont)
573 (conts cont)
574 (setf (continuation-%type-check cont) :no-check)))))
575
576 (setf (block-type-check block) nil)))
577
578 (dolist (cont (conts))
579 (multiple-value-bind (check types)
580 (continuation-check-types cont)
581 (ecase check
582 (:simple)
583 (:hairy
584 (convert-type-check cont types))
585 (:too-hairy
586 (let* ((context (continuation-dest cont))
587 (*compiler-error-context* context))
588 (when (policy context (>= safety brevity))
589 (compiler-note
590 "Type assertion too complex to check:~% ~S."
591 (type-specifier (continuation-asserted-type cont)))))
592 (setf (continuation-%type-check cont) :deleted))))))
593
594 (undefined-value))

  ViewVC Help
Powered by ViewVC 1.1.5