Removed constraint on hook contiuations. The code produced is pretty
authorStephen Adams <edu/mit/csail/zurich/adams>
Thu, 6 Jul 1995 21:48:58 +0000 (21:48 +0000)
committerStephen Adams <edu/mit/csail/zurich/adams>
Thu, 6 Jul 1995 21:48:58 +0000 (21:48 +0000)
horrible but it works.  When this happends and COMPILER:GURU? is #T a
warning is issued.

v8/src/compiler/midend/laterew.scm

index c9ecee2c7e3b043deaf450ec22de2780bab1a50a..5ab0482cbaaebe4266a02220643c12553a36633e 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: laterew.scm,v 1.7 1995/04/24 16:07:34 adams Exp $
+$Id: laterew.scm,v 1.8 1995/07/06 21:48:58 adams Exp $
 
 Copyright (c) 1994 Massachusetts Institute of Technology
 
@@ -160,16 +160,27 @@ MIT in each case. |#
       (let ((cont (first rands))
            (x    (second rands))
            (y    (third rands)))
-       (laterew/verify-hook-continuation cont)
        (let ((%continue
-              (if (QUOTE/? cont)
-                  (lambda (expr)
-                    expr)
-                  (lambda (expr)
-                    `(CALL (QUOTE ,%invoke-continuation)
-                           ,cont
-                           ,expr)))))
-                  
+              (cond ((QUOTE/? cont)
+                     (lambda (expr)
+                       expr))
+                    ((or (LOOKUP/? cont)
+                         (CALL/%stack-closure-ref? cont))
+                     (lambda (expr)
+                       `(CALL (QUOTE ,%invoke-continuation)
+                              ,cont
+                              ,expr)))
+                    (else
+                     (if compiler:guru?
+                         (internal-warning
+                          "Unexpected continuation to out-of-line hook" cont))
+                     (lambda (expr)
+                       (let ((cont-var (new-continuation-variable)))
+                         `(CALL (LAMBDA (,cont-var)
+                                  (CALL (QUOTE ,%invoke-continuation)
+                                        (LOOKUP ,cont-var)
+                                        ,expr))
+                                ,cont)))))))
          (cond ((form/number? x)
                 => (lambda (x-value)
                      (cond ((form/number? y)
@@ -223,15 +234,6 @@ MIT in each case. |#
                                ,cont
                                (LOOKUP ,x-name)
                                (LOOKUP ,y-name))))))))))))
-
-
-(define (laterew/verify-hook-continuation cont)
-  (if (not (or (QUOTE/? cont)
-              (LOOKUP/? cont)
-              (CALL/%stack-closure-ref? cont)))
-      (internal-error "Unexpected continuation to out-of-line hook"
-                     cont))
-  unspecific)
 \f
 (define *late-rewritten-operators* (make-eq-hash-table))