summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorVibhav Pant <vibhavp@gmail.com>2017-01-26 01:02:16 +0530
committerVibhav Pant <vibhavp@gmail.com>2017-01-26 01:02:16 +0530
commit4e6140b28324a9a63d54084c920206d00aed094e (patch)
treec3ea7654fced7be18f0d8081ebe7f32d070decf8 /lisp/emacs-lisp
parent19cb3985a3795539b51d70625904e95a6e581eef (diff)
downloademacs-4e6140b28324a9a63d54084c920206d00aed094e.tar.gz
emacs-4e6140b28324a9a63d54084c920206d00aed094e.tar.bz2
emacs-4e6140b28324a9a63d54084c920206d00aed094e.zip
* lisp/emacs-lisp/disass.el: Display jump tables for switch.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/disass.el14
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el
index 97e45e070d0..22c1c962a39 100644
--- a/lisp/emacs-lisp/disass.el
+++ b/lisp/emacs-lisp/disass.el
@@ -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)