From: Guillermo J. Rozas Date: Wed, 28 Mar 1990 06:11:39 +0000 (+0000) Subject: Add new method for finding variable that is used by stack-overwrite X-Git-Tag: 20090517-FFI~11488 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=979f50d97fb7aa67db9dd902f49e7940effbe8db;p=mit-scheme.git Add new method for finding variable that is used by stack-overwrite mechanism. This new method does not use any tricks like variable indirection to find the value, but produces a locative for that particular variable. --- diff --git a/v7/src/compiler/rtlgen/fndvar.scm b/v7/src/compiler/rtlgen/fndvar.scm index 135b81d83..e9d9b32a7 100644 --- a/v7/src/compiler/rtlgen/fndvar.scm +++ b/v7/src/compiler/rtlgen/fndvar.scm @@ -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)))) + (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)))) (define (find-definition-variable context lvalue) (find-block/variable context lvalue diff --git a/v7/src/compiler/rtlgen/rgstmt.scm b/v7/src/compiler/rtlgen/rgstmt.scm index 3fc74805f..e4b8bbc6f 100644 --- a/v7/src/compiler/rtlgen/rgstmt.scm +++ b/v7/src/compiler/rtlgen/rgstmt.scm @@ -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