From b8dc39a52722797c1aebf6822e6df71ff7e7108b Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Tue, 3 Apr 1990 06:01:54 +0000 Subject: [PATCH] Patch inline code so that inliners that call out of line will see constant operands rather than stack locations. --- v7/src/compiler/rtlgen/opncod.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/v7/src/compiler/rtlgen/opncod.scm b/v7/src/compiler/rtlgen/opncod.scm index bfe39e141..51c83e32b 100644 --- a/v7/src/compiler/rtlgen/opncod.scm +++ b/v7/src/compiler/rtlgen/opncod.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/opncod.scm,v 4.35 1990/02/24 04:01:42 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/opncod.scm,v 4.36 1990/04/03 06:01:54 jinx Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -127,7 +127,8 @@ MIT in each case. |# ;; This value of context is a special kludge. See ;; `generate/return*' for the details. (length (inliner/operands inliner)) - index->stack-reference))) + (lambda (index) + (index->reduction-expression index combination))))) (if prefix (scfg*scfg->scfg! (prefix (combination/frame-size combination) 0) @@ -155,9 +156,13 @@ MIT in each case. |# (continuation*/register (subproblem-continuation subproblem)))))))) -(define (index->stack-reference index) - (rtl:make-fetch - (stack-locative-offset (rtl:make-fetch register:stack-pointer) index))) +(define (index->reduction-expression index combination) + (let ((operand (list-ref (combination/operands combination) index))) + (if (rvalue-known-constant? operand) + (rtl:make-constant (rvalue-constant-value operand)) + (rtl:make-fetch + (stack-locative-offset (rtl:make-fetch register:stack-pointer) + index))))) (define-integrable (combination/reduction? combination) (return-operator/reduction? (combination/continuation combination))) -- 2.25.1