~ chicken-core (chicken-5) 723a4694ce3fd0dac732207ff612a5511497e7a0
commit 723a4694ce3fd0dac732207ff612a5511497e7a0 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Tue Nov 1 12:42:06 2011 +0100 Commit: Mario Domenech Goulart <mario.goulart@gmail.com> CommitDate: Tue Nov 1 10:21:50 2011 -0200 cut of union types above a certain length Signed-off-by: Mario Domenech Goulart <mario.goulart@gmail.com> diff --git a/scrutinizer.scm b/scrutinizer.scm index a04220a3..967f82e8 100755 --- a/scrutinizer.scm +++ b/scrutinizer.scm @@ -104,6 +104,7 @@ (define-constant +fragment-max-length+ 6) (define-constant +fragment-max-depth+ 4) +(define-constant +maximal-union-type-length+ 20) (define specialization-statistics '()) @@ -1239,9 +1240,13 @@ constraints)) (simplify (third t)))) ((or) - (let ((ts (map simplify (cdr t)))) - (cond ((= 1 (length ts)) (car ts)) + (let* ((ts (map simplify (cdr t))) + (tslen (length ts))) + (cond ((= 1 tslen) (car ts)) ((null? ts) '*) + ((> tslen +maximal-union-type-length+) + (d "union-type cutoff! (~a): ~s" tslen ts) + '*) ((every procedure-type? ts) (if (any (cut eq? 'procedure <>) ts) 'procedureTrap