[movitz-cvs] CVS update: movitz/losp/muerte/primitive-functions.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Thu Mar 18 09:21:18 UTC 2004


Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv28802

Modified Files:
	primitive-functions.lisp 
Log Message:
Minor optimizations regarding register usage.

Date: Thu Mar 18 04:21:18 2004
Author: ffjeld

Index: movitz/losp/muerte/primitive-functions.lisp
diff -u movitz/losp/muerte/primitive-functions.lisp:1.4 movitz/losp/muerte/primitive-functions.lisp:1.5
--- movitz/losp/muerte/primitive-functions.lisp:1.4	Thu Feb 26 08:43:51 2004
+++ movitz/losp/muerte/primitive-functions.lisp	Thu Mar 18 04:21:17 2004
@@ -10,7 +10,7 @@
 ;;;; Author:        Frode Vatvedt Fjeld <frodef at acm.org>
 ;;;; Created at:    Tue Oct  2 21:02:18 2001
 ;;;;                
-;;;; $Id: primitive-functions.lisp,v 1.4 2004/02/26 13:43:51 ffjeld Exp $
+;;;; $Id: primitive-functions.lisp,v 1.5 2004/03/18 09:21:17 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -466,9 +466,8 @@
     (:shrl 1 :eax)))
 
 (define-primitive-function fast-cons ()
-  "Call with car in eax and cdr in ebx. Preserves EDX."
+  "Allocate a cons cell. Call with car in eax and cdr in ebx."
   (with-inline-assembly (:returns :multiple-values)
-    (:pushl :edx)
     (:xchgl :eax :ecx)
     (:locally (:movl (:edi (:edi-offset malloc-buffer)) :eax))
     (:movl (:eax 4) :edx)
@@ -483,24 +482,21 @@
     (:movl :ecx (:eax))
     (:movl :ebx (:eax 4))
     (:incl :eax)
-    (:popl :edx)
     (:ret)))
 
 (define-primitive-function ensure-heap-cons-variable ()
   "Call with lended variable (a cons) in EAX. Preserves EDX."
   (with-inline-assembly (:returns :multiple-values)
-    ;; (:movl (:ebp :ecx) :eax)		; stack-frame variable's content into eax
     (:cmpl :ebp :eax)			; is cons above stack-frame?
     (:jge 'return-ok)
     (:cmpl :esp :eax)			; is cons below stack-frame?
     (:jl 'return-ok)
     ;; must migrate cell onto heap
+    (:pushl :edx)
     (:movl (:eax 3) :ebx)		; cdr
     (:movl (:eax -1) :eax)		; car
-    ;; (:pushl :ecx)
     (:locally (:call (:edi (:edi-offset fast-cons))))
-    ;; (:popl :ecx)
-    ;; (:movl :eax (:ebx :ecx))
+    (:popl :edx)
     return-ok
     (:ret)))
 





More information about the Movitz-cvs mailing list