Add new method for finding variable that is used by stack-overwrite
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 28 Mar 1990 06:11:39 +0000 (06:11 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 28 Mar 1990 06:11:39 +0000 (06:11 +0000)
mechanism.  This new method does not use any tricks like variable
indirection to find the value, but produces a locative for that
particular variable.

v7/src/compiler/rtlgen/fndvar.scm
v7/src/compiler/rtlgen/rgstmt.scm

index 135b81d83f65c4ba587040bba6b164886001ad32..e9d9b32a720c092dea4ef3d8f9d2b3f6cf14d036 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/fndvar.scm,v 1.3 1989/10/26 07:38:52 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/fndvar.scm,v 1.4 1990/03/28 06:11:14 jinx Exp $
 
-Copyright (c) 1988 Massachusetts Institute of Technology
+Copyright (c) 1988, 1990 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -76,6 +76,15 @@ MIT in each case. |#
       block locative
       (error "Closure variable in IC frame" variable))))
 
+(define (find-stack-overwrite-variable context variable)
+  (find-variable-no-tricks context variable
+    (lambda (variable locative)
+      variable
+      locative)
+    (lambda (variable block locative)
+      block locative
+      (error "Stack overwrite slot in IC frame" variable))))
+\f
 (define (find-variable-internal context variable if-compiler if-ic)
   (let ((rvalue (lvalue-known-value variable)))
     (if (and rvalue
@@ -101,16 +110,18 @@ MIT in each case. |#
                (let ((register (variable/register variable)))
                  (if register
                      (if-compiler variable (register-locative register))
-                     (find-block/variable context variable
-                       (lambda (offset-locative)
-                         (lambda (block locative)
-                           (if-compiler
-                            variable
-                            (offset-locative
-                             locative
-                             (variable-offset block variable)))))
-                       (lambda (block locative)
-                         (if-ic variable block locative)))))))))))
+                     (find-variable-no-tricks context variable
+                                              if-compiler if-ic)))))))))
+
+(define (find-variable-no-tricks context variable if-compiler if-ic)
+  (find-block/variable context variable
+    (lambda (offset-locative)
+      (lambda (block locative)
+       (if-compiler variable
+                    (offset-locative locative
+                                     (variable-offset block variable)))))
+    (lambda (block locative)
+      (if-ic variable block locative))))
 \f
 (define (find-definition-variable context lvalue)
   (find-block/variable context lvalue
index 3fc74805f5d6ff24d6a5845508da6bcf39160940..e4b8bbc6f4313e5319a3571d07ab2dad2055223b 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/rgstmt.scm,v 4.13 1990/03/21 02:12:01 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/rgstmt.scm,v 4.14 1990/03/28 06:11:39 jinx Exp $
 
 Copyright (c) 1988, 1990 Massachusetts Institute of Technology
 
@@ -234,7 +234,7 @@ MIT in each case. |#
 
 (define (stack-overwrite-locative context target)
   (cond ((variable? target)
-        (find-closure-variable context target))
+        (find-stack-overwrite-variable context target))
        ((block? target)
         (block-ancestor-or-self->locative
          context