Prune bailouts after contification
authorAndy Wingo <wingo@pobox.com>
Sat, 5 Apr 2014 10:16:34 +0000 (12:16 +0200)
committerAndy Wingo <wingo@pobox.com>
Sat, 5 Apr 2014 10:16:39 +0000 (12:16 +0200)
* module/language/cps/compile-bytecode.scm (optimize): Prune bailouts
  after contifying, so that we return to the tail of the contified
  function.

module/language/cps/compile-bytecode.scm

index c28d4d7..a4d96ad 100644 (file)
   ;; called.  The last is mainly to eliminate rest parameters that
   ;; aren't used, and thus shouldn't be consed.
 
-  (let* ((exp (run-pass exp prune-bailouts #:prune-bailouts? #t))
-         (exp (run-pass exp eliminate-dead-code #:eliminate-dead-code? #t))
+  (let* ((exp (run-pass exp eliminate-dead-code #:eliminate-dead-code? #t))
          (exp (run-pass exp prune-top-level-scopes #:prune-top-level-scopes? #t))
          (exp (run-pass exp simplify #:simplify? #t))
          (exp (run-pass exp contify #:contify? #t))
          (exp (run-pass exp inline-constructors #:inline-constructors? #t))
          (exp (run-pass exp specialize-primcalls #:specialize-primcalls? #t))
          (exp (run-pass exp elide-values #:elide-values? #t))
+         (exp (run-pass exp prune-bailouts #:prune-bailouts? #t))
          (exp (run-pass exp eliminate-common-subexpressions #:cps-cse? #t))
          (exp (run-pass exp eliminate-dead-code #:eliminate-dead-code? #t))
          (exp (run-pass exp simplify #:simplify? #t)))