[movitz-cvs] CVS update: movitz/compiler.lisp
Frode Vatvedt Fjeld
ffjeld at common-lisp.net
Mon Jan 31 14:11:15 UTC 2005
Update of /project/movitz/cvsroot/movitz
In directory common-lisp.net:/tmp/cvs-serv14515
Modified Files:
compiler.lisp
Log Message:
Make the descision of whether a function should have a proper
stack-frame be in accord with the stack discipline. That is, if ESI is
written to, a stack-frame must be installed first.
Date: Mon Jan 31 06:11:14 2005
Author: ffjeld
Index: movitz/compiler.lisp
diff -u movitz/compiler.lisp:1.132 movitz/compiler.lisp:1.133
--- movitz/compiler.lisp:1.132 Mon Jan 31 03:19:23 2005
+++ movitz/compiler.lisp Mon Jan 31 06:11:14 2005
@@ -8,7 +8,7 @@
;;;; Created at: Wed Oct 25 12:30:49 2000
;;;; Distribution: See the accompanying file COPYING.
;;;;
-;;;; $Id: compiler.lisp,v 1.132 2005/01/31 11:19:23 ffjeld Exp $
+;;;; $Id: compiler.lisp,v 1.133 2005/01/31 14:11:14 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
@@ -34,7 +34,7 @@
"Make every compiled function check upon entry that the
stack-pointer is within bounds. Costs 3 code-bytes and a few cycles.")
-(defvar *compiler-allow-transients* nil
+(defvar *compiler-allow-transients* t
"Allow the compiler to keep function arguments solely in registers.
Hurst debugging, improves performance.")
@@ -796,7 +796,11 @@
(stack-frame-size (frame-map-size (frame-map function-env)))
(use-stack-frame-p (or (plusp stack-frame-size)
(tree-search resolved-code
- '(:pushl :popl :ebp :esp :call :leave)))))
+ '(:pushl :popl :ebp :esp :call :leave))
+ (some (lambda (x)
+ (and (not (equal '(:movl (:ebp -4) :esi) x))
+ (tree-search x ':esi)))
+ resolved-code))))
(let* ((function-code
(let* ((req-binding (movitz-binding (first (required-vars function-env))
function-env nil))
@@ -884,7 +888,12 @@
(resolved-code (finalize-code (extended-code function-env) funobj frame-map))
(stack-frame-size (frame-map-size (frame-map function-env)))
(use-stack-frame-p (or (plusp stack-frame-size)
- (tree-search resolved-code '(:ebp :esp :call :leave)))))
+ (tree-search resolved-code
+ '(:push :pop :ebp :esp :call :leave))
+ (some (lambda (x)
+ (and (not (equal '(:movl (:ebp -4) :esi) x))
+ (tree-search x ':esi)))
+ resolved-code))))
(multiple-value-bind (prelude-code have-normalized-ecx-p)
(make-compiled-function-prelude stack-frame-size function-env use-stack-frame-p
(need-normalized-ecx-p function-env) frame-map
More information about the Movitz-cvs
mailing list