[armedbear-cvs] r11703 - trunk/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Tue Mar 10 22:22:55 UTC 2009
Author: ehuelsmann
Date: Tue Mar 10 22:22:52 2009
New Revision: 11703
Log:
DOTIMES loop variable efficiency: if the derived type of the limit var is integer,
make the loop var of integer type too (in order to compare them using jvm opcodes,
instead of static calls).
Modified:
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
Modified: trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp (original)
+++ trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp Tue Mar 10 22:22:52 2009
@@ -4252,7 +4252,11 @@
(when limit-variable
(derive-variable-representation limit-variable block)
(setf (variable-representation variable)
- (variable-representation limit-variable))))))))
+ (variable-representation limit-variable))
+ (let ((limit-type (variable-derived-type limit-variable)))
+ (when (integer-type-p limit-type)
+ (setf (variable-derived-type variable)
+ (%make-integer-type 0 (integer-type-high limit-type)))))))))))
(defun allocate-variable-register (variable)
(setf (variable-register variable)
@@ -6517,6 +6521,8 @@
(variable-declared-type variable))
((neq (variable-derived-type variable) :none)
(variable-derived-type variable))
+ ((= 0 (variable-writes variable))
+ (derive-type (variable-initform variable)))
(t
t))))))
((symbolp form)
More information about the armedbear-cvs
mailing list