summaryrefslogtreecommitdiff
path: root/module/statprof.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-01-30 17:47:03 +0100
committerAndy Wingo <wingo@pobox.com>2016-01-31 10:45:02 +0100
commit67e8aa85e81af1644eb75893c173a697ae3d687f (patch)
treeec12aed7ce787d976cd09b245fba58d664734322 /module/statprof.scm
parentffc9bc9149d7c99940e1fe4537d3235846802380 (diff)
downloadguile-67e8aa85e81af1644eb75893c173a697ae3d687f.tar.gz
Remove frame-local-ref, frame-local-set!
* libguile/frames.h (scm_frame_num_locals, scm_frame_local_ref) (scm_frame_local_set_x): Remove. As long as we are changing the interface in a backward-incompatible way, we might as well remove these. * libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref) (scm_frame_local_set_x, scm_init_frames_builtins, scm_init_frames): Arrange to make frame-local-ref et al private to frames.scm. * module/system/vm/frame.scm: Load scm_init_frames_builtins extensions. (frame-instruction-pointer-or-primitive-procedure-name): New public function. (frame-binding-ref, frame-binding-set!): Allow binding objects as vars. * module/system/repl/debug.scm (print-locals): Pass binding directly to frame-binding-ref. * module/statprof.scm (sample-stack-procs, count-call): Use new frame-instruction-pointer-or-primitive-procedure-name function.
Diffstat (limited to 'module/statprof.scm')
-rw-r--r--module/statprof.scm14
1 files changed, 3 insertions, 11 deletions
diff --git a/module/statprof.scm b/module/statprof.scm
index 8fb0951e8..7a18bb420 100644
--- a/module/statprof.scm
+++ b/module/statprof.scm
@@ -329,13 +329,8 @@
(set-buffer! state buffer)
(set-buffer-pos! state (1+ pos)))
(else
- (let ((ip (frame-instruction-pointer frame)))
- (write-sample-and-continue
- (if (primitive-code? ip)
- ;; Grovel and get the primitive name from the gsubr, which
- ;; we know to be in slot 0.
- (procedure-name (frame-local-ref frame 0 'scm))
- ip)))))))
+ (write-sample-and-continue
+ (frame-instruction-pointer-or-primitive-procedure-name frame))))))
(define (reset-sigprof-timer usecs)
;; Guile's setitimer binding is terrible.
@@ -382,10 +377,7 @@
(accumulate-time state (get-internal-run-time))
;; We know local 0 is a SCM value: the c
- (let* ((ip (frame-instruction-pointer frame))
- (key (if (primitive-code? ip)
- (procedure-name (frame-local-ref frame 0 'scm))
- ip))
+ (let* ((key (frame-instruction-pointer-or-primitive-procedure-name frame))
(handle (hashv-create-handle! (call-counts state) key 0)))
(set-cdr! handle (1+ (cdr handle))))