[Openmcl-cvs-notifications] r11128 - /trunk/source/lib/macros.lisp
gz at clozure.com
gz at clozure.com
Fri Oct 17 09:05:58 EDT 2008
Author: gz
Date: Fri Oct 17 09:05:58 2008
New Revision: 11128
Log:
Add lfunloop macro; remove remnants of lock-accounting support.
Modified:
trunk/source/lib/macros.lisp
Modified: trunk/source/lib/macros.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lib/macros.lisp (original)
+++ trunk/source/lib/macros.lisp Fri Oct 17 09:05:58 2008
@@ -734,6 +734,19 @@
(let* ((temp (gensym)))
`(let* ((,temp (function-to-function-vector ,f)))
(%svref ,temp (the fixnum (1- (the fixnum (uvsize ,temp))))))))
+
+(defmacro lfunloop (for var in function &body loop-body)
+ "Loop over immediates in function"
+ (assert (and (or (equal (symbol-name for) "FOR") (equal (symbol-name for=
) "AS"))
+ (equal (symbol-name in) "IN")))
+ (let ((fn (gensym))
+ (lfv (gensym))
+ (i (gensym)))
+ `(loop with ,fn =3D ,function
+ with ,lfv =3D (function-to-function-vector ,fn)
+ for ,i from #+ppc-target 1 #+x86-target (%function-code-words ,=
fn) below (%i- (uvsize ,lfv) 1)
+ as ,var =3D (%svref ,lfv ,i)
+ , at loop-body)))
=
(defmacro cond (&rest args &aux clause)
(when args
@@ -2388,12 +2401,6 @@
=
;;; Bind per-thread specials which help with lock accounting.
(defmacro with-lock-context (&body body)
- #+lock-accounting
- `(let* ((*locks-held* *locks-held*)
- (*locks-pending* *locks-pending*)
- (*lock-conses* *lock-conses*))
- , at body)
- #-lock-accounting
`(progn , at body))
=
(defmacro with-lock-grabbed ((lock &optional
More information about the Openmcl-cvs-notifications
mailing list