1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Minor updates for Scheme runtime (statprof, backtraces)

* module/system/vm/frame.scm: Add a comment about a case that we need to
  handle in the future.
* module/statprof.scm (statprof-proc-call-data): Always use the program
  code as the key, even for primitives.
This commit is contained in:
Andy Wingo 2018-08-06 13:34:48 +02:00
parent 455015d8e9
commit d145b57baf
2 changed files with 6 additions and 6 deletions

View file

@ -503,11 +503,7 @@ none is available."
(error "Can't call statprof-proc-call-data while profiler is running."))
(unless (program? proc)
(error "statprof-call-data only works for VM programs"))
(let* ((code (program-code proc))
(key (if (primitive-code? code)
(procedure-name proc)
code)))
(hashv-ref (stack-samples->procedure-data state) key)))
(hashv-ref (stack-samples->procedure-data state) (program-code proc)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Stats

View file

@ -339,7 +339,7 @@
;;; Pretty printing
;;;
;; Basically there are two cases to deal with here:
;; Basically there are three cases to deal with here:
;;
;; 1. We've already parsed the arguments, and bound them to local
;; variables. In a standard (lambda (a b c) ...) call, this doesn't
@ -353,6 +353,10 @@
;; number of arguments, or perhaps we're doing a typed dispatch and
;; the types don't match. In that case the arguments are all on the
;; stack, and nothing else is on the stack.
;;
;; 3. Alternately it's possible that we're between a primitive call
;; and its associated return. In that case, we won't be able to
;; say anything at all.
(define* (frame-call-representation frame #:key top-frame?)
(let* ((ip (frame-instruction-pointer frame))