From: Mark Friedman Date: Mon, 25 Apr 1988 21:45:08 +0000 (+0000) Subject: Added a FIXNUM type of register analagous to ADDRESS registers. X-Git-Tag: 20090517-FFI~12803 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=88a60a1e65dd0e307dc373d6d20d5c56057745d7;p=mit-scheme.git Added a FIXNUM type of register analagous to ADDRESS registers. Their current use is to hold the results of OBJECT->FIXNUM expressions and assignments of such registers to other registers. We have to tell the cse code that such registers and expressions are invalid across anything that can call the garbage collector. This is because the garbage collector would currently barf on such values that have no type codes (i.e. fixnums which have had their type codes removed). In the future, FIXNUM registers may contain the reults of fixnum arithmetic expressions, so that we are not doing so much boxing and unboxing. Currently however, all such results are boxed into their destinations. --- diff --git a/v7/src/compiler/rtlbase/rtlexp.scm b/v7/src/compiler/rtlbase/rtlexp.scm index 84209ed56..2b555a7fd 100644 --- a/v7/src/compiler/rtlbase/rtlexp.scm +++ b/v7/src/compiler/rtlbase/rtlexp.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlbase/rtlexp.scm,v 4.3 1988/03/14 21:04:40 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlbase/rtlexp.scm,v 4.4 1988/04/25 21:44:58 markf Exp $ Copyright (c) 1987 Massachusetts Institute of Technology @@ -74,6 +74,24 @@ MIT in each case. |# (or (rtl:object->address? expression) (rtl:variable-cache? expression) (rtl:assignment-cache? expression)))) + +(define (rtl:fixnum-valued-expression? expression) + (if (rtl:register? expression) + (register-contains-fixnum? (rtl:register-number expression)) + (rtl:object->fixnum? expression))) + +(define (rtl:optimizable? expression) + ;;; In order to avoid a combinatorial explosion in the number of + ;;; rules required in the lapgen phase we create a class of + ;;; expression types which we don't want optimized. We will + ;;; explicitly assign these expression types to registers during + ;;; rtl generation and then we need only create rules for how to + ;;; generate assignments to registers. Some day we will have + ;;; some facility for subrule hierarchies which may avoid the + ;;; combinatorial explosion. When that happens the next test may + ;;; be replaced by true. + (not (memq (rtl:expression-type expression) + '(OBJECT->FIXNUM)))) (define (rtl:map-subexpressions expression procedure) (if (rtl:constant? expression) diff --git a/v7/src/compiler/rtlbase/rtlreg.scm b/v7/src/compiler/rtlbase/rtlreg.scm index ee22fbb1f..743fc5f32 100644 --- a/v7/src/compiler/rtlbase/rtlreg.scm +++ b/v7/src/compiler/rtlbase/rtlreg.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlbase/rtlreg.scm,v 4.2 1987/12/30 07:07:50 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlbase/rtlreg.scm,v 4.3 1988/04/25 21:45:08 markf Exp $ Copyright (c) 1987 Massachusetts Institute of Technology @@ -121,4 +121,7 @@ MIT in each case. |# (bit-string-set! (rgraph-register-crosses-call? *current-rgraph*) register)) (define-integrable (register-contains-address? register) - (memq register (rgraph-address-registers *current-rgraph*))) \ No newline at end of file + (memq register (rgraph-address-registers *current-rgraph*))) + +(define-integrable (register-contains-fixnum? register) + (memq register (rgraph-fixnum-registers *current-rgraph*))) \ No newline at end of file