Skip to content
Snippets Groups Projects
Commit 5cf131a7 authored by dtc's avatar dtc
Browse files

Update the profiler caller-info code for the x86 port which represent

a return address as a SAP. To save the costly calculation of the SAPs
code object the profiler maintains callers as SAPs assuming the caller
code objects will not move. GENCGC may move code objects and these
should be GCed to an older generation before profiling else some
caller code objects may be lost.
parent 6a96e623
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/profile.lisp,v 1.17 1997/07/21 14:37:00 pw Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/profile.lisp,v 1.18 1998/01/19 05:54:36 dtc Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -112,12 +112,23 @@ ...@@ -112,12 +112,23 @@
#-cmu #-cmu
(deftype consing-type () 'unsigned-byte) (deftype consing-type () 'unsigned-byte)
;;; On the CMUCL x86 port the return address is represented as a SAP
;;; and to save the costly calculation of the SAPs code object the
;;; profiler maintains callers as SAPs. These SAPs will become invalid
;;; if a caller code object moves, so this should be prevented by the
;;; use of purify or by moving code objects into an older generation
;;; when using GENCGC.
;;;
#+cmu #+cmu
(progn (progn
(defmacro get-caller-info () (defmacro get-caller-info ()
`(nth-value 1 (kernel:%caller-frame-and-pc))) `(nth-value 1 (kernel:%caller-frame-and-pc)))
#-(and cmu x86)
(defun print-caller-info (info stream)
(prin1 (kernel:lra-code-header info) stream))
#+(and cmu x86)
(defun print-caller-info (info stream) (defun print-caller-info (info stream)
(prin1 (kernel:lra-code-header info) stream))) (prin1 (nth-value 1 (di::compute-lra-data-from-pc info)) stream)))
#-cmu #-cmu
(progn (progn
...@@ -232,7 +243,10 @@ ...@@ -232,7 +243,10 @@
((null current) ((null current)
(push (cons caller 1) callers)) (push (cons caller 1) callers))
(let ((old-caller-info (car current))) (let ((old-caller-info (car current)))
(when (eq caller (car old-caller-info)) (when #-(and cmu x86) (eq caller
(car old-caller-info))
#+(and cmu x86) (sys:sap=
caller (car old-caller-info))
(if prev (if prev
(setf (cdr prev) (cdr current)) (setf (cdr prev) (cdr current))
(setq callers (cdr current))) (setq callers (cdr current)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment