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

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Thu Feb 5 14:46:24 UTC 2004


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

Modified Files:
	primitive-functions.lisp 
Log Message:
These changes are all about making the compiler smarter about
functions whose lambda-list look like (x &optional y).
Most such functions become about 20 bytes shorter. More importantly,
they become branch-less, reducing the CPU-cycle-cost of this
abstraction essentially zero.

Date: Thu Feb  5 09:46:24 2004
Author: ffjeld

Index: movitz/losp/muerte/primitive-functions.lisp
diff -u movitz/losp/muerte/primitive-functions.lisp:1.2 movitz/losp/muerte/primitive-functions.lisp:1.3
--- movitz/losp/muerte/primitive-functions.lisp:1.2	Mon Jan 19 06:23:47 2004
+++ movitz/losp/muerte/primitive-functions.lisp	Thu Feb  5 09:46:24 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.2 2004/01/19 11:23:47 ffjeld Exp $
+;;;; $Id: primitive-functions.lisp,v 1.3 2004/02/05 14:46:24 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -45,6 +45,19 @@
 ;;;    (:movb 2 :cl)
     (:movb 3 :cl)
     (:jmp (:esi -6))))
+
+(define-primitive-function trampoline-cl-dispatch-1or2 ()
+  "Jump to the entry-point designated by :cl, which must be 1 or 2."
+  (with-inline-assembly (:returns :nothing)
+    (:cmpb 1 :cl)
+    (:jne 'not-one)
+    (:jmp (:esi #.(bt:slot-offset 'movitz:movitz-funobj 'movitz:code-vector%1op)))
+   not-one
+    (:cmpb 2 :cl)
+    (:jne 'not-two)
+    (:jmp (:esi #.(bt:slot-offset 'movitz:movitz-funobj 'movitz:code-vector%2op)))
+   not-two
+    (:int 100)))
 
 (define-primitive-function no-code-vector ()
   "This is the default code-vector, which never should be called."





More information about the Movitz-cvs mailing list