Added a FIXNUM type of register analagous to ADDRESS registers.
authorMark Friedman <edu/mit/csail/zurich/markf>
Mon, 25 Apr 1988 21:45:08 +0000 (21:45 +0000)
committerMark Friedman <edu/mit/csail/zurich/markf>
Mon, 25 Apr 1988 21:45:08 +0000 (21:45 +0000)
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.

v7/src/compiler/rtlbase/rtlexp.scm
v7/src/compiler/rtlbase/rtlreg.scm

index 84209ed56fe89e99ce576f8763bb9c544faba0f9..2b555a7fd03cbeb7709b149eb4950d1b8f050301 100644 (file)
@@ -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))))
 \f
 (define (rtl:map-subexpressions expression procedure)
   (if (rtl:constant? expression)
index ee22fbb1f2ce76d5ba61050731fbd77c50f73d2c..743fc5f325a53f0fbca0a18204d563a2c6386c20 100644 (file)
@@ -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