From 4abd83583fc073904cd2a144125fc46fbe43ca64 Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Thu, 6 Jul 1995 21:48:58 +0000 Subject: [PATCH] Removed constraint on hook contiuations. The code produced is pretty horrible but it works. When this happends and COMPILER:GURU? is #T a warning is issued. --- v8/src/compiler/midend/laterew.scm | 40 ++++++++++++++++-------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/v8/src/compiler/midend/laterew.scm b/v8/src/compiler/midend/laterew.scm index c9ecee2c7..5ab0482cb 100644 --- a/v8/src/compiler/midend/laterew.scm +++ b/v8/src/compiler/midend/laterew.scm @@ -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) (define *late-rewritten-operators* (make-eq-hash-table)) -- 2.25.1