Changeset 11128


Ignore:
Timestamp:
Oct 17, 2008, 1:05:58 PM (11 years ago)
Author:
gz
Message:

Add lfunloop macro; remove remnants of lock-accounting support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/macros.lisp

    r11088 r11128  
    735735    `(let* ((,temp (function-to-function-vector ,f)))
    736736      (%svref ,temp (the fixnum (1- (the fixnum (uvsize ,temp))))))))
     737
     738(defmacro lfunloop (for var in function &body loop-body)
     739  "Loop over immediates in function"
     740  (assert (and (or (equal (symbol-name for) "FOR") (equal (symbol-name for) "AS"))
     741               (equal (symbol-name in) "IN")))
     742  (let ((fn (gensym))
     743        (lfv (gensym))
     744        (i (gensym)))
     745    `(loop with ,fn = ,function
     746           with ,lfv = (function-to-function-vector ,fn)
     747           for ,i from #+ppc-target 1 #+x86-target (%function-code-words ,fn) below (%i- (uvsize  ,lfv) 1)
     748           as ,var = (%svref ,lfv ,i)
     749           ,@loop-body)))
    737750
    738751(defmacro cond (&rest args &aux clause)
     
    23892402;;; Bind per-thread specials which help with lock accounting.
    23902403(defmacro with-lock-context (&body body)
    2391   #+lock-accounting
    2392   `(let* ((*locks-held* *locks-held*)
    2393           (*locks-pending* *locks-pending*)
    2394           (*lock-conses* *lock-conses*))
    2395     ,@body)
    2396   #-lock-accounting
    23972404  `(progn ,@body))
    23982405
Note: See TracChangeset for help on using the changeset viewer.