]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/disass.el: Display jump tables for switch.
authorVibhav Pant <vibhavp@gmail.com>
Wed, 25 Jan 2017 19:32:16 +0000 (01:02 +0530)
committerVibhav Pant <vibhavp@gmail.com>
Wed, 25 Jan 2017 19:32:16 +0000 (01:02 +0530)
lisp/emacs-lisp/disass.el

index 97e45e070d0d6dddfa95e5af77402bed50242cfd..22c1c962a39e2fbfde8b3cc208b83cb7cab3725a 100644 (file)
@@ -221,9 +221,17 @@ OBJ should be a call to BYTE-CODE generated by the byte compiler."
                ((memq op '(byte-constant byte-constant2))
                 ;; it's a constant
                 (setq arg (car arg))
-                ;; but if the value of the constant is compiled code, then
-                ;; recursively disassemble it.
-                (cond ((or (byte-code-function-p arg)
+                 ;; if the succeeding op is byte-switch, display the jump table
+                 ;; used
+                (cond ((eq (car-safe (car-safe (cdr lap))) 'byte-switch)
+                         (insert (format "<jump-table-%s ( " (hash-table-test arg)))
+                         (maphash #'(lambda (value tag)
+                                      (insert (format "%s %s " value (cadr tag))))
+                                  arg)
+                         (insert ")>"))
+                  ;; if the value of the constant is compiled code, then
+                  ;; recursively disassemble it.
+                  ((or (byte-code-function-p arg)
                            (and (consp arg) (functionp arg)
                                 (assq 'byte-code arg))
                            (and (eq (car-safe arg) 'macro)