Skip to content

Commit

Permalink
* swank-lispworks.lisp (list-callers-internal): Revert to previous
Browse files Browse the repository at this point in the history
low level implementation, fixed for LW6.
(list-callees-internal): Reimplement using low level instead of
the compiler's xref.
  • Loading branch information
Martin Simmons committed Nov 2, 2010
1 parent f884385 commit 2a71053
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2010-11-02 Martin Simmons <martin@lispworks.com>

* swank-lispworks.lisp (list-callers-internal): Revert to previous
low level implementation, fixed for LW6.
(list-callees-internal): Reimplement using low level instead of
the compiler's xref.

2010-10-23 Stas Boukarev <stassats@gmail.com>

* slime.el (slime-goto-location-position): In case of
Expand Down
32 changes: 13 additions & 19 deletions swank-lispworks.lisp
Expand Up @@ -697,18 +697,17 @@ function names like \(SETF GET)."
(defxref who-macroexpands hcl:who-calls) ; macros are in the calls table too
(defxref calls-who hcl:calls-who)
(defxref list-callers list-callers-internal)
#+lispworks6
(defxref list-callees list-callees-internal)

#-lispworks6
(defun list-callers-internal (name)
(let ((callers (make-array 100
:fill-pointer 0
:adjustable t)))
(hcl:sweep-all-objects
#'(lambda (object)
(when (and #+Harlequin-PC-Lisp (low:compiled-code-p object)
#-Harlequin-PC-Lisp (sys::callablep object)
#+Harlequin-Unix-Lisp (sys:callablep object)
#-(or Harlequin-PC-Lisp Harlequin-Unix-Lisp) (sys:compiled-code-p object)
(system::find-constant$funcallable name object))
(vector-push-extend object callers))))
;; Delay dspec:object-dspec until after sweep-all-objects
Expand All @@ -718,23 +717,18 @@ function names like \(SETF GET)."
(list 'function object)
(or (dspec:object-dspec object) object)))))

#+lispworks6
(defun list-callers-internal (name)
;; Delay dspec:object-dspec until after sweep-all-objects
;; to reduce allocation problems.
(loop for object in (hcl::who-calls name)
collect (if (symbolp object)
(list 'function object)
(or (dspec:object-dspec object) object))))

#+lispworks6
(defun list-callees-internal (name)
;; Delay dspec:object-dspec until after sweep-all-objects
;; to reduce allocation problems.
(loop for object in (hcl::calls-who name)
collect (if (symbolp object)
(list 'function object)
(or (dspec:object-dspec object) object))))
(let ((callees '()))
(system::find-constant$funcallable
'junk name
:test #'(lambda (junk constant)
(declare (ignore junk))
(when (and (symbolp constant)
(fboundp constant))
(pushnew (list 'function constant) callees :test 'equal))
;; Return nil so we iterate over all constants.
nil))
callees))

;; only for lispworks 4.2 and above
#-lispworks4.1
Expand Down

0 comments on commit 2a71053

Please sign in to comment.