guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 02/03: Minor updates for Scheme runtime (statprof, backt


From: Andy Wingo
Subject: [Guile-commits] 02/03: Minor updates for Scheme runtime (statprof, backtraces)
Date: Mon, 6 Aug 2018 07:38:25 -0400 (EDT)

wingo pushed a commit to branch lightning
in repository guile.

commit d145b57bafc4ae46cd8b23909e0ee6053e60a645
Author: Andy Wingo <address@hidden>
Date:   Mon Aug 6 13:34:48 2018 +0200

    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.
---
 module/statprof.scm        | 6 +-----
 module/system/vm/frame.scm | 6 +++++-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/module/statprof.scm b/module/statprof.scm
index 8b90e64..a36c215 100644
--- a/module/statprof.scm
+++ b/module/statprof.scm
@@ -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
diff --git a/module/system/vm/frame.scm b/module/system/vm/frame.scm
index 1cf7af5..2491ed0 100644
--- a/module/system/vm/frame.scm
+++ b/module/system/vm/frame.scm
@@ -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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]