- ;; Delay the generation of type checks until the type
- ;; constraints have had time to propagate, else the compiler can
- ;; confuse itself.
- (unless (and (or (component-reoptimize component)
- (component-reanalyze component)
- (component-new-funs component)
- (component-reanalyze-funs component))
- (< loop-count (- *reoptimize-after-type-check-max* 4)))
- (maybe-mumble "type ")
- (generate-type-checks component)
- (unless (or (component-reoptimize component)
- (component-reanalyze component)
- (component-new-funs component)
- (component-reanalyze-funs component))
- (return)))
+ (flet ((want-reoptimization-p ()
+ (or (component-reoptimize component)
+ (component-reanalyze component)
+ (component-new-functionals component)
+ (component-reanalyze-functionals component))))
+ (unless (and (want-reoptimization-p)
+ ;; We delay the generation of type checks until
+ ;; the type constraints have had time to
+ ;; propagate, else the compiler can confuse itself.
+ (< loop-count (- *reoptimize-after-type-check-max* 4)))
+ (maybe-mumble "type ")
+ (generate-type-checks component)
+ (unless (want-reoptimization-p)
+ (return))))